Skip to content

Commit dd662fd

Browse files
committed
feat: take result and state
1 parent 62d9449 commit dd662fd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trevm"
3-
version = "0.14.2"
3+
version = "0.14.3"
44
rust-version = "1.82.0"
55
edition = "2021"
66
authors = ["init4"]

src/evm.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,18 @@ impl<'a, Ext, Db: Database + DatabaseCommit> EvmTransacted<'a, Ext, Db> {
11731173
}
11741174

11751175
/// Take the [`ResultAndState`] and return the EVM.
1176+
pub fn into_result_and_state(self) -> ResultAndState {
1177+
self.state.result
1178+
}
1179+
1180+
/// Take the [`ResultAndState`] and return the EVM.
1181+
pub fn take_result_and_state(self) -> (ResultAndState, EvmNeedsTx<'a, Ext, Db>) {
1182+
let Trevm { inner, state: TransactedState { result } } = self;
1183+
(result, Trevm { inner, state: NeedsTx::new() })
1184+
}
1185+
1186+
/// Take the [`ExecutionResult`], discard the [`EvmState`] and return the
1187+
/// EVM.
11761188
pub fn take_result(self) -> (ExecutionResult, EvmNeedsTx<'a, Ext, Db>) {
11771189
let Trevm { inner, state: TransactedState { result } } = self;
11781190
(result.result, Trevm { inner, state: NeedsTx::new() })

0 commit comments

Comments
 (0)