mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-25 10:25:32 +00:00
implement EIP658: receipt status field
This commit is contained in:
parent
d8284f9330
commit
dd89af6d3d
@ -85,9 +85,7 @@ proc makeReceipt(vmState: BaseVMState, fork = FkFrontier): Receipt =
|
||||
if fork < FkByzantium:
|
||||
result.stateRootOrStatus = hashOrStatus(vmState.accountDb.rootHash)
|
||||
else:
|
||||
# TODO: post byzantium fork use status instead of rootHash
|
||||
let vmStatus = true # success or failure
|
||||
result.stateRootOrStatus = hashOrStatus(vmStatus)
|
||||
result.stateRootOrStatus = hashOrStatus(vmState.status)
|
||||
|
||||
result.cumulativeGasUsed = vmState.cumulativeGasUsed
|
||||
result.logs = vmState.getAndClearLogEntries()
|
||||
|
@ -87,8 +87,9 @@ proc execComputation*(computation: var BaseComputation): bool =
|
||||
|
||||
if computation.getFork >= FkSpurious:
|
||||
computation.collectTouchedAccounts(computation.vmState.touchedAccounts)
|
||||
|
||||
|
||||
result = computation.isSuccess
|
||||
computation.vmstate.status = result
|
||||
if result:
|
||||
computation.vmState.addLogs(computation.logEntries)
|
||||
|
||||
|
@ -26,6 +26,7 @@ type
|
||||
accountDb* : AccountStateDB
|
||||
cumulativeGasUsed*: GasInt
|
||||
touchedAccounts*: HashSet[EthAddress]
|
||||
status* : bool
|
||||
|
||||
AccessLogs* = ref object
|
||||
reads*: Table[string, string]
|
||||
|
Loading…
x
Reference in New Issue
Block a user