Skip to content

Commit

Permalink
fix(blob-explorers): alloy-serde usage (#45)
Browse files Browse the repository at this point in the history
Include changes from alloy-rs/alloy#624
  • Loading branch information
shekhirin committed May 1, 2024
1 parent 19a1365 commit cd824d3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions crates/blob-explorers/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ pub struct BlockResponse<T = FullTransactionDetails> {
pub timestamp: chrono::DateTime<chrono::offset::Utc>,
/// The block slot.
pub slot: u64,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_price: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub excess_blob_gas: u128,
/// Blob transactions in the blob
pub transactions: Vec<T>,
Expand All @@ -51,17 +51,17 @@ pub struct FullTransactionDetails {
/// Receiver address,
pub to: Address,
/// The max fee per blob gas for EIP-4844 blob transactions.
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub max_fee_per_blob_gas: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_base_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_max_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_used: u128,
}

Expand Down Expand Up @@ -134,17 +134,17 @@ pub struct TransactionDetails {
/// Receiver address,
pub to: Address,
/// The max fee per blob gas for EIP-4844 blob transactions.
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub max_fee_per_blob_gas: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_base_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_max_fee: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_used: u128,
}

Expand All @@ -169,13 +169,13 @@ pub struct BlockInfo {
pub timestamp: chrono::DateTime<chrono::offset::Utc>,
/// The block slot.
pub slot: u64,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_as_calldata_gas_used: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub blob_gas_price: u128,
#[serde(with = "alloy_serde::num::u128_hex_or_decimal")]
#[serde(with = "alloy_serde::num::u128_via_ruint")]
pub excess_blob_gas: u128,
}

Expand Down

0 comments on commit cd824d3

Please sign in to comment.