Skip to content

Commit

Permalink
feat: normalize contract addr
Browse files Browse the repository at this point in the history
  • Loading branch information
remiroyc committed Apr 12, 2024
1 parent 2463881 commit 7be192c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/indexer/src/handlers/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ pub async fn contract_stats(
Path(eth_contract_address): Path<String>,
state: State<AppState>,
) -> Result<Json<Stats>, (StatusCode, String)> {
let contract_address = normalize_hex(&eth_contract_address)
.expect("Contract address shall be an hexadecimal string");

let total_tokens_bridged_on_starknet = state
.store
.get_total_tokens_bridged_on_starknet(&eth_contract_address)
.get_total_tokens_bridged_on_starknet(&contract_address)
.await
.unwrap_or(0);

Expand Down

0 comments on commit 7be192c

Please sign in to comment.