Skip to content

Commit

Permalink
fix: isthmus network upgrade tx
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Jan 31, 2025
1 parent 6f60bf4 commit 6ee25ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions crates/consensus/src/hardforks/bytecode/isthmus_tx_1.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ef90115a0cc09fea36640c76e2ac5ec1e1d298052a9840ccad865122c57cd31aaa1cf234d94e9f0662359bb2c8111840effd73b9afa77cbde108080808303d09080b8d536303631383036303039356633393566663333333733666666666666666666666666666666666666666666666666666666666666666666666666666666653134363034643537363032303336313436303234353735663566666435623566333538303135363034393537363230303166666638313036393038313534313436303363353735663566666435623632303031666666303135343566353236303230356666333562356635666664356236323030316666663432303634323831353535663335393036323030316666663031353530300a
2 changes: 1 addition & 1 deletion crates/consensus/src/hardforks/forks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Contains all hardforks represented in the [crate::Hardfork] type.
use crate::{Isthmus, Ecotone, Fjord};
use crate::{Ecotone, Fjord, Isthmus};

/// Optimism Hardforks
///
Expand Down
33 changes: 16 additions & 17 deletions crates/consensus/src/hardforks/isthmus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::UpgradeDepositSource;
use alloc::{string::String, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, hex, Address, Bytes, TxKind, B256, U256};
use alloy_primitives::{address, Address, Bytes, TxKind, B256, U256};

use crate::{Hardfork, TxDeposit};

Expand All @@ -32,18 +32,16 @@ impl Isthmus {

/// Returns the list of [TxDeposit]s for the network upgrade.
pub fn deposits() -> impl Iterator<Item = TxDeposit> {
([
TxDeposit {
source_hash: Self::deposits_contract_source(),
from: Self::EIP2935_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip2935_creation_data(),
},
])
([TxDeposit {
source_hash: Self::deposit_contract_source(),
from: Self::EIP2935_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip2935_creation_data(),
}])
.into_iter()
}
}
Expand All @@ -60,18 +58,19 @@ impl Hardfork for Isthmus {
}

#[cfg(test)]
#[cfg(feature = "std")]
mod tests {
use super::*;
use alloc::vec;
use alloy_primitives::hex;

#[test]
fn test_isthmus_txs_encoded() {
let isthmus_upgrade_tx = Isthmus.txs().collect::<Vec<_>>();
assert_eq!(isthmus_upgrade_tx.len(), 6);
assert_eq!(isthmus_upgrade_tx.len(), 1);

let expected_txs: Vec<Bytes> = vec![
hex::decode(include_bytes!("./bytecode/isthmus_tx_1.hex")).unwrap().into(),
];
let expected_txs: Vec<Bytes> =
vec![hex::decode(include_bytes!("./bytecode/isthmus_tx_1.hex")).unwrap().into()];
for (i, expected) in expected_txs.iter().enumerate() {
assert_eq!(isthmus_upgrade_tx[i], *expected);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub use eip1559::{
};

mod hardforks;
pub use hardforks::{Ecotone, Fjord, Hardfork, Hardforks};
pub use hardforks::{Ecotone, Fjord, Hardfork, Hardforks, Isthmus};

mod source;
pub use source::*;
Expand Down

0 comments on commit 6ee25ae

Please sign in to comment.