implement 'chainId' opcode
This commit is contained in:
parent
1e4f290cc6
commit
b5e8a8d61b
|
@ -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 chain’s EIP-155 unique identifier.
|
||||
ChainId = 0x46, # Get current chain’s EIP-155 unique identifier.
|
||||
SelfBalance = 0x47, # Get current contract's balance.
|
||||
|
||||
# 50s: Stack, Memory, Storage and Flow Operations
|
||||
|
|
|
@ -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 chain’s 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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue