Skip to content

Commit

Permalink
random fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dariorussi committed May 23, 2024
1 parent 39b578b commit f98c901
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions crates/sui-bridge-indexer/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use anyhow::Result;
use std::{fs, path::Path};

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use anyhow::Result;
use serde::Deserialize;
use std::{fs, path::Path};

/// config as loaded from `config.yaml`.
#[derive(Debug, Deserialize)]
Expand Down
8 changes: 4 additions & 4 deletions crates/sui-bridge-indexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ impl Display for TokenTransferStatus {
}

enum BridgeDataSource {
SUI,
ETH,
Sui,
Eth,
}

impl Display for BridgeDataSource {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let str = match self {
BridgeDataSource::ETH => "ETH",
BridgeDataSource::SUI => "SUI",
BridgeDataSource::Eth => "ETH",
BridgeDataSource::Sui => "SUI",
};
write!(f, "{str}")
}
Expand Down
14 changes: 9 additions & 5 deletions crates/sui-bridge-indexer/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl BridgeWorker {
txn_hash: tx.transaction.digest().inner().to_vec(),
status: TokenTransferStatus::Deposited,
gas_usage: tx.effects.gas_cost_summary().net_gas_usage(),
data_source: BridgeDataSource::SUI,
data_source: BridgeDataSource::Sui,
data: Some(TokenTransferData {
sender_address: event.sender_address,
destination_chain: event.target_chain,
Expand All @@ -96,7 +96,7 @@ impl BridgeWorker {
txn_hash: tx.transaction.digest().inner().to_vec(),
status: TokenTransferStatus::Approved,
gas_usage: tx.effects.gas_cost_summary().net_gas_usage(),
data_source: BridgeDataSource::SUI,
data_source: BridgeDataSource::Sui,
data: None,
})
}
Expand All @@ -112,7 +112,7 @@ impl BridgeWorker {
txn_hash: tx.transaction.digest().inner().to_vec(),
status: TokenTransferStatus::Claimed,
gas_usage: tx.effects.gas_cost_summary().net_gas_usage(),
data_source: BridgeDataSource::SUI,
data_source: BridgeDataSource::Sui,
data: None,
})
}
Expand Down Expand Up @@ -166,7 +166,7 @@ pub async fn process_eth_transaction(
txn_hash: tx_hash.as_bytes().to_vec(),
status: TokenTransferStatus::Deposited,
gas_usage: gas.as_u64() as i64,
data_source: BridgeDataSource::ETH,
data_source: BridgeDataSource::Eth,
data: Some(TokenTransferData {
sender_address: bridge_event.sender_address.as_bytes().to_vec(),
destination_chain: bridge_event.destination_chain_id,
Expand All @@ -188,7 +188,7 @@ pub async fn process_eth_transaction(
txn_hash: tx_hash.as_bytes().to_vec(),
status: TokenTransferStatus::Claimed,
gas_usage: gas.as_u64() as i64,
data_source: BridgeDataSource::ETH,
data_source: BridgeDataSource::Eth,
data: None,
};

Expand All @@ -199,6 +199,10 @@ pub async fn process_eth_transaction(
| EthSuiBridgeEvents::UpgradedFilter(_)
| EthSuiBridgeEvents::InitializedFilter(_) => (),
},
EthBridgeEvent::EthBridgeCommitteeEvents(_)
| EthBridgeEvent::EthBridgeLimiterEvents(_)
| EthBridgeEvent::EthBridgeConfigEvents(_)
| EthBridgeEvent::EthCommitteeUpgradeableContractEvents(_) => (),
}
}
}
Expand Down

0 comments on commit f98c901

Please sign in to comment.