From 95366e92b360bb6f770f73fcb847eab5d481d998 Mon Sep 17 00:00:00 2001 From: Gav Date: Thu, 8 Feb 2018 11:11:46 +0100 Subject: [PATCH] Restore some traces. --- substrate/executor/src/wasm_executor.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 7ba1dd5d2f..828b6f1221 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -224,16 +224,16 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, ext_twox_128(data: *const u8, len: u32, out: *mut u8) => { let result = if len == 0 { let hashed = twox_128(&[0u8; 0]); - //println!("XXhash: '' -> {}", HexDisplay::from(&hashed)); + trace!(target: "xxhash", "XXhash: '' -> {}", HexDisplay::from(&hashed)); this.hash_lookup.insert(hashed.to_vec(), vec![]); hashed } else { let key = this.memory.get(data, len as usize).map_err(|_| DummyUserError)?; let hashed_key = twox_128(&key); if let Ok(skey) = ::std::str::from_utf8(&key) { - //println!("XXhash: {} -> {}", skey, HexDisplay::from(&hashed_key)); + trace!(target: "xxhash", "XXhash: {} -> {}", skey, HexDisplay::from(&hashed_key)); } else { - //println!("XXhash: {} -> {}", HexDisplay::from(&key), HexDisplay::from(&hashed_key)); + trace!(target: "xxhash", "XXhash: {} -> {}", HexDisplay::from(&key), HexDisplay::from(&hashed_key)); } this.hash_lookup.insert(hashed_key.to_vec(), key); hashed_key @@ -290,7 +290,7 @@ impl CodeExecutor for WasmExecutor { data: &[u8], ) -> Result> { // TODO: handle all expects as errors to be returned. - println!(/*target: "wasm-executor",*/ "Wasm-Calling {}({})", method, HexDisplay::from(&data)); + println!("Wasm-Calling {}({})", method, HexDisplay::from(&data)); let program = ProgramInstance::new().expect("this really shouldn't be able to fail; qed"); @@ -319,7 +319,7 @@ impl CodeExecutor for WasmExecutor { let length = (r >> 32) as u32 as usize; memory.get(offset, length) .map_err(|_| ErrorKind::Runtime.into()) - .map(|v| { println!(/*target: "wasm-executor",*/ "Returned {}", HexDisplay::from(&v)); v }) + .map(|v| { println!("Returned {}", HexDisplay::from(&v)); v }) } else { Err(ErrorKind::InvalidReturn.into()) }