From 50d1038cc58db35417fe10284e57f73bb5db0a75 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 26 Jan 2016 15:02:14 +0100 Subject: [PATCH] Remove flushln!s. --- src/client.rs | 3 +-- src/evm/interpreter.rs | 3 --- src/executive.rs | 9 ++++----- src/externalities.rs | 2 +- src/state.rs | 1 - 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/client.rs b/src/client.rs index 91ccf4b95..59568584b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -145,7 +145,6 @@ impl Client { /// Create a new client with given spec and DB path. pub fn new(spec: Spec, path: &Path, message_channel: IoChannel ) -> Result, Error> { let gb = spec.genesis_block(); - flushln!("Spec says genesis block is {}", gb.pretty()); let chain = Arc::new(RwLock::new(BlockChain::new(&gb, path))); let mut opts = Options::new(); opts.set_max_open_files(256); @@ -177,7 +176,7 @@ impl Client { if engine.spec().ensure_db_good(&mut state_db) { state_db.commit(0, &engine.spec().genesis_header().hash(), None).expect("Error commiting genesis state to state DB"); } - flushln!("Client::new: commiting. Best root now: {}. contains: {}", chain.read().unwrap().genesis_header().state_root, state_db.contains(&chain.read().unwrap().genesis_header().state_root)); + trace!("Client::new: commiting. Best root now: {}. contains: {}", chain.read().unwrap().genesis_header().state_root, state_db.contains(&chain.read().unwrap().genesis_header().state_root)); Ok(Arc::new(Client { chain: chain, engine: engine.clone(), diff --git a/src/evm/interpreter.rs b/src/evm/interpreter.rs index 2f43b5199..7657b1bbe 100644 --- a/src/evm/interpreter.rs +++ b/src/evm/interpreter.rs @@ -275,8 +275,6 @@ impl evm::Evm for Interpreter { code: &code }; - flushln!("Executing: {:?}", params); - while reader.position < code.len() { let instruction = code[reader.position]; reader.position += 1; @@ -642,7 +640,6 @@ impl Interpreter { return Ok(InstructionResult::StopExecution); }, instructions::SUICIDE => { - flushln!("SUICIDE!"); let address = stack.pop_back(); ext.suicide(&u256_to_address(&address)); return Ok(InstructionResult::StopExecution); diff --git a/src/executive.rs b/src/executive.rs index 9c3a669cf..07ab4c4c5 100644 --- a/src/executive.rs +++ b/src/executive.rs @@ -173,7 +173,7 @@ impl<'a> Executive<'a> { if let ActionValue::Transfer(val) = params.value { self.state.transfer_balance(¶ms.sender, ¶ms.address, &val); } - flushln!("Executive::call(params={:?}) self.env_info={:?}", params, self.info); + trace!("Executive::call(params={:?}) self.env_info={:?}", params, self.info); if self.engine.is_builtin(¶ms.code_address) { // if destination is builtin, try to execute it @@ -260,17 +260,16 @@ impl<'a> Executive<'a> { let refund_value = gas_left * t.gas_price; let fees_value = gas_used * t.gas_price; - flushln!("exec::finalize: t.gas={}, sstore_refunds={}, suicide_refunds={}, refunds_bound={}, gas_left_prerefund={}, refunded={}, gas_left={}, gas_used={}, refund_value={}, fees_value={}\n", + trace!("exec::finalize: t.gas={}, sstore_refunds={}, suicide_refunds={}, refunds_bound={}, gas_left_prerefund={}, refunded={}, gas_left={}, gas_used={}, refund_value={}, fees_value={}\n", t.gas, sstore_refunds, suicide_refunds, refunds_bound, gas_left_prerefund, refunded, gas_left, gas_used, refund_value, fees_value); - flushln!("exec::finalize: Refunding refund_value={}, sender={}\n", refund_value, t.sender().unwrap()); + trace!("exec::finalize: Refunding refund_value={}, sender={}\n", refund_value, t.sender().unwrap()); self.state.add_balance(&t.sender().unwrap(), &refund_value); - flushln!("exec::finalize: Compensating author: fees_value={}, author={}\n", fees_value, &self.info.author); + trace!("exec::finalize: Compensating author: fees_value={}, author={}\n", fees_value, &self.info.author); self.state.add_balance(&self.info.author, &fees_value); // perform suicides for address in &substate.suicides { - flushln!("Killing {}", address); self.state.kill_account(address); } diff --git a/src/externalities.rs b/src/externalities.rs index e7a73d553..f1b8c1958 100644 --- a/src/externalities.rs +++ b/src/externalities.rs @@ -215,7 +215,7 @@ impl<'a> Ext for Externalities<'a> { fn suicide(&mut self, refund_address: &Address) { let address = self.origin_info.address.clone(); let balance = self.balance(&address); - flushln!("Suiciding {} -> {} (xfer: {})", address, refund_address, balance); + trace!("Suiciding {} -> {} (xfer: {})", address, refund_address, balance); self.state.transfer_balance(&address, refund_address, &balance); self.substate.suicides.insert(address); } diff --git a/src/state.rs b/src/state.rs index 238638617..7310f63a7 100644 --- a/src/state.rs +++ b/src/state.rs @@ -103,7 +103,6 @@ impl State { /// Mutate storage of account `a` so that it is `value` for `key`. pub fn code(&self, a: &Address) -> Option { - flushln!("Getting code at {}", a); self.get(a, true).as_ref().map_or(None, |a|a.code().map(|x|x.to_vec())) }