|
|
@ -210,8 +210,8 @@ defmodule EthereumJSONRPCTest do |
|
|
|
[ |
|
|
|
[ |
|
|
|
# start with :ok |
|
|
|
# start with :ok |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
block_quantity: "0x1", |
|
|
|
block_quantity: "0x6ae753", |
|
|
|
address: "0x8bf38d4764929064f2d4d3a56520a76ab3df415b" |
|
|
|
address: "0xe82719202e5965Cf5D9B6673B7503a3b92DE20be" |
|
|
|
}, |
|
|
|
}, |
|
|
|
# :ok, :error clause |
|
|
|
# :ok, :error clause |
|
|
|
%{ |
|
|
|
%{ |
|
|
@ -220,8 +220,8 @@ defmodule EthereumJSONRPCTest do |
|
|
|
}, |
|
|
|
}, |
|
|
|
# :error, :ok clause |
|
|
|
# :error, :ok clause |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
block_quantity: "0x35", |
|
|
|
block_quantity: "0x6bfb4b", |
|
|
|
address: "0x8bf38d4764929064f2d4d3a56520a76ab3df415b" |
|
|
|
address: "0xbb9bc244d798123fde783fcc1c72d3bb8c189413" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
json_rpc_named_arguments |
|
|
|
json_rpc_named_arguments |
|
|
@ -229,27 +229,20 @@ defmodule EthereumJSONRPCTest do |
|
|
|
|
|
|
|
|
|
|
|
assert params_list == [ |
|
|
|
assert params_list == [ |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
address: "0x8bf38d4764929064f2d4d3a56520a76ab3df415b", |
|
|
|
address: "0xe82719202e5965Cf5D9B6673B7503a3b92DE20be", |
|
|
|
block_number: 53, |
|
|
|
block_number: 7006035, |
|
|
|
code: |
|
|
|
code: |
|
|
|
"0x7009600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905" |
|
|
|
"0x7009600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905" |
|
|
|
}, |
|
|
|
}, |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
address: "0x8bf38d4764929064f2d4d3a56520a76ab3df415b", |
|
|
|
address: "0xbb9bc244d798123fde783fcc1c72d3bb8c189413", |
|
|
|
block_number: 1, |
|
|
|
block_number: 7076683, |
|
|
|
code: |
|
|
|
code: |
|
|
|
"0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" |
|
|
|
"0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
assert errors == [ |
|
|
|
assert Enum.count(errors) == 1 |
|
|
|
%{ |
|
|
|
|
|
|
|
code: -32602, |
|
|
|
|
|
|
|
data: %{address: "0x3", block_quantity: "0x2"}, |
|
|
|
|
|
|
|
message: |
|
|
|
|
|
|
|
"Invalid params: invalid length 1, expected a 0x-prefixed, padded, hex-encoded hash with length 40." |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|