Skip to content

Commit

Permalink
fix(torii/graphql): filter out tokens with zero balance
Browse files Browse the repository at this point in the history
commit-id:11f63cc1
  • Loading branch information
lambda-0x committed Dec 5, 2024
1 parent 0cb5923 commit 683d381
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/torii/graphql/src/object/erc/token_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ async fn fetch_token_balances(
let mut conditions = vec![
"(b.account_address = ?)".to_string(),
"(t.metadata IS NULL OR length(t.metadata) > 0)".to_string(),
// Filter out zero balance
"b.balance != '0x0000000000000000000000000000000000000000000000000000000000000000'"
.to_string(),

Check warning on line 111 in crates/torii/graphql/src/object/erc/token_balance.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/graphql/src/object/erc/token_balance.rs#L109-L111

Added lines #L109 - L111 were not covered by tests
];

let mut cursor_param = &connection.after;
Expand Down

0 comments on commit 683d381

Please sign in to comment.