Skip to content

Commit

Permalink
remove unused types
Browse files Browse the repository at this point in the history
  • Loading branch information
vbar committed Jan 29, 2025
1 parent c322d2d commit ab9bed5
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions crates/rpc/src/v06/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ use pathfinder_common::{
SequencerAddress,
StarknetVersion,
StateCommitment,
TransactionVersion,
};
use serde::Serialize;
use serde_with::{serde_as, skip_serializing_none, DisplayFromStr};
pub use transaction::TransactionWithHash;

use crate::felt::RpcFelt;

Expand Down Expand Up @@ -62,26 +60,6 @@ impl From<pathfinder_common::BlockHeader> for BlockHeader {
}
}

impl BlockHeader {
/// Constructs [BlockHeader] from [sequencer's pending block
/// representation](starknet_gateway_types::reply::PendingBlock)
pub fn from_sequencer_pending(pending: starknet_gateway_types::reply::PendingBlock) -> Self {
Self {
block_hash: None,
parent_hash: pending.parent_hash,
block_number: None,
new_root: None,
timestamp: pending.timestamp,
sequencer_address: pending.sequencer_address,
l1_gas_price: ResourcePrice {
price_in_fri: pending.l1_gas_price.price_in_fri,
price_in_wei: pending.l1_gas_price.price_in_wei,
},
starknet_version: pending.starknet_version,
}
}
}

#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq)]
#[cfg_attr(test, derive(serde::Deserialize))]
pub enum PriceUnit {
Expand All @@ -99,12 +77,3 @@ impl From<pathfinder_executor::types::PriceUnit> for PriceUnit {
}
}
}

impl PriceUnit {
pub fn for_transaction_version(version: &TransactionVersion) -> Self {
match version.without_query_version() {
0..=2 => PriceUnit::Wei,
_ => PriceUnit::Fri,
}
}
}

0 comments on commit ab9bed5

Please sign in to comment.