Skip to content

Commit

Permalink
chore: remove unused EvmInstructionTables type alias (bluealloy#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored and fubuloubu committed Apr 11, 2024
1 parent 3cab695 commit ceeac99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions crates/revm/src/handler/register.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::{db::Database, handler::Handler, interpreter::opcode::InstructionTables, Evm};
use crate::{db::Database, handler::Handler, Evm};
use std::boxed::Box;

/// EVM Handler
pub type EvmHandler<'a, EXT, DB> = Handler<'a, Evm<'a, EXT, DB>, EXT, DB>;

/// EVM Instruction Tables
pub type EvmInstructionTables<'a, EXT, DB> = InstructionTables<'a, Evm<'a, EXT, DB>>;

// Handle register
pub type HandleRegister<'a, EXT, DB> = fn(&mut EvmHandler<'a, EXT, DB>);

Expand Down
12 changes: 6 additions & 6 deletions crates/revm/src/inspector/handler_register.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use core::cell::RefCell;

use crate::{
db::Database,
handler::register::{EvmHandler, EvmInstructionTables},
handler::register::EvmHandler,
interpreter::{opcode, opcode::BoxedInstruction, InstructionResult, Interpreter},
primitives::EVMError,
Evm, FrameOrResult, FrameResult, Inspector, JournalEntry,
};
use core::cell::RefCell;
use revm_interpreter::opcode::InstructionTables;
use std::{boxed::Box, rc::Rc, sync::Arc, vec::Vec};

/// Provides access to an `Inspector` instance.
Expand Down Expand Up @@ -41,11 +41,11 @@ pub fn inspector_handle_register<'a, DB: Database, EXT: GetInspector<DB>>(
.take()
.expect("Handler must have instruction table");
let mut table = match table {
EvmInstructionTables::Plain(table) => table
InstructionTables::Plain(table) => table
.into_iter()
.map(|i| inspector_instruction(i))
.collect::<Vec<_>>(),
EvmInstructionTables::Boxed(table) => table
InstructionTables::Boxed(table) => table
.into_iter()
.map(|i| inspector_instruction(i))
.collect::<Vec<_>>(),
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn inspector_handle_register<'a, DB: Database, EXT: GetInspector<DB>>(
}

// cast vector to array.
handler.instruction_table = Some(EvmInstructionTables::Boxed(
handler.instruction_table = Some(InstructionTables::Boxed(
table.try_into().unwrap_or_else(|_| unreachable!()),
));

Expand Down

0 comments on commit ceeac99

Please sign in to comment.