From b7e7518b8e045634fe4318e32006e04e1a83adcf Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Fri, 15 Jan 2016 16:16:16 +0100 Subject: [PATCH] More merging with master --- src/evm/ext.rs | 2 +- src/evm/interpreter.rs | 2 +- src/evm/jit.rs | 2 +- src/evm/tests.rs | 4 ++-- src/executive.rs | 15 ++------------- src/tests/executive.rs | 2 +- 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/evm/ext.rs b/src/evm/ext.rs index 8ceeea369..464786e0a 100644 --- a/src/evm/ext.rs +++ b/src/evm/ext.rs @@ -41,7 +41,7 @@ pub trait Ext { fn extcode(&self, address: &Address) -> Vec; /// Creates log entry with given topics and data - fn log(&mut self, topics: Vec, data: &[u8]); + fn log(&mut self, topics: Vec, data: Vec); /// Should be called when transaction calls `RETURN` opcode. /// Returns gas_left if cost of returning the data is not too high. diff --git a/src/evm/interpreter.rs b/src/evm/interpreter.rs index 0207583f4..d98107f9c 100644 --- a/src/evm/interpreter.rs +++ b/src/evm/interpreter.rs @@ -499,7 +499,7 @@ impl Interpreter { .iter() .map(H256::from) .collect(); - ext.log(topics, mem.read_slice(offset, size)); + ext.log(topics, mem.read_slice(offset, size).to_vec()); }, instructions::PUSH1...instructions::PUSH32 => { let bytes = instructions::get_push_bytes(instruction); diff --git a/src/evm/jit.rs b/src/evm/jit.rs index 8b33bb1a3..4e0bb1012 100644 --- a/src/evm/jit.rs +++ b/src/evm/jit.rs @@ -284,7 +284,7 @@ impl<'a> evmjit::Ext for ExtAdapter<'a> { } let bytes_ref: &[u8] = slice::from_raw_parts(beg, size as usize); - self.ext.log(topics, bytes_ref); + self.ext.log(topics, bytes_ref.to_vec()); } } diff --git a/src/evm/tests.rs b/src/evm/tests.rs index 2fa98e3ea..67953bb10 100644 --- a/src/evm/tests.rs +++ b/src/evm/tests.rs @@ -70,10 +70,10 @@ impl Ext for FakeExt { self.codes.get(address).unwrap_or(&Bytes::new()).clone() } - fn log(&mut self, topics: Vec, data: &[u8]) { + fn log(&mut self, topics: Vec, data: Vec) { self.logs.push(FakeLogEntry { topics: topics, - data: data.to_vec() + data: data }); } diff --git a/src/executive.rs b/src/executive.rs index d3dd5aab2..90a0d24ca 100644 --- a/src/executive.rs +++ b/src/executive.rs @@ -2,7 +2,7 @@ use common::*; use state::*; use engine::*; -use evm::{self, Factory, Ext}; +use evm::{self, Ext}; use externalities::*; use substate::*; @@ -270,7 +270,6 @@ impl<'a> Executive<'a> { refunded: U256::zero(), cumulative_gas_used: self.info.gas_used + t.gas, logs: vec![], - excepted: true, contracts_created: vec![] }) }, @@ -283,16 +282,6 @@ impl<'a> Executive<'a> { logs: substate.logs, contracts_created: substate.contracts_created }) - }, - _err => { - Ok(Executed { - gas: t.gas, - gas_used: t.gas, - refunded: U256::zero(), - cumulative_gas_used: self.info.gas_used + t.gas, - logs: vec![], - contracts_created: vec![] - }) } } } @@ -320,7 +309,7 @@ mod tests { use ethereum; use engine::*; use spec::*; - use evm::Schedule; + use evm::{Schedule, Factory, VMType}; use substate::*; struct TestEngine { diff --git a/src/tests/executive.rs b/src/tests/executive.rs index 8b87681a5..6fd71bb06 100644 --- a/src/tests/executive.rs +++ b/src/tests/executive.rs @@ -135,7 +135,7 @@ impl<'a> Ext for TestExt<'a> { self.ext.extcode(address) } - fn log(&mut self, topics: Vec, data: &[u8]) { + fn log(&mut self, topics: Vec, data: Vec) { self.ext.log(topics, data) }