Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b9f75a0
refactor: allow chain-specific configuration of Evm
Wodann May 1, 2024
9f4abf7
refactor: rename Transaction::transact_to and clarify docs
Wodann Jun 18, 2024
ae14441
refactor: remove trait bounds on Transaction super trait
Wodann Jun 18, 2024
13aabf4
refactor: remove trait bounds from Block supertrait
Wodann Jun 18, 2024
2a84559
fix: clippy warnings
Wodann Jun 19, 2024
1c17cd0
fix: cargo doc
Wodann Jun 19, 2024
904f0f5
refactor: limit trait bounds on HaltReason
Wodann Jun 19, 2024
8a1530c
refactor: allow moving of kind
Wodann Jun 19, 2024
29f3be6
refactor: rename Transaction::nonce to nonce_opt to signal that it's …
Wodann Jun 19, 2024
9f5e2d3
refactor: replace AccessList with alloy version
Wodann Jun 19, 2024
3baf771
refactor: rename gas_priority_fee to max_priority_fee_per_gas
Wodann Jun 20, 2024
4710a4b
refactor: correct trait bound on ExecutionResult::clone
Wodann Jun 20, 2024
5bf0156
Clone
Wodann Jun 20, 2024
612bb40
refactor: only allow optional nonce check via CfgEnv
Wodann Jun 20, 2024
94d529b
fix: use alloy-eips with fix for serde
Wodann Jun 21, 2024
e68f3af
build: bump to alloy-eips v0.1.2
Wodann Jun 24, 2024
da97359
build: Cargo.lock file
Wodann Jun 24, 2024
c903557
fix: revme
Wodann Jun 24, 2024
23525aa
refactor: derive DummyHost
Wodann Jun 24, 2024
729b236
refactor: derive Clone for ExecutionResult
Wodann Jun 24, 2024
a35aaa6
refactor: remove EVMErrorForChain
Wodann Jun 24, 2024
11a4fe6
refactor: remove EVMErrorForChain
Wodann Jun 24, 2024
b3b9b71
refactor: derive Clone for CfgEnvWithChainSpec
Wodann Jun 24, 2024
1c908e1
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
a4e49cc
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
8e3e3be
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
adf87c4
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
4761941
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
78fe3f2
refactor: use EVMResultGeneric
Wodann Jun 24, 2024
e65e829
refactor: add convenience EVMErrorForChain type alias
Wodann Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: derive Clone for ExecutionResult
  • Loading branch information
Wodann committed Jun 25, 2024
commit 729b236d0814893faf074e43c8e9f693e936c5ba
31 changes: 3 additions & 28 deletions crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use derive_where::derive_where;

use crate::{Address, Bytes, ChainSpec, EvmState, Log, TransactionValidation, U256};
use core::fmt::{self, Debug};
use std::{boxed::Box, string::String, vec::Vec};
Expand Down Expand Up @@ -25,6 +27,7 @@ pub struct ResultAndState<ChainSpecT: ChainSpec> {

/// Result of a transaction execution.
#[derive(Debug, PartialEq, Eq, Hash)]
#[derive_where(Clone; ChainSpecT::HaltReason)]
pub enum ExecutionResult<ChainSpecT: ChainSpec> {
/// Returned successfully
Success {
Expand All @@ -44,34 +47,6 @@ pub enum ExecutionResult<ChainSpecT: ChainSpec> {
},
}

impl<ChainSpecT: ChainSpec> Clone for ExecutionResult<ChainSpecT> {
fn clone(&self) -> Self {
match self {
Self::Success {
reason,
gas_used,
gas_refunded,
logs,
output,
} => Self::Success {
reason: *reason,
gas_used: *gas_used,
gas_refunded: *gas_refunded,
logs: logs.clone(),
output: output.clone(),
},
Self::Revert { gas_used, output } => Self::Revert {
gas_used: *gas_used,
output: output.clone(),
},
Self::Halt { reason, gas_used } => Self::Halt {
reason: reason.clone(),
gas_used: *gas_used,
},
}
}
}

impl<ChainSpecT: ChainSpec> ExecutionResult<ChainSpecT> {
/// Returns if transaction execution is successful.
/// 1 indicates success, 0 indicates revert.
Expand Down