diff --git a/.dialyzer-ignore b/.dialyzer-ignore index e9787e235d..0e081fd2f4 100644 --- a/.dialyzer-ignore +++ b/.dialyzer-ignore @@ -25,4 +25,4 @@ lib/explorer/exchange_rates/source.ex:113 lib/explorer/smart_contract/verifier.ex:89 lib/block_scout_web/templates/address_contract/index.html.eex:118 lib/explorer/staking/stake_snapshotting.ex:15: Function do_snapshotting/7 has no local return -lib/explorer/staking/stake_snapshotting.ex:214 +lib/explorer/staking/stake_snapshotting.ex:216 diff --git a/apps/explorer/lib/explorer/staking/stake_snapshotting.ex b/apps/explorer/lib/explorer/staking/stake_snapshotting.ex index d4548a0925..e803620e87 100644 --- a/apps/explorer/lib/explorer/staking/stake_snapshotting.ex +++ b/apps/explorer/lib/explorer/staking/stake_snapshotting.ex @@ -46,6 +46,8 @@ defmodule Explorer.Staking.StakeSnapshotting do |> Enum.zip(pool_staking_addresses) |> Map.new() + abi = abi_clarify_signatures(abi, new_signatures) + # get snapshotted amounts and active delegator list for the pool for each # pending validator by their pool id. # use `cached_pool_staking_responses` when possible @@ -229,6 +231,16 @@ defmodule Explorer.Staking.StakeSnapshotting do Publisher.broadcast(:stake_snapshotting_finished) end + defp abi_clarify_signatures(abi, new_signatures) do + if new_signatures do + abi + else + Jason.decode!( + ~s([{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"stakeAmountTotal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"stakeAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"poolDelegators","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"validatorShare","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"delegatorShare","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]) + ) + end + end + defp address_bytes_to_string(hash), do: "0x" <> Base.encode16(hash, case: :lower) defp snapshotted_pool_amounts_requests(pool_id, pool_staking_address, block_number, new_signatures) do