More merging with master

This commit is contained in:
Tomusdrw 2016-01-15 16:16:16 +01:00
parent 39a7576ddb
commit b7e7518b8e
6 changed files with 8 additions and 19 deletions

View File

@ -41,7 +41,7 @@ pub trait Ext {
fn extcode(&self, address: &Address) -> Vec<u8>;
/// Creates log entry with given topics and data
fn log(&mut self, topics: Vec<H256>, data: &[u8]);
fn log(&mut self, topics: Vec<H256>, data: Vec<u8>);
/// Should be called when transaction calls `RETURN` opcode.
/// Returns gas_left if cost of returning the data is not too high.

View File

@ -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);

View File

@ -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());
}
}

View File

@ -70,10 +70,10 @@ impl Ext for FakeExt {
self.codes.get(address).unwrap_or(&Bytes::new()).clone()
}
fn log(&mut self, topics: Vec<H256>, data: &[u8]) {
fn log(&mut self, topics: Vec<H256>, data: Vec<u8>) {
self.logs.push(FakeLogEntry {
topics: topics,
data: data.to_vec()
data: data
});
}

View File

@ -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 {

View File

@ -135,7 +135,7 @@ impl<'a> Ext for TestExt<'a> {
self.ext.extcode(address)
}
fn log(&mut self, topics: Vec<H256>, data: &[u8]) {
fn log(&mut self, topics: Vec<H256>, data: Vec<u8>) {
self.ext.log(topics, data)
}