Skip to content

Commit

Permalink
parentBeaconBlockRoot is Hash32, per specs (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck authored Oct 2, 2024
1 parent 3e99be2 commit b41316b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_execution_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ suite "Execution types tests":
prevRandao: b32(2),
suggestedFeeRecipient: address(3),
withdrawals: Opt.some(@[wd]),
parentBeaconBlockRoot: Opt.some(b32(4)),
parentBeaconBlockRoot: Opt.some(h256(4)),
)

blobs = BlobsBundleV1(
Expand Down Expand Up @@ -110,7 +110,7 @@ suite "Execution types tests":

test "attr version":
var v2 = attr
v2.parentBeaconBlockRoot = Opt.none(Bytes32)
v2.parentBeaconBlockRoot = Opt.none(Hash32)
var v1 = v2
v1.withdrawals = Opt.none(seq[WithdrawalV1])
check attr.version == Version.V3
Expand Down
8 changes: 4 additions & 4 deletions web3/engine_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ createRpcSigsFromNim(RpcClient):

proc engine_newPayloadV1(payload: ExecutionPayloadV1): PayloadStatusV1
proc engine_newPayloadV2(payload: ExecutionPayloadV2): PayloadStatusV1
proc engine_newPayloadV3(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Bytes32): PayloadStatusV1
proc engine_newPayloadV4(payload: ExecutionPayloadV4, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Bytes32): PayloadStatusV1
proc engine_newPayloadV3(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32): PayloadStatusV1
proc engine_newPayloadV4(payload: ExecutionPayloadV4, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32): PayloadStatusV1
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV1]): ForkchoiceUpdatedResponse
proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV2]): ForkchoiceUpdatedResponse
proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV3]): ForkchoiceUpdatedResponse
Expand All @@ -51,10 +51,10 @@ createRpcSigsFromNim(RpcClient):
proc engine_newPayloadV2(payload: ExecutionPayloadV1OrV2): PayloadStatusV1
proc engine_newPayloadV3(payload: ExecutionPayload,
expectedBlobVersionedHashes: Opt[seq[VersionedHash]],
parentBeaconBlockRoot: Opt[Bytes32]): PayloadStatusV1
parentBeaconBlockRoot: Opt[Hash32]): PayloadStatusV1
proc engine_newPayloadV4(payload: ExecutionPayload,
expectedBlobVersionedHashes: Opt[seq[VersionedHash]],
parentBeaconBlockRoot: Opt[Bytes32]): PayloadStatusV1
parentBeaconBlockRoot: Opt[Hash32]): PayloadStatusV1
proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse
proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse

Expand Down
2 changes: 1 addition & 1 deletion web3/engine_api_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ type
prevRandao*: Bytes32
suggestedFeeRecipient*: Address
withdrawals*: seq[WithdrawalV1]
parentBeaconBlockRoot*: Bytes32
parentBeaconBlockRoot*: Hash32

# This is ugly, but see the comment on ExecutionPayloadV1OrV2.
PayloadAttributesV1OrV2* = object
Expand Down
2 changes: 1 addition & 1 deletion web3/execution_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type
prevRandao*: Bytes32
suggestedFeeRecipient*: Address
withdrawals*: Opt[seq[WithdrawalV1]]
parentBeaconBlockRoot*: Opt[Bytes32]
parentBeaconBlockRoot*: Opt[Hash32]

SomeOptionalPayloadAttributes* =
Opt[PayloadAttributesV1] |
Expand Down

0 comments on commit b41316b

Please sign in to comment.