diff --git a/crates/pevm/src/storage.rs b/crates/pevm/src/storage.rs index 84850ebe..c485f829 100644 --- a/crates/pevm/src/storage.rs +++ b/crates/pevm/src/storage.rs @@ -209,7 +209,7 @@ pub enum StorageWrapperError { #[derive(Debug)] pub struct StorageWrapper<'a, S: Storage>(pub &'a S); -impl<'a, S: Storage> DatabaseRef for StorageWrapper<'a, S> { +impl DatabaseRef for StorageWrapper<'_, S> { type Error = StorageWrapperError; fn basic_ref(&self, address: Address) -> Result, Self::Error> { diff --git a/crates/pevm/src/storage/in_memory.rs b/crates/pevm/src/storage/in_memory.rs index 23150dfa..c9d410b1 100644 --- a/crates/pevm/src/storage/in_memory.rs +++ b/crates/pevm/src/storage/in_memory.rs @@ -28,7 +28,7 @@ impl<'a> InMemoryStorage<'a> { } } -impl<'a> Storage for InMemoryStorage<'a> { +impl Storage for InMemoryStorage<'_> { // TODO: More proper error handling type Error = u8; diff --git a/crates/pevm/src/vm.rs b/crates/pevm/src/vm.rs index 3cc10fff..0bcd5902 100644 --- a/crates/pevm/src/vm.rs +++ b/crates/pevm/src/vm.rs @@ -236,7 +236,7 @@ impl<'a, S: Storage, C: PevmChain> VmDb<'a, S, C> { } } -impl<'a, S: Storage, C: PevmChain> Database for VmDb<'a, S, C> { +impl Database for VmDb<'_, S, C> { type Error = ReadError; fn basic(&mut self, address: Address) -> Result, Self::Error> { diff --git a/crates/pevm/tests/beneficiary.rs b/crates/pevm/tests/beneficiary.rs index 55c3ff26..c7843420 100644 --- a/crates/pevm/tests/beneficiary.rs +++ b/crates/pevm/tests/beneficiary.rs @@ -1,5 +1,5 @@ -// Tests for the beneficiary account, especially for the lazy update of its balance to avoid -// "implicit" dependency among consecutive transactions. +//! Tests for the beneficiary account, especially for the lazy update of its balance to avoid +//! "implicit" dependency among consecutive transactions. use pevm::InMemoryStorage; use rand::random; diff --git a/crates/pevm/tests/common/mod.rs b/crates/pevm/tests/common/mod.rs index 71f46e12..c885cd97 100644 --- a/crates/pevm/tests/common/mod.rs +++ b/crates/pevm/tests/common/mod.rs @@ -1,3 +1,5 @@ +//! Module common for all tests + use std::{ fs::{self, File}, io::BufReader, diff --git a/crates/pevm/tests/erc20/main.rs b/crates/pevm/tests/erc20/main.rs index 526fa453..48970425 100644 --- a/crates/pevm/tests/erc20/main.rs +++ b/crates/pevm/tests/erc20/main.rs @@ -1,6 +1,6 @@ -// Each cluster has one ERC20 contract and X families. -// Each family has Y people. -// Each person performs Z transfers to random people within the family. +//! Each cluster has one ERC20 contract and X families. +//! Each family has Y people. +//! Each person performs Z transfers to random people within the family. #[path = "../common/mod.rs"] pub mod common; diff --git a/crates/pevm/tests/erc20/mod.rs b/crates/pevm/tests/erc20/mod.rs index 1da818b4..5ac2234a 100644 --- a/crates/pevm/tests/erc20/mod.rs +++ b/crates/pevm/tests/erc20/mod.rs @@ -1,3 +1,5 @@ +//! ERC-20 testing module + /// This module provides ERC-20 contract functionality. pub mod contract; diff --git a/crates/pevm/tests/ethereum/main.rs b/crates/pevm/tests/ethereum/main.rs index 29224f3f..e569b04d 100644 --- a/crates/pevm/tests/ethereum/main.rs +++ b/crates/pevm/tests/ethereum/main.rs @@ -1,12 +1,13 @@ -// Basing on https://github.com/bluealloy/revm/blob/main/bins/revme/src/cmd/statetest/runner.rs. -// These tests may seem useless: -// - They only have one transaction. -// - REVM already tests them. -// Nevertheless, they are important: -// - REVM doesn't test very tightly (not matching on expected failures, skipping tests, etc.). -// - We must use a REVM fork (for distinguishing explicit & implicit reads, etc.). -// - We use custom handlers (for lazy-updating the beneficiary account, etc.) that require "re-testing". -// - Help outline the minimal state commitment logic for pevm. +//! Basing on . +//! These tests may seem useless: +//! - They only have one transaction. +//! - REVM already tests them. +//! +//! Nevertheless, they are important: +//! - REVM doesn't test very tightly (not matching on expected failures, skipping tests, etc.). +//! - We must use a REVM fork (for distinguishing explicit & implicit reads, etc.). +//! - We use custom handlers (for lazy-updating the beneficiary account, etc.) that require "re-testing". +//! - Help outline the minimal state commitment logic for pevm. use pevm::chain::PevmEthereum; use pevm::{ diff --git a/crates/pevm/tests/mainnet.rs b/crates/pevm/tests/mainnet.rs index f8445b30..fa5515bb 100644 --- a/crates/pevm/tests/mainnet.rs +++ b/crates/pevm/tests/mainnet.rs @@ -1,3 +1,5 @@ +//! Test with mainnet blocks + use pevm::chain::PevmEthereum; pub mod common; diff --git a/crates/pevm/tests/mixed.rs b/crates/pevm/tests/mixed.rs index 584bdbc4..f2992b45 100644 --- a/crates/pevm/tests/mixed.rs +++ b/crates/pevm/tests/mixed.rs @@ -1,4 +1,4 @@ -// Test raw transfers -- A block with random raw transfers, ERC-20 transfers, and Uniswap swaps. +//! Test raw transfers -- A block with random raw transfers, ERC-20 transfers, and Uniswap swaps. use pevm::{Bytecodes, ChainState, EvmAccount, InMemoryStorage}; use rand::random; diff --git a/crates/pevm/tests/raw_transfers.rs b/crates/pevm/tests/raw_transfers.rs index ee1dc2cb..eee7d317 100644 --- a/crates/pevm/tests/raw_transfers.rs +++ b/crates/pevm/tests/raw_transfers.rs @@ -1,4 +1,4 @@ -// Test raw transfers -- only send some ETH from one account to another without extra data. +//! Test raw transfers -- only send some ETH from one account to another without extra data. use pevm::{chain::PevmEthereum, InMemoryStorage}; use rand::random; diff --git a/crates/pevm/tests/small_blocks.rs b/crates/pevm/tests/small_blocks.rs index 383f0d73..d5a616bc 100644 --- a/crates/pevm/tests/small_blocks.rs +++ b/crates/pevm/tests/small_blocks.rs @@ -1,5 +1,5 @@ -// Test small blocks that we have specific handling for, like implicit fine-tuning -// the concurrency level, falling back to sequential processing, etc. +//! Test small blocks that we have specific handling for, like implicit fine-tuning +//! the concurrency level, falling back to sequential processing, etc. use alloy_primitives::{Address, U256}; use pevm::InMemoryStorage; diff --git a/crates/pevm/tests/uniswap/mod.rs b/crates/pevm/tests/uniswap/mod.rs index 9b719a89..3726fa9c 100644 --- a/crates/pevm/tests/uniswap/mod.rs +++ b/crates/pevm/tests/uniswap/mod.rs @@ -1,3 +1,5 @@ +//! Uniswap testing module + /// contract module pub mod contract;