Skip to content

Commit

Permalink
clippy + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Sep 10, 2024
1 parent 5098726 commit 073b8b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions crates/provider/src/fillers/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ impl NonceManager for SimpleNonceManager {
}
}

/// Cached nonce manager
///
/// This [`NonceManager`] implementation will fetch the transaction count for any new account it
/// sees, store it locally and increment the locally stored nonce as transactions are sent via
/// [`Provider::send_transaction`].
Expand Down
20 changes: 15 additions & 5 deletions crates/rpc-types-eth/src/simulate.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! 'eth_simulateV1' Request / Response types: <https://github.com/ethereum/execution-apis/pull/484>

use alloy_primitives::{Bytes};
use alloy_primitives::Bytes;
use serde::{Deserialize, Serialize};

use crate::{state::StateOverride, Block, Log, BlockOverrides, TransactionRequest};
use crate::{state::StateOverride, Block, BlockOverrides, Log, TransactionRequest};

/// The maximum number of blocks that can be simulated in a single request,
pub const MAX_SIMULATE_BLOCKS: u64 = 256;
Expand Down Expand Up @@ -147,11 +147,21 @@ mod tests {
assert_eq!(sim_opts.block_state_calls.len(), 2);

let block_state_call_1 = &sim_opts.block_state_calls[0];
assert!(block_state_call_1.state_overrides.contains_key(&address_1));
assert_eq!(block_state_call_1.state_overrides.get(&address_1).unwrap().nonce.unwrap(), 5);
assert!(block_state_call_1.state_overrides.as_ref().unwrap().contains_key(&address_1));
assert_eq!(
block_state_call_1
.state_overrides
.as_ref()
.unwrap()
.get(&address_1)
.unwrap()
.nonce
.unwrap(),
5
);

let block_state_call_2 = &sim_opts.block_state_calls[1];
assert!(block_state_call_2.state_overrides.contains_key(&address_1));
assert!(block_state_call_2.state_overrides.as_ref().unwrap().contains_key(&address_1));

assert_eq!(block_state_call_2.calls.len(), 2);
assert_eq!(block_state_call_2.calls[0].from.unwrap(), address_1);
Expand Down

0 comments on commit 073b8b5

Please sign in to comment.