implement 'chainId' opcode

This commit is contained in:
andri lim 2019-11-12 19:41:19 +07:00 committed by zah
parent 1e4f290cc6
commit b5e8a8d61b
3 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ fill_enum_holes:
Difficulty = 0x44, # Get the block's difficulty.
GasLimit = 0x45, # Get the block's gas limit.
ChainID = 0x46, # Get current chains EIP-155 unique identifier.
ChainId = 0x46, # Get current chains EIP-155 unique identifier.
SelfBalance = 0x47, # Get current contract's balance.
# 50s: Stack, Memory, Storage and Flow Operations

View File

@ -372,10 +372,10 @@ op gasLimit, inline = true:
## 0x45, Get the block's gas limit
push: computation.vmState.gasLimit
op chainID, inline = true:
op chainId, inline = true:
## 0x46, Get current chains EIP-155 unique identifier.
# TODO: this is a stub
push: 0
push: computation.vmState.chaindb.config.chainId
op selfBalance, inline = true:
## 0x47, Get current contract's balance.

View File

@ -217,7 +217,7 @@ let ConstantinopleOpDispatch {.compileTime.}: array[Op, NimNode] = genConstantin
proc genIstanbulJumpTable(ops: array[Op, NimNode]): array[Op, NimNode] {.compileTime.} =
result = ops
result[ChainID] = newIdentNode "chainID"
result[ChainId] = newIdentNode "chainId"
result[SelfBalance] = newIdentNode "selfBalance"
let IstanbulOpDispatch {.compileTime.}: array[Op, NimNode] = genIstanbulJumpTable(ConstantinopleOpDispatch)