Fix stake_snapshotting.ex

pull/3712/head
POA 4 years ago
parent 98f80f6bee
commit 8faa85a4b4
  1. 16
      apps/explorer/lib/explorer/staking/contract_reader.ex
  2. 2
      apps/explorer/lib/explorer/staking/stake_snapshotting.ex

@ -46,10 +46,18 @@ defmodule Explorer.Staking.ContractReader do
]
end
def active_delegators_request(pool_id, block_number) do
def active_delegators_request(pool_id, block_number, new_signatures) do
pool_delegators_signature =
if new_signatures do
# 561c4c81 = keccak256(poolDelegators(uint256))
"561c4c81"
else
# 9ea8082b = keccak256(poolDelegators(address))
"9ea8082b"
end
[
# 561c4c81 = keccak256(poolDelegators(uint256))
active_delegators: {:staking, "561c4c81", [pool_id], block_number}
active_delegators: {:staking, pool_delegators_signature, [pool_id], block_number}
]
end
@ -379,7 +387,7 @@ defmodule Explorer.Staking.ContractReader do
def pool_staking_requests(pool_id, block_number) do
[
active_delegators: active_delegators_request(pool_id, block_number)[:active_delegators],
active_delegators: active_delegators_request(pool_id, block_number, true)[:active_delegators],
# a1fc2753 = keccak256(poolDelegatorsInactive(uint256))
inactive_delegators: {:staking, "a1fc2753", [pool_id], block_number},
# bbbaf8c8 = keccak256(isPoolActive(uint256))

@ -71,7 +71,7 @@ defmodule Explorer.Staking.StakeSnapshotting do
staking_address_hash: pool_staking_address
},
ContractReader.perform_requests(
ContractReader.active_delegators_request(pool_id, block_number) ++
ContractReader.active_delegators_request(pool_id, block_number, new_signatures) ++
snapshotted_pool_amounts_requests(pool_id, pool_staking_address, block_number, new_signatures),
contracts,
abi

Loading…
Cancel
Save