Skip to content

Commit

Permalink
fix Defualt & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Mar 28, 2024
1 parent 3b2817c commit e8d4b68
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crates/precompile/src/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod secp256k1 {
// truncate to 20 bytes
hash[..12].fill(0);
Ok(hash)
}
}
}

#[cfg(all(
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ impl Env {
/// Return initial spend gas (Gas needed to execute transaction).
#[inline]
pub fn validate_tx<SPEC: Spec>(&self) -> Result<(), InvalidTransaction> {

// BASEFEE tx check
if SPEC::enabled(SpecId::LONDON) {
if let Some(priority_fee) = self.tx.gas_priority_fee {
Expand Down
5 changes: 1 addition & 4 deletions crates/primitives/src/env/handler_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ impl HandlerCfg {
/// Creates new `HandlerCfg` instance with the taiko feature.
#[cfg(feature = "taiko")]
pub fn new_with_taiko(spec_id: SpecId, is_taiko: bool) -> Self {
Self {
spec_id,
is_taiko,
}
Self { spec_id, is_taiko }
}

/// Returns `true` if the taiko feature is enabled and flag is set to `true`.
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(not(feature = "std"), no_std)]


#[cfg(not(feature = "std"))]
extern crate alloc as std;

Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ impl<DBError> From<InvalidTransaction> for EVMError<DBError> {
}
}


/// Transaction validation error.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down
11 changes: 2 additions & 9 deletions crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub enum SpecId {
/// Information was obtained from the [Ethereum Execution Specifications](https://github.com/ethereum/execution-specs)
#[cfg(feature = "taiko")]
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, enumn::N)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, enumn::N)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum SpecId {
FRONTIER = 0,
Expand All @@ -59,15 +59,10 @@ pub enum SpecId {
SHANGHAI = 16,
KATLA = 17, // KATLA is before CANCUN, aka does not have 4844
CANCUN = 18,
#[default]
LATEST = u8::MAX,
}

impl Default for SpecId {
fn default() -> Self {
Self::LATEST
}
}

impl SpecId {
#[inline]
pub fn try_from_u8(spec_id: u8) -> Option<Self> {
Expand Down Expand Up @@ -179,7 +174,6 @@ spec!(CANCUN, CancunSpec);

spec!(LATEST, LatestSpec);


// Taiko Hardforks
#[cfg(feature = "taiko")]
spec!(KATLA, KatlaSpec);
Expand Down Expand Up @@ -281,7 +275,6 @@ mod tests {
spec_to_generic!(LATEST, assert_eq!(SPEC::SPEC_ID, LATEST));
#[cfg(feature = "taiko")]
spec_to_generic!(KATLA, assert_eq!(SPEC::SPEC_ID, KATLA));

}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/taiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pub mod handler_register;
pub mod l1block;

pub use handler_register::*;
pub use l1block::*;
pub use l1block::*;
2 changes: 1 addition & 1 deletion crates/revm/src/taiko/l1block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ impl L1BlockInfo {
..Default::default()
})
}
}
}

0 comments on commit e8d4b68

Please sign in to comment.