From 15962fb9078cfffe521c464b79de2dcbb687441d Mon Sep 17 00:00:00 2001 From: Nikita Pozdniakov Date: Tue, 14 Feb 2023 12:50:19 +0300 Subject: [PATCH] Cut 'from' param from query contract request if it's empty --- CHANGELOG.md | 1 + apps/explorer/lib/explorer/smart_contract/reader.ex | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c9e3ba8f..4c9653f360 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixes +- [#6891](https://github.com/blockscout/blockscout/pull/6891) - Fix read contract for geth - [#6889](https://github.com/blockscout/blockscout/pull/6889) - Fix Internal Server Error on tx input decoding ### Chore diff --git a/apps/explorer/lib/explorer/smart_contract/reader.ex b/apps/explorer/lib/explorer/smart_contract/reader.ex index 1cad2e5cb9..eb2aa55f42 100644 --- a/apps/explorer/lib/explorer/smart_contract/reader.ex +++ b/apps/explorer/lib/explorer/smart_contract/reader.ex @@ -144,11 +144,11 @@ defmodule Explorer.SmartContract.Reader do |> Enum.map(fn {method_id, args} -> %{ contract_address: contract_address, - from: from, method_id: method_id, args: args, block_number: block_number } + |> (&if(!is_nil(from) && from != "", do: Map.put(&1, :from, from), else: &1)).() end) requests