|
|
@ -177,6 +177,20 @@ defmodule Explorer.SmartContract.ReaderTest do |
|
|
|
} |
|
|
|
} |
|
|
|
] = Reader.query_function(smart_contract.address_hash, %{name: "get", args: []}) |
|
|
|
] = Reader.query_function(smart_contract.address_hash, %{name: "get", args: []}) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test "nil arguments is treated as []" do |
|
|
|
|
|
|
|
smart_contract = insert(:smart_contract) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blockchain_get_function_mock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert [ |
|
|
|
|
|
|
|
%{ |
|
|
|
|
|
|
|
"name" => "", |
|
|
|
|
|
|
|
"type" => "uint256", |
|
|
|
|
|
|
|
"value" => 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] = Reader.query_function(smart_contract.address_hash, %{name: "get", args: nil}) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "normalize_args/1" do |
|
|
|
describe "normalize_args/1" do |
|
|
|