diff --git a/lib/ethereum/http_client.rb b/lib/ethereum/http_client.rb index b8a214d..b2244eb 100644 --- a/lib/ethereum/http_client.rb +++ b/lib/ethereum/http_client.rb @@ -28,7 +28,12 @@ def send_single(payload) end def send_batch(batch) - raise NotImplementedError + 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 end