|
1 | 1 | use auto_impl::auto_impl; |
2 | 2 | use interpreter::{ |
| 3 | + instruction_table, |
3 | 4 | instructions::{instruction_table_tail, InstructionTable}, |
4 | 5 | Host, Instruction, InterpreterTypes, |
5 | 6 | }; |
@@ -40,19 +41,30 @@ where |
40 | 41 | WIRE: InterpreterTypes, |
41 | 42 | HOST: Host, |
42 | 43 | { |
43 | | - /// Returns `EthInstructions` with mainnet spec. |
| 44 | + /// Returns an instance with the default mainnet instructions. |
| 45 | + #[inline] |
44 | 46 | pub fn new_mainnet() -> Self { |
45 | 47 | Self::new(instruction_table_tail::<WIRE, HOST>()) |
46 | 48 | } |
47 | 49 |
|
48 | | - /// Rerurns new `EthInstructions` with custom instruction table. |
| 50 | + /// Returns an instance with the default mainnet inspectable instructions. |
| 51 | + /// |
| 52 | + /// Use this for inspectors and for stepping through the instructions. |
| 53 | + #[inline] |
| 54 | + pub fn new_mainnet_no_tail() -> Self { |
| 55 | + Self::new(instruction_table::<WIRE, HOST>()) |
| 56 | + } |
| 57 | + |
| 58 | + /// Returns an instance new `EthInstructions` with custom instruction table. |
| 59 | + #[inline] |
49 | 60 | pub fn new(base_table: InstructionTable<WIRE, HOST>) -> Self { |
50 | 61 | Self { |
51 | 62 | instruction_table: Box::new(base_table), |
52 | 63 | } |
53 | 64 | } |
54 | 65 |
|
55 | | - /// Inserts a new instruction into the instruction table.s |
| 66 | + /// Inserts a new instruction into the instruction table. |
| 67 | + #[inline] |
56 | 68 | pub fn insert_instruction(&mut self, opcode: u8, instruction: Instruction<WIRE, HOST>) { |
57 | 69 | self.instruction_table[opcode as usize] = instruction; |
58 | 70 | } |
|
0 commit comments