Skip to content

Commit

Permalink
Fix eth enabled for fees
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Oct 11, 2021
1 parent d541409 commit d22584c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/lib/storage/src/tokens/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,21 @@ impl<'a, 'c> TokensSchema<'a, 'c> {
.fetch_all(self.0.conn())
.await?;

let result = Ok(tokens
let mut result: HashSet<_> = tokens
.into_iter()
.map(|t| TokenId(t.token_id as u32))
.collect());
.collect();

// ETH always has enough market volume
if tokens_to_check.contains(&0) && !result.contains(&TokenId(0)) {
result.insert(TokenId(0));
}

metrics::histogram!(
"sql.token.load_token_ids_that_enabled_for_fees",
start.elapsed()
);
result
Ok(result)
}

/// Get the number of ERC20 tokens from Database
Expand Down

0 comments on commit d22584c

Please sign in to comment.