diff --git a/ethcore/src/evm/instructions.rs b/ethcore/src/evm/instructions.rs index 9e7527fa3..62cfe77d6 100644 --- a/ethcore/src/evm/instructions.rs +++ b/ethcore/src/evm/instructions.rs @@ -146,7 +146,7 @@ impl InstructionInfo { } lazy_static! { - static ref INSTRUCTIONS: [InstructionInfo; 0x100] = { + pub static ref INSTRUCTIONS: [InstructionInfo; 0x100] = { let mut arr = [InstructionInfo::default(); 0x100]; arr[STOP as usize] = InstructionInfo::new("STOP", 0, 0, 0, true, GasPriceTier::Zero); arr[ADD as usize] = InstructionInfo::new("ADD", 0, 2, 1, false, GasPriceTier::VeryLow); @@ -282,11 +282,6 @@ lazy_static! { }; } -/// Return details about specific instruction -pub fn get_info(instruction: Instruction) -> &'static InstructionInfo { - &INSTRUCTIONS[instruction as usize] -} - /// Virtual machine bytecode instruction. /// halts execution pub const STOP: Instruction = 0x00; diff --git a/ethcore/src/evm/interpreter/mod.rs b/ethcore/src/evm/interpreter/mod.rs index f79d18b36..a43592c6d 100644 --- a/ethcore/src/evm/interpreter/mod.rs +++ b/ethcore/src/evm/interpreter/mod.rs @@ -104,12 +104,13 @@ impl evm::Evm for Interpreter { position: 0, code: &code }; + let infos = &*instructions::INSTRUCTIONS; while reader.position < code.len() { let instruction = code[reader.position]; reader.position += 1; - let info = instructions::get_info(instruction); + let info = infos[instruction as usize]; try!(self.verify_instruction(ext, instruction, &info, &stack)); // Calculate gas cost diff --git a/ethcore/src/evm/mod.rs b/ethcore/src/evm/mod.rs index de208c6a4..d0f379f24 100644 --- a/ethcore/src/evm/mod.rs +++ b/ethcore/src/evm/mod.rs @@ -35,4 +35,3 @@ pub use self::evm::{Evm, Error, Finalize, GasLeft, Result, CostType}; pub use self::ext::{Ext, ContractCreateResult, MessageCallResult}; pub use self::factory::{Factory, VMType}; pub use self::schedule::Schedule; -pub use self::instructions::get_info; diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 4f644db03..9f4f02491 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -146,5 +146,4 @@ mod tests; mod json_tests; pub use types::*; -pub use evm::get_info; pub use executive::contract_address;