Skip to content

Commit

Permalink
indexer: add missing normalize hex for ethereum
Browse files Browse the repository at this point in the history
  • Loading branch information
ptisserand committed Apr 8, 2024
1 parent cbf0426 commit c593a7c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apps/indexer/src/ethereum_indexer/events.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::storage::{BridgeChain, CrossChainTx, CrossChainTxKind, Event, EventLabel, Request};
use crate::{storage::{BridgeChain, CrossChainTx, CrossChainTxKind, Event, EventLabel, Request}, utils::normalize_hex};
use anyhow::{anyhow, Result};
use ethers::prelude::*;
use serde_json::{json, Value};
Expand Down Expand Up @@ -128,19 +128,19 @@ fn request_from_log_data(event_label: &EventLabel, data: Vec<U256>) -> Result<Re
EventLabel::DepositInitiatedL1 => Request {
hash: format!("0x{:032x}{:032x}", data[2], data[1]),
chain_src: BridgeChain::Ethereum,
collection_src: hex_strings[3].clone(),
collection_dst: hex_strings[4].clone(),
from: hex_strings[5].clone(),
to: hex_strings[6].clone(),
collection_src: normalize_hex(hex_strings[3].clone().as_str())?,
collection_dst: normalize_hex(hex_strings[4].clone().as_str())?,
from: normalize_hex(hex_strings[5].clone().as_str())?,
to: normalize_hex(hex_strings[6].clone().as_str())?,
content,
},
EventLabel::WithdrawCompletedL1 => Request {
hash: format!("0x{:032x}{:032x}", data[2], data[1]),
chain_src: BridgeChain::Starknet,
collection_src: hex_strings[4].clone(),
collection_dst: hex_strings[3].clone(),
from: hex_strings[6].clone(),
to: hex_strings[5].clone(),
collection_src: normalize_hex(hex_strings[4].clone().as_str())?,
collection_dst: normalize_hex(hex_strings[3].clone().as_str())?,
from: normalize_hex(hex_strings[6].clone().as_str())?,
to: normalize_hex(hex_strings[5].clone().as_str())?,
content,
},
_ => {
Expand Down

0 comments on commit c593a7c

Please sign in to comment.