fixes NUMBER opcode

This commit is contained in:
andri lim 2019-02-06 14:47:05 +07:00 committed by zah
parent a28f06a825
commit 67c38b0275
2 changed files with 5 additions and 3 deletions

View File

@ -49,7 +49,9 @@ method timestamp*(vmState: BaseVMState): EthTime {.base, gcsafe.} =
vmState.blockHeader.timestamp
method blockNumber*(vmState: BaseVMState): BlockNumber {.base, gcsafe.} =
vmState.blockHeader.blockNumber
# it should return current block number
# and not head.blockNumber
vmState.blockHeader.blockNumber + 1
method difficulty*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
vmState.blockHeader.difficulty

View File

@ -264,12 +264,12 @@ suite "Custom Opcodes Test":
TimeStamp
stack: "0x0000000000000000000000000000000000000000000000000000000055c46bb3"
# current number or parent number?
# it should be current block number
assembler: # NUMBER OP
title: "NUMBER_1"
code:
Number
stack: "0x000000000000000000000000000000000000000000000000000000000000b864"
stack: "0x000000000000000000000000000000000000000000000000000000000000b865"
# current difficulty or parent dificulty?
assembler: # DIFFICULTY OP