Method: EvmClient::IpcClient#send_batch
- Defined in:
- lib/evm_client/ipc_client.rb
#send_batch(batch) ⇒ Object
Note: Guarantees the results are in the same order as defined in batch call. client.batch do
client.eth_block_number
client.eth_mining
end
> [“id”=>1, “result”=>“0x26”, “id”=>2, “result”=>false]
48 49 50 51 52 53 54 55 |
# File 'lib/evm_client/ipc_client.rb', line 48 def send_batch(batch) result = send_single(batch.to_json) result = JSON.parse(result) # Make sure the order is the same as it was when batching calls # See 6 Batch here http://www.jsonrpc.org/specification return result.sort_by! { |c| c['id'] } end |