Method: Casper::RpcClient#state_get_item

Defined in:
lib/rpc/rpc.rb,
lib/rpc/rpc_client.rb

#state_get_item(state_root_hash, key, path) ⇒ Object

Parameters:

  • state_root_hash (String)
  • key (String)
  • path (Array)


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/rpc/rpc.rb', line 157

def state_get_item(state_root_hash, key, path)
  begin
    state = Timeout::timeout(20) {
      client = Jimson::Client.new(@url)
      response = client.state_get_item({ 
        "state_root_hash" => state_root_hash, 
        "key" => key,
        "path" => path
      })
      @stored_value = response["stored_value"]
      @stored_value
    }
  rescue
    'Timeout expired to retrieve stored_value'
  end
end