Method: Casper::RpcClient#chain_get_block
- Defined in:
-
lib/rpc/rpc.rb,
lib/rpc/rpc_client.rb
Returns block_info.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/rpc/rpc.rb', line 122 def chain_get_block(block_hash) begin state = Timeout::timeout(10) { client = Jimson::Client.new(@url) result = client.chain_get_block({"block_identifier" => {"Hash" => block_hash}}) @block_info = result["block"] if (!@block_info.empty?() && @block_info["hash"] != block_hash) raise("Returned block does not have a matching hash.") else @block_info end } rescue 'Timeout expired to retrieve block_info' end end |