From 8aa1e0e129fd3c15e2e0e9eb1c700ad6cc3c979a Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 30 Aug 2018 08:53:16 -0500 Subject: [PATCH] Cover Explorer.SmartContract.Reader --- .../test/explorer/smart_contract/reader_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/explorer/test/explorer/smart_contract/reader_test.exs b/apps/explorer/test/explorer/smart_contract/reader_test.exs index 9643f79dac..473281d252 100644 --- a/apps/explorer/test/explorer/smart_contract/reader_test.exs +++ b/apps/explorer/test/explorer/smart_contract/reader_test.exs @@ -177,6 +177,20 @@ defmodule Explorer.SmartContract.ReaderTest do } ] = Reader.query_function(smart_contract.address_hash, %{name: "get", args: []}) 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 describe "normalize_args/1" do