Merge pull request #1540 from poanetwork/ab-erc721-token-balances-fix

fetch ERC721 token balances if sender is '0x0..0'
pull/1560/head
Victor Baranov 6 years ago committed by GitHub
commit 76d4cc6369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/indexer/lib/indexer/address/token_balances.ex
  2. 16
      apps/indexer/test/indexer/address/token_balances_test.exs

@ -37,10 +37,6 @@ defmodule Indexer.Address.TokenBalances do
Enum.filter(token_transfers_params, &do_filter_burn_address/1)
end
def do_filter_burn_address(%{from_address_hash: "0x0000000000000000000000000000000000000000", token_type: "ERC-721"}) do
false
end
def do_filter_burn_address(%{to_address_hash: "0x0000000000000000000000000000000000000000", token_type: "ERC-721"}) do
false
end

@ -35,7 +35,7 @@ defmodule Indexer.Address.TokenBalancesTest do
assert %{address_hash: token_contract_address_hash, block_number: block_number}
end
test "does not set params when the from_address_hash is the burn address for the Token ERC-721" do
test "does set params when the from_address_hash is the burn address for the Token ERC-721" do
block_number = 1
from_address_hash = "0x0000000000000000000000000000000000000000"
to_address_hash = "0x5b8410f67eb8040bb1cd1e8a4ff9d5f6ce678a15"
@ -51,7 +51,19 @@ defmodule Indexer.Address.TokenBalancesTest do
params_set = TokenBalances.params_set(%{token_transfers_params: [token_transfer_params]})
assert MapSet.size(params_set) == 0
assert params_set ==
MapSet.new([
%{
address_hash: "0x0000000000000000000000000000000000000000",
block_number: 1,
token_contract_address_hash: "0xe18035bf8712672935fdb4e5e431b1a0183d2dfc"
},
%{
address_hash: "0x5b8410f67eb8040bb1cd1e8a4ff9d5f6ce678a15",
block_number: 1,
token_contract_address_hash: "0xe18035bf8712672935fdb4e5e431b1a0183d2dfc"
}
])
end
test "does not set params when the to_address_hash is the burn address for the Token ERC-721" do

Loading…
Cancel
Save