Skip to content

Commit

Permalink
fix: redundant error
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Sep 27, 2024
1 parent 7f895c0 commit fb926c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ where
let mut tx = self.write_transaction();
tx.storage_as_mut::<GasPriceMetadata>()
.insert(&block_height, metadata)
.map_err(|err| GasPriceError::CouldNotSetMetadata {
block_height,
source_error: err.into(),
})?;
tx.commit()
.and_then(|_| tx.commit())
.map_err(|err| GasPriceError::CouldNotSetMetadata {
block_height,
source_error: err.into(),
Expand All @@ -100,8 +96,7 @@ pub fn get_block_info(
block_gas_limit: u64,
) -> GasPriceResult<BlockInfo> {
let (fee, gas_price) = mint_values(block)?;
let used_gas =
block_used_gas(fee, gas_price, gas_price_factor, block_gas_limit)?;
let used_gas = block_used_gas(fee, gas_price, gas_price_factor, block_gas_limit)?;
let info = BlockInfo::Block {
height: (*block.header().height()).into(),
gas_used: used_gas,
Expand Down
4 changes: 1 addition & 3 deletions crates/services/gas_price_service/src/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use fuel_core_types::fuel_types::BlockHeight;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Failed to find L2 block: {source_error:?}")]
CouldNotFetchL2Block {
source_error: anyhow::Error,
},
CouldNotFetchL2Block { source_error: anyhow::Error },
#[error("Failed to find DA records: {0:?}")]
CouldNotFetchDARecord(anyhow::Error),
#[error("Failed to retrieve updater metadata: {source_error:?}")]
Expand Down

0 comments on commit fb926c4

Please sign in to comment.