Skip to content

Commit 7a5a5a3

Browse files
Remove unneeded get_gas_price func, as its called only 1 time
1 parent 7a391f8 commit 7a5a5a3

File tree

1 file changed

+4
-12
lines changed
  • aggregation_mode/src/backend

1 file changed

+4
-12
lines changed

aggregation_mode/src/backend/mod.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ impl ProofAggregator {
161161
// We add 24 hours because the proof aggregator runs once a day, so the time elapsed
162162
// should be considered over a 24h period.
163163

164-
let gas_price = self.get_gas_price().await?;
164+
let gas_price = match self.rpc_provider.get_gas_price().await {
165+
Ok(price) => Ok(price),
166+
Err(e1) => Err(AggregatedProofSubmissionError::GasPriceError(e1.to_string())),
167+
}?;
165168

166169
if self.should_send_proof_to_verify_on_chain(
167170
time_elapsed,
@@ -360,17 +363,6 @@ impl ProofAggregator {
360363

361364
Ok((blob, blob_versioned_hash))
362365
}
363-
364-
/// Try to obtain a sensible gas price from two providers.
365-
/// Tries `primary` first, falls back to `fallback` if the first fails.
366-
pub async fn get_gas_price(&self) -> Result<u128, AggregatedProofSubmissionError> {
367-
match self.rpc_provider.get_gas_price().await {
368-
Ok(price) => Ok(price),
369-
Err(e1) => Err(AggregatedProofSubmissionError::GasPriceError(format!(
370-
"gas price error: {e1}"
371-
))),
372-
}
373-
}
374366
}
375367

376368
#[cfg(test)]

0 commit comments

Comments
 (0)