Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Oct 3, 2024
1 parent 41d0ba1 commit a409e5a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.

alloy-primitives = { version = "0.8.4", default-features = false }
alloy-genesis = { version = "0.4.2", default-features = false }
alloy-consensus = { version = "0.4.2", default-features = false }

serde = { version = "1.0", default-features = false }
eyre = "0.6"
Expand Down
1 change: 1 addition & 0 deletions crates/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ reth-provider = { workspace = true }

alloy-primitives = { workspace = true }
alloy-genesis = { workspace = true }
alloy-consensus = { workspace = true }

# SQLite for debugging, should be removed in the future
rusqlite = { version = "0.31.0", features = ["bundled"] }
Expand Down
1 change: 0 additions & 1 deletion crates/exex/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub async fn execute_block(
let block = Block {
header: header.clone(),
body: BlockBody { transactions: executed_txs, ..Default::default() },
..Default::default()
}
.with_recovered_senders()
.ok_or_else(|| eyre::eyre!("Failed to recover senders for transactions"))?;
Expand Down
39 changes: 22 additions & 17 deletions crates/exex/src/exex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ impl<Node: FullNodeComponents> KakarotRollup<Node> {
#[cfg(test)]
mod tests {
use super::*;
use alloy_consensus::TxEip1559;
use alloy_primitives::{address, hex, Bytes, Sealable, B256, U256};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_exex_test_utils::{test_exex_context, PollOnce};
use reth_primitives::{
address, constants::ETH_TO_WEI, hex, Bytes, Header, Receipt, Receipts, SealedBlock,
SealedBlockWithSenders, TransactionSigned, TxEip1559, B256, U256,
constants::ETH_TO_WEI, BlockBody, Header, Receipt, Receipts, SealedBlock,
SealedBlockWithSenders, SealedHeader, TransactionSigned,
};
use reth_revm::primitives::AccountInfo;
use std::{future::Future, pin::pin, str::FromStr};
Expand Down Expand Up @@ -200,24 +202,21 @@ mod tests {
"0xc3099e296bc0eaa6d3a5e0f46fcc4a9bb2f42fb4668a17dd926d75ca651509f0",
)
.unwrap(),
signature: reth_primitives::Signature {
r: U256::from_str(
"0xe74ec6b1365234a0ebe63f8e238d2318b28d1d2c58ada3a153ad364497dac715",
)
.unwrap(),
s: U256::from_str(
"0x7306a7cab3679ead15daee428d2481b1b92a5dc2303adfe4b3bbbb4713be74af",
)
.unwrap(),
odd_y_parity: false,
},
signature:
reth_primitives::Signature::from_rs_and_parity(U256::from_str(
"0xe74ec6b1365234a0ebe63f8e238d2318b28d1d2c58ada3a153ad364497dac715",
)
.unwrap(), U256::from_str(
"0x7306a7cab3679ead15daee428d2481b1b92a5dc2303adfe4b3bbbb4713be74af",
)
.unwrap(), false).unwrap(),
transaction: reth_primitives::Transaction::Eip1559(TxEip1559 {
chain_id: 1,
nonce: 0,
gas_limit: 0x3173e,
max_fee_per_gas: 0x2a9860004,
max_priority_fee_per_gas: 0x4903a597,
to: reth_primitives::TxKind::Call(
to: alloy_primitives::TxKind::Call(
Address::from_str("0xf3de3c0d654fda23dad170f0f320a92172509127").unwrap(),
),
value: U256::from_str("0xb1a2bc2ec50000").unwrap(),
Expand All @@ -243,7 +242,7 @@ mod tests {
timestamp: 0x635f9657,
extra_data: hex!("")[..].into(),
mix_hash: hex!("0000000000000000000000000000000000000000000000000000000000000000").into(),
nonce: 0x0000000000000000,
nonce: 0x0000000000000000u64.into(),
base_fee_per_gas: 0x28f0001df.into(),
withdrawals_root: None,
blob_gas_used: None,
Expand All @@ -252,9 +251,15 @@ mod tests {
requests_root: None
};

let sealed_header = header.seal_slow();
let (header, seal) = sealed_header.into_parts();

// Create a sealed block with a single transaction
let block = SealedBlockWithSenders {
block: SealedBlock { header: header.seal_slow(), body: vec![tx], ..Default::default() },
block: SealedBlock {
header: SealedHeader::new(header, seal),
body: BlockBody { transactions: vec![tx], ..Default::default() },
},
senders: vec![address!("6a3cA5811d2c185E6e441cEFa771824fb355f9Ec")],
};

Expand All @@ -281,7 +286,7 @@ mod tests {

// Check that the Execution Extension emitted a `FinishedHeight` event with the correct
// height
handle.assert_event_finished_height(0xf21d20)?;
handle.assert_event_finished_height(BlockNumHash::new(0xf21d20, seal))?;

// Open the SQLite database connection.
let connection = Connection::open(DATABASE_PATH)?;
Expand Down
5 changes: 3 additions & 2 deletions crates/exex/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ impl From<Address> for KethMaybeRelocatable {
}

/// [`KethOption`] is a custom representation of a Rust [`Option<T>`] type where `T` can be
/// any type, such as [`KethMaybeRelocatable`] or [`KethU256`], specifically tailored for use
/// within the Keth model inside our OS.
/// any type, such as [`KethMaybeRelocatable`] or [`KethU256`].
///
/// This is specifically tailored for use within the Keth model inside our OS.
///
/// This struct encapsulates two fields:
/// - `is_some`: A flag that indicates whether the option contains a value (`is_some = 1`) or is
Expand Down

0 comments on commit a409e5a

Please sign in to comment.