cfx_executor/observer/
opcode_tracer.rs1use cfx_types::{Address, Space, H256, U256};
2use cfx_vm_types::InterpreterInfo;
3
4use impl_tools::autoimpl;
5use impl_trait_for_tuples::impl_for_tuples;
6
7#[impl_for_tuples(3)]
8#[autoimpl(for<T: trait + ?Sized> &mut T)]
9pub trait OpcodeTracer {
10 fn do_trace_opcode(&self, _enabled: &mut bool) {}
11
12 #[inline]
14 fn initialize_interp(&mut self, gas_limit: U256) { let _ = gas_limit; }
15
16 fn step(&mut self, interp: &dyn InterpreterInfo) { let _ = interp; }
21
22 fn step_end(&mut self, interp: &dyn InterpreterInfo) { let _ = interp; }
24
25 #[inline]
27 fn log(&mut self, address: &Address, topics: &Vec<H256>, data: &[u8]) {
28 let _ = address;
29 let _ = topics;
30 let _ = data;
31 }
32
33 #[inline]
36 fn selfdestruct(
37 &mut self, space: Space, contract: &Address, target: &Address,
38 value: U256,
39 ) {
40 let _ = space;
41 let _ = contract;
42 let _ = target;
43 let _ = value;
44 }
45}