|
|
@ -3477,10 +3477,30 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|
|
|
|
|
|
|
describe "uncataloged_token_transfer_block_numbers/0" do |
|
|
|
describe "uncataloged_token_transfer_block_numbers/0" do |
|
|
|
test "returns a list of block numbers" do |
|
|
|
test "returns a list of block numbers" do |
|
|
|
log = insert(:token_transfer_log) |
|
|
|
block = insert(:block) |
|
|
|
|
|
|
|
address = insert(:address) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log = |
|
|
|
|
|
|
|
insert(:token_transfer_log, |
|
|
|
|
|
|
|
transaction: |
|
|
|
|
|
|
|
insert(:transaction, |
|
|
|
|
|
|
|
block_number: block.number, |
|
|
|
|
|
|
|
block_hash: block.hash, |
|
|
|
|
|
|
|
cumulative_gas_used: 0, |
|
|
|
|
|
|
|
gas_used: 0, |
|
|
|
|
|
|
|
index: 0 |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
address_hash: address.hash |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
block_number = log.transaction.block_number |
|
|
|
block_number = log.transaction.block_number |
|
|
|
assert {:ok, [^block_number]} = Chain.uncataloged_token_transfer_block_numbers() |
|
|
|
assert {:ok, [^block_number]} = Chain.uncataloged_token_transfer_block_numbers() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test "does not include transactions without a block_number" do |
|
|
|
|
|
|
|
insert(:token_transfer_log) |
|
|
|
|
|
|
|
assert {:ok, []} = Chain.uncataloged_token_transfer_block_numbers() |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "address_to_balances_by_day/1" do |
|
|
|
describe "address_to_balances_by_day/1" do |
|
|
|