Skip to content

Commit

Permalink
Fix ci (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
i1i1 authored Dec 12, 2024
1 parent b71b01f commit 4d34ccf
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion crates/pevm/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub enum StorageWrapperError<S: Storage> {
#[derive(Debug)]
pub struct StorageWrapper<'a, S: Storage>(pub &'a S);

impl<'a, S: Storage> DatabaseRef for StorageWrapper<'a, S> {
impl<S: Storage> DatabaseRef for StorageWrapper<'_, S> {
type Error = StorageWrapperError<S>;

fn basic_ref(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/pevm/src/storage/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/pevm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S: Storage, C: PevmChain> Database for VmDb<'_, S, C> {
type Error = ReadError;

fn basic(&mut self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
Expand Down
4 changes: 2 additions & 2 deletions crates/pevm/tests/beneficiary.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions crates/pevm/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Module common for all tests
use std::{
fs::{self, File},
io::BufReader,
Expand Down
6 changes: 3 additions & 3 deletions crates/pevm/tests/erc20/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions crates/pevm/tests/erc20/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ERC-20 testing module
/// This module provides ERC-20 contract functionality.
pub mod contract;

Expand Down
19 changes: 10 additions & 9 deletions crates/pevm/tests/ethereum/main.rs
Original file line number Diff line number Diff line change
@@ -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 <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.
use pevm::chain::PevmEthereum;
use pevm::{
Expand Down
2 changes: 2 additions & 0 deletions crates/pevm/tests/mainnet.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Test with mainnet blocks
use pevm::chain::PevmEthereum;

pub mod common;
Expand Down
2 changes: 1 addition & 1 deletion crates/pevm/tests/mixed.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/pevm/tests/raw_transfers.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions crates/pevm/tests/small_blocks.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions crates/pevm/tests/uniswap/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Uniswap testing module
/// contract module
pub mod contract;

Expand Down

0 comments on commit 4d34ccf

Please sign in to comment.