Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parentBeaconBlockRoot is Hash32, per specs #164

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading