From c66afe18dd39072b52b329b45c55e14b3620721e Mon Sep 17 00:00:00 2001 From: Coffepots Date: Fri, 6 Apr 2018 19:29:47 +0100 Subject: [PATCH] Revert keccak change, get test_opcode to run --- src/logic/block_ops.nim | 3 ++- src/utils/keccak.nim | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/logic/block_ops.nim b/src/logic/block_ops.nim index a4caf0721..97d5ab376 100644 --- a/src/logic/block_ops.nim +++ b/src/logic/block_ops.nim @@ -1,5 +1,5 @@ import - ../constants, ../errors, ../computation, ../vm_state, ../types, .. / vm / [stack], ttmath + ../constants, ../errors, ../computation, ../vm_state, ../types, .. / vm / [stack] {.this: computation.} {.experimental.} @@ -19,6 +19,7 @@ proc timestamp*(computation) = # TODO: EthTime is an alias of Time, which is a distinct int64 so can't use u256(int64) # This may have implications for different platforms. stack.push(vmState.timestamp.uint64.u256) + stack.push(vmState.timestamp.u256) proc number*(computation) = stack.push(vmState.blockNumber) diff --git a/src/utils/keccak.nim b/src/utils/keccak.nim index 2d5abdeb0..6f79651c8 100644 --- a/src/utils/keccak.nim +++ b/src/utils/keccak.nim @@ -1,18 +1,8 @@ import - nimcrypto, strutils + keccak_tiny, strutils -#[ template keccak*(value: string): string = $keccak_256(value) template keccak*(value: cstring): string = ($value).keccak -]# - -proc keccak*(value: string): string = - # TODO: Urgent - check this is doing the same thing as above - var k = sha3_256() - k.init - k.update(cast[ptr uint8](value[0].unsafeaddr), value.len.uint) - result = $finish(k) -