Added TODOs

This commit is contained in:
arkpar 2016-02-19 00:23:05 +01:00
parent d2349cdd8e
commit 8fa62130e3
3 changed files with 4 additions and 4 deletions

View File

@ -267,7 +267,7 @@ impl<'x, 'y> OpenBlock<'x, 'y> {
s.block.base.header.uncles_hash = uncle_bytes.sha3(); s.block.base.header.uncles_hash = uncle_bytes.sha3();
s.block.base.header.state_root = s.block.state.root().clone(); s.block.base.header.state_root = s.block.state.root().clone();
s.block.base.header.receipts_root = ordered_trie_root(s.block.receipts.iter().map(|ref r| r.rlp_bytes().to_vec()).collect()); s.block.base.header.receipts_root = ordered_trie_root(s.block.receipts.iter().map(|ref r| r.rlp_bytes().to_vec()).collect());
s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b = &b | &r.log_bloom; b}); s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b = &b | &r.log_bloom; b}); //TODO: use |= operator
s.block.base.header.gas_used = s.block.receipts.last().map_or(U256::zero(), |r| r.gas_used); s.block.base.header.gas_used = s.block.receipts.last().map_or(U256::zero(), |r| r.gas_used);
s.block.base.header.note_dirty(); s.block.base.header.note_dirty();

View File

@ -299,7 +299,7 @@ impl evm::Evm for Interpreter {
let (gas_cost, mem_size) = try!(self.get_gas_cost_mem(ext, instruction, &mut mem, &stack)); let (gas_cost, mem_size) = try!(self.get_gas_cost_mem(ext, instruction, &mut mem, &stack));
try!(self.verify_gas(&current_gas, &gas_cost)); try!(self.verify_gas(&current_gas, &gas_cost));
mem.expand(mem_size); mem.expand(mem_size);
current_gas = current_gas - gas_cost; current_gas = current_gas - gas_cost; //TODO: use operator -=
evm_debug!({ evm_debug!({
println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}", println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}",
@ -320,7 +320,7 @@ impl evm::Evm for Interpreter {
match result { match result {
InstructionResult::Ok => {}, InstructionResult::Ok => {},
InstructionResult::UnusedGas(gas) => { InstructionResult::UnusedGas(gas) => {
current_gas = current_gas + gas; current_gas = current_gas + gas; //TODO: use operator +=
}, },
InstructionResult::UseAllGas => { InstructionResult::UseAllGas => {
current_gas = U256::zero(); current_gas = U256::zero();

View File

@ -39,7 +39,7 @@ impl Receipt {
Receipt { Receipt {
state_root: state_root, state_root: state_root,
gas_used: gas_used, gas_used: gas_used,
log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b = b | l.bloom(); b }), log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b = &b | &l.bloom(); b }), //TODO: use |= operator
logs: logs, logs: logs,
} }
} }