Skip to content

Commit 2f84d22

Browse files
authored
feat: rename inspect_previous to inspect_replay (#2194)
1 parent d197043 commit 2f84d22

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

bins/revme/src/cmd/evmrunner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Cmd {
104104
}
105105

106106
let out = if self.trace {
107-
evm.inspect_previous().map_err(|_| Errors::EVMError)?
107+
evm.inspect_replay().map_err(|_| Errors::EVMError)?
108108
} else {
109109
let out = evm.replay().map_err(|_| Errors::EVMError)?;
110110
println!("Result: {:#?}", out.result);

crates/inspector/src/gas.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ mod tests {
141141
let mut evm = ctx.build_mainnet_with_inspector(StackInspector::default());
142142

143143
// Run evm.
144-
evm.inspect_previous().unwrap();
144+
evm.inspect_replay().unwrap();
145145

146146
let inspector = &evm.data.inspector;
147147

crates/inspector/src/inspect.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ pub trait InspectEvm: ExecuteEvm {
66

77
fn set_inspector(&mut self, inspector: Self::Inspector);
88

9-
fn inspect_previous(&mut self) -> Self::Output;
9+
fn inspect_replay(&mut self) -> Self::Output;
1010

11-
fn inspect_previous_with_inspector(&mut self, inspector: Self::Inspector) -> Self::Output {
11+
fn inspect_replay_with_inspector(&mut self, inspector: Self::Inspector) -> Self::Output {
1212
self.set_inspector(inspector);
13-
self.inspect_previous()
13+
self.inspect_replay()
1414
}
1515

16-
fn inspect_previous_with_tx(&mut self, tx: <Self as ContextSetters>::Tx) -> Self::Output {
16+
fn inspect_replay_with_tx(&mut self, tx: <Self as ContextSetters>::Tx) -> Self::Output {
1717
self.set_tx(tx);
18-
self.inspect_previous()
18+
self.inspect_replay()
1919
}
2020

2121
fn inspect(
@@ -24,7 +24,7 @@ pub trait InspectEvm: ExecuteEvm {
2424
inspector: Self::Inspector,
2525
) -> Self::Output {
2626
self.set_tx(tx);
27-
self.inspect_previous_with_inspector(inspector)
27+
self.inspect_replay_with_inspector(inspector)
2828
}
2929
}
3030

crates/inspector/src/mainnet_inspect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ where
3737
self.data.inspector = inspector;
3838
}
3939

40-
fn inspect_previous(&mut self) -> Self::Output {
40+
fn inspect_replay(&mut self) -> Self::Output {
4141
let mut t = MainnetHandler::<_, _, EthFrame<_, _, _>> {
4242
_phantom: core::marker::PhantomData,
4343
};
@@ -55,7 +55,7 @@ where
5555
PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>,
5656
{
5757
fn inspect_commit_previous(&mut self) -> Self::CommitOutput {
58-
self.inspect_previous().map(|r| {
58+
self.inspect_replay().map(|r| {
5959
self.ctx().db().commit(r.state);
6060
r.result
6161
})

crates/optimism/src/api/default_ctx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ mod test {
4141
// execute
4242
let _ = evm.replay();
4343
// inspect
44-
let _ = evm.inspect_previous();
44+
let _ = evm.inspect_replay();
4545
}
4646
}

crates/optimism/src/api/exec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ where
8181
self.0.data.inspector = inspector;
8282
}
8383

84-
fn inspect_previous(&mut self) -> Self::Output {
84+
fn inspect_replay(&mut self) -> Self::Output {
8585
let mut h = OpHandler::<_, _, EthFrame<_, _, _>>::new();
8686
h.inspect_run(self)
8787
}
@@ -95,7 +95,7 @@ where
9595
PRECOMPILE: PrecompileProvider<CTX, Output = InterpreterResult>,
9696
{
9797
fn inspect_commit_previous(&mut self) -> Self::CommitOutput {
98-
self.inspect_previous().map(|r| {
98+
self.inspect_replay().map(|r| {
9999
self.ctx().db().commit(r.state);
100100
r.result
101101
})

examples/block_traces/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async fn main() -> anyhow::Result<()> {
147147
let writer = FlushWriter::new(Arc::clone(&inner));
148148

149149
// Inspect and commit the transaction to the EVM
150-
let res = evm.inspect_previous_with_inspector(TracerEip3155::new(Box::new(writer)));
150+
let res = evm.inspect_replay_with_inspector(TracerEip3155::new(Box::new(writer)));
151151

152152
if let Err(error) = res {
153153
println!("Got error: {:?}", error);

examples/cheatcode_inspector/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ where
484484
// InspectorT,
485485
// Context<BlockTr TxT, CfgT, InMemoryDB, Backend>,
486486
// >::new(context, inspector);
487-
let result = evm.inspect_previous(inspector)?;
487+
let result = evm.inspect_replay(inspector)?;
488488
//let result = inspect_main(&mut inspector_context)?;
489489

490490
// Persist the changes to the original backend.
@@ -525,7 +525,7 @@ fn main() -> anyhow::Result<()> {
525525
}
526526
.build_mainnet();
527527

528-
evm.inspect_previous(&mut inspector)?;
528+
evm.inspect_replay(&mut inspector)?;
529529

530530
// Sanity check
531531
assert_eq!(inspector.call_count, 2);

0 commit comments

Comments
 (0)