Skip to content

Commit

Permalink
chore: cargo fmt --all
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Mar 7, 2024
1 parent 2e439ca commit e0b6972
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
22 changes: 15 additions & 7 deletions bridges/centralized-ethereum/src/actors/dr_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ impl Handler<DrReporterMsg> for DrReporter {
msg.reports.retain(|report| {
if self.pending_dr_reports.contains(&report.dr_id) {
// Timeout is not over yet, no action is needed
log::debug!("[{}] => ignored as it's currently being reported", report.dr_id);
log::debug!(
"[{}] => ignored as it's currently being reported",
report.dr_id
);

false
} else {
Expand Down Expand Up @@ -230,7 +233,8 @@ impl Handler<DrReporterMsg> for DrReporter {

log::info!(
"{:?} will be reported in {} transactions",
dr_ids, batched_reports.len(),
dr_ids,
batched_reports.len(),
);

for (batched_report, eth_gas_limit) in batched_reports {
Expand Down Expand Up @@ -314,8 +318,9 @@ impl Handler<DrReporterMsg> for DrReporter {
Err(elapsed) => {
// Timeout is over
log::warn!(
"Timeout ({} secs) when calling reportResultBatch{:?}",
elapsed, &batched_report
"Timeout ({} secs) when calling reportResultBatch{:?}",
elapsed,
&batched_report
);
}
}
Expand Down Expand Up @@ -428,7 +433,6 @@ async fn split_by_gas_limit(
// Skip this single-query batch if still not possible to estimate gas
log::error!("Cannot estimate gas limit: {:?}", e);
log::warn!("Skipping report batch: {:?}", batch_params);

} else {
// Split batch in half if gas estimation is not possible
let (batch_tuples_1, batch_tuples_2) =
Expand Down Expand Up @@ -495,8 +499,12 @@ async fn split_by_gas_limit(
log::debug!(
"reportResultBatch (x{} drs) estimated profit: {} - {} ETH",
batch_params.len(),
Unit::Wei(&revenues.to_string()).to_eth_str().unwrap_or_default(),
Unit::Wei(&expenses.to_string()).to_eth_str().unwrap_or_default(),
Unit::Wei(&revenues.to_string())
.to_eth_str()
.unwrap_or_default(),
Unit::Wei(&expenses.to_string())
.to_eth_str()
.unwrap_or_default(),
);
v.push((batch_params, estimated_gas));
continue;
Expand Down
1 change: 0 additions & 1 deletion bridges/centralized-ethereum/src/actors/eth_poller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ impl EthPoller {
}

fn check_new_requests_from_ethereum(&self, ctx: &mut Context<Self>, period: Duration) {

let wrb_contract = self.wrb_contract.clone().unwrap();
let skip_first = U256::from(self.skip_first);
let max_batch_size = self.max_batch_size;
Expand Down
12 changes: 2 additions & 10 deletions bridges/centralized-ethereum/src/actors/wit_poller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ impl WitPoller {
current_commit_round: dr_commits_round,
..
})) => {
log::info!(
"[{}] <= dr_tx = {}",
dr_id,
dr_tx_hash
);
log::info!("[{}] <= dr_tx = {}", dr_id, dr_tx_hash);

let result = tally.tally.clone();
// Get timestamp of the epoch at which all data request commit txs
Expand Down Expand Up @@ -144,11 +140,7 @@ impl WitPoller {
}
};
} else {
log::debug!(
"[{}] <> dr_tx = {}",
dr_id,
dr_tx_hash
);
log::debug!("[{}] <> dr_tx = {}", dr_id, dr_tx_hash);
}

let elapsed_secs = current_timestamp - dr_tx_creation_timestamp;
Expand Down

0 comments on commit e0b6972

Please sign in to comment.