diff --git a/interpreter/src/eval/mod.rs b/interpreter/src/eval/mod.rs index 03ca8aad..ba578aec 100644 --- a/interpreter/src/eval/mod.rs +++ b/interpreter/src/eval/mod.rs @@ -669,50 +669,22 @@ pub fn eval_gas( self::system::gas(machine, handle) } -pub fn eval_log0, H: RuntimeEnvironment + RuntimeBackend, Tr>( - machine: &mut Machine, - handle: &mut H, - _opcode: Opcode, - _position: usize, -) -> Control { - self::system::log(machine, 0, handle) -} - -pub fn eval_log1, H: RuntimeEnvironment + RuntimeBackend, Tr>( - machine: &mut Machine, - handle: &mut H, - _opcode: Opcode, - _position: usize, -) -> Control { - self::system::log(machine, 1, handle) -} - -pub fn eval_log2, H: RuntimeEnvironment + RuntimeBackend, Tr>( - machine: &mut Machine, - handle: &mut H, - _opcode: Opcode, - _position: usize, -) -> Control { - self::system::log(machine, 2, handle) -} - -pub fn eval_log3, H: RuntimeEnvironment + RuntimeBackend, Tr>( - machine: &mut Machine, - handle: &mut H, - _opcode: Opcode, - _position: usize, -) -> Control { - self::system::log(machine, 3, handle) +macro_rules! eval_log { + ($($num:expr),*) => { + $(paste::paste! { + pub fn [], H: RuntimeEnvironment + RuntimeBackend, Tr>( + machine: &mut Machine, + handle: &mut H, + _opcode: Opcode, + _position: usize, + ) -> Control { + self::system::log(machine, $num, handle) + } + })* + }; } -pub fn eval_log4, H: RuntimeEnvironment + RuntimeBackend, Tr>( - machine: &mut Machine, - handle: &mut H, - _opcode: Opcode, - _position: usize, -) -> Control { - self::system::log(machine, 4, handle) -} +eval_log! { 0, 1, 2, 3, 4 } pub fn eval_suicide, H: RuntimeEnvironment + RuntimeBackend, Tr>( machine: &mut Machine,