|
|
|
@ -1535,21 +1535,29 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do |
|
|
|
|
|
|
|
|
|
ctbs_erc_20 = |
|
|
|
|
for _ <- 0..50 do |
|
|
|
|
insert(:address_current_token_balance_with_token_id, address: address, token_type: "ERC-20", token_id: nil) |
|
|
|
|
insert(:address_current_token_balance_with_token_id_and_fixed_token_type, |
|
|
|
|
address: address, |
|
|
|
|
token_type: "ERC-20", |
|
|
|
|
token_id: nil |
|
|
|
|
) |
|
|
|
|
|> Repo.preload([:token]) |
|
|
|
|
end |
|
|
|
|
|> Enum.sort_by(fn x -> x.value end, :asc) |
|
|
|
|
|> Enum.sort_by(fn x -> Decimal.to_float(Decimal.mult(x.value, x.token.fiat_value)) end, :asc) |
|
|
|
|
|
|
|
|
|
ctbs_erc_721 = |
|
|
|
|
for _ <- 0..50 do |
|
|
|
|
insert(:address_current_token_balance_with_token_id, address: address, token_type: "ERC-721", token_id: nil) |
|
|
|
|
insert(:address_current_token_balance_with_token_id_and_fixed_token_type, |
|
|
|
|
address: address, |
|
|
|
|
token_type: "ERC-721", |
|
|
|
|
token_id: nil |
|
|
|
|
) |
|
|
|
|
|> Repo.preload([:token]) |
|
|
|
|
end |
|
|
|
|
|> Enum.sort_by(fn x -> x.value end, :asc) |
|
|
|
|
|
|
|
|
|
ctbs_erc_1155 = |
|
|
|
|
for _ <- 0..50 do |
|
|
|
|
insert(:address_current_token_balance_with_token_id, |
|
|
|
|
insert(:address_current_token_balance_with_token_id_and_fixed_token_type, |
|
|
|
|
address: address, |
|
|
|
|
token_type: "ERC-1155", |
|
|
|
|
token_id: Enum.random(1..100_000) |
|
|
|
|