Skip to content

Commit

Permalink
Merge branch 'scroll' into ci/scroll-sync
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Edison <[email protected]>
  • Loading branch information
greged93 committed Dec 17, 2024
2 parents 5f37665 + b456d1f commit 0ec25d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
13 changes: 8 additions & 5 deletions crates/primitives/src/transaction/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ pub trait FillTxEnv {

impl FillTxEnv for TransactionSigned {
fn fill_tx_env(&self, tx_env: &mut TxEnv, sender: Address) {
#[cfg(any(feature = "optimism", feature = "scroll"))]
let _envelope = alloy_eips::eip2718::Encodable2718::encoded_2718(self);
#[cfg(any(
all(feature = "optimism", not(feature = "scroll")),
all(feature = "scroll", not(feature = "optimism"))
))]
let envelope = alloy_eips::eip2718::Encodable2718::encoded_2718(self);

tx_env.caller = sender;
match self.as_ref() {
Expand Down Expand Up @@ -105,7 +108,7 @@ impl FillTxEnv for TransactionSigned {
source_hash: Some(tx.source_hash),
mint: tx.mint,
is_system_transaction: Some(tx.is_system_transaction),
enveloped_tx: Some(_envelope.into()),
enveloped_tx: Some(envelope.into()),
};
return;
}
Expand Down Expand Up @@ -133,14 +136,14 @@ impl FillTxEnv for TransactionSigned {
source_hash: None,
mint: None,
is_system_transaction: Some(false),
enveloped_tx: Some(_envelope.into()),
enveloped_tx: Some(envelope.into()),
}
}

#[cfg(all(feature = "scroll", not(feature = "optimism")))]
if !self.is_l1_message() {
tx_env.scroll.is_l1_msg = false;
tx_env.scroll.rlp_bytes = Some(_envelope.into());
tx_env.scroll.rlp_bytes = Some(envelope.into());
}
}
}
26 changes: 12 additions & 14 deletions crates/scroll/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,22 @@ pub struct ScrollChainSpecBuilder {
impl ScrollChainSpecBuilder {
/// Construct a new builder from the scroll mainnet chain spec.
pub fn scroll_mainnet() -> Self {
let mut inner = ChainSpecBuilder::default()
.chain(SCROLL_MAINNET.chain)
.genesis(SCROLL_MAINNET.genesis.clone());
let forks = SCROLL_MAINNET.hardforks.clone();
inner = inner.with_forks(forks);

Self { inner }
Self {
inner: ChainSpecBuilder::default()
.chain(SCROLL_MAINNET.chain)
.genesis(SCROLL_MAINNET.genesis.clone())
.with_forks(SCROLL_MAINNET.hardforks.clone()),
}
}

/// Construct a new builder from the scroll sepolia chain spec.
pub fn scroll_sepolia() -> Self {
let mut inner = ChainSpecBuilder::default()
.chain(SCROLL_SEPOLIA.chain)
.genesis(SCROLL_SEPOLIA.genesis.clone());
let forks = SCROLL_SEPOLIA.hardforks.clone();
inner = inner.with_forks(forks);

Self { inner }
Self {
inner: ChainSpecBuilder::default()
.chain(SCROLL_SEPOLIA.chain)
.genesis(SCROLL_SEPOLIA.genesis.clone())
.with_forks(SCROLL_SEPOLIA.hardforks.clone()),
}
}
}

Expand Down

0 comments on commit 0ec25d0

Please sign in to comment.