From 359b4de3ff5407fb0b0694ac810c9a30eedb2c46 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Sun, 26 Nov 2017 23:18:58 +0300 Subject: [PATCH] WASM Remove blockhash error (#7121) * Remove blockhash error * Update tests. --- ethcore/res/wasm-tests | 2 +- ethcore/wasm/src/env.rs | 2 +- ethcore/wasm/src/runtime.rs | 2 +- ethcore/wasm/src/tests.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethcore/res/wasm-tests b/ethcore/res/wasm-tests index e5fcae4e9..d6185ea16 160000 --- a/ethcore/res/wasm-tests +++ b/ethcore/res/wasm-tests @@ -1 +1 @@ -Subproject commit e5fcae4e9c2a570f293a22baa4d78d9f4b391a0f +Subproject commit d6185ea16eaba7ff685c069c2064819f9549c4d7 diff --git a/ethcore/wasm/src/env.rs b/ethcore/wasm/src/env.rs index 1004f3526..ed4bda68b 100644 --- a/ethcore/wasm/src/env.rs +++ b/ethcore/wasm/src/env.rs @@ -115,7 +115,7 @@ pub const SIGNATURES: &'static [UserFunctionDescriptor] = &[ Static( "_blockhash", &[I64, I32], - Some(I32), + None, ), Static( "_coinbase", diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index 0782876b5..bad325fbf 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -665,7 +665,7 @@ impl<'a, 'b> Runtime<'a, 'b> { self.memory.set(return_ptr, &*hash)?; - Ok(Some(0i32.into())) + Ok(None) } fn return_address_ptr(&mut self, ptr: u32, val: Address) -> Result<(), InterpreterError> diff --git a/ethcore/wasm/src/tests.rs b/ethcore/wasm/src/tests.rs index f5738871b..a387f9292 100644 --- a/ethcore/wasm/src/tests.rs +++ b/ethcore/wasm/src/tests.rs @@ -765,7 +765,7 @@ fn externs() { "Gas limit requested and returned does not match" ); - assert_eq!(gas_left, U256::from(94_733)); + assert_eq!(gas_left, U256::from(94_858)); } #[test]