Skip to content

Commit b41316b

Browse files
authored
parentBeaconBlockRoot is Hash32, per specs (#164)
1 parent 3e99be2 commit b41316b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tests/test_execution_types.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ suite "Execution types tests":
4848
prevRandao: b32(2),
4949
suggestedFeeRecipient: address(3),
5050
withdrawals: Opt.some(@[wd]),
51-
parentBeaconBlockRoot: Opt.some(b32(4)),
51+
parentBeaconBlockRoot: Opt.some(h256(4)),
5252
)
5353

5454
blobs = BlobsBundleV1(
@@ -110,7 +110,7 @@ suite "Execution types tests":
110110

111111
test "attr version":
112112
var v2 = attr
113-
v2.parentBeaconBlockRoot = Opt.none(Bytes32)
113+
v2.parentBeaconBlockRoot = Opt.none(Hash32)
114114
var v1 = v2
115115
v1.withdrawals = Opt.none(seq[WithdrawalV1])
116116
check attr.version == Version.V3

web3/engine_api.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ createRpcSigsFromNim(RpcClient):
2626

2727
proc engine_newPayloadV1(payload: ExecutionPayloadV1): PayloadStatusV1
2828
proc engine_newPayloadV2(payload: ExecutionPayloadV2): PayloadStatusV1
29-
proc engine_newPayloadV3(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Bytes32): PayloadStatusV1
30-
proc engine_newPayloadV4(payload: ExecutionPayloadV4, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Bytes32): PayloadStatusV1
29+
proc engine_newPayloadV3(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32): PayloadStatusV1
30+
proc engine_newPayloadV4(payload: ExecutionPayloadV4, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32): PayloadStatusV1
3131
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV1]): ForkchoiceUpdatedResponse
3232
proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV2]): ForkchoiceUpdatedResponse
3333
proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributesV3]): ForkchoiceUpdatedResponse
@@ -51,10 +51,10 @@ createRpcSigsFromNim(RpcClient):
5151
proc engine_newPayloadV2(payload: ExecutionPayloadV1OrV2): PayloadStatusV1
5252
proc engine_newPayloadV3(payload: ExecutionPayload,
5353
expectedBlobVersionedHashes: Opt[seq[VersionedHash]],
54-
parentBeaconBlockRoot: Opt[Bytes32]): PayloadStatusV1
54+
parentBeaconBlockRoot: Opt[Hash32]): PayloadStatusV1
5555
proc engine_newPayloadV4(payload: ExecutionPayload,
5656
expectedBlobVersionedHashes: Opt[seq[VersionedHash]],
57-
parentBeaconBlockRoot: Opt[Bytes32]): PayloadStatusV1
57+
parentBeaconBlockRoot: Opt[Hash32]): PayloadStatusV1
5858
proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse
5959
proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse
6060

web3/engine_api_types.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ type
200200
prevRandao*: Bytes32
201201
suggestedFeeRecipient*: Address
202202
withdrawals*: seq[WithdrawalV1]
203-
parentBeaconBlockRoot*: Bytes32
203+
parentBeaconBlockRoot*: Hash32
204204

205205
# This is ugly, but see the comment on ExecutionPayloadV1OrV2.
206206
PayloadAttributesV1OrV2* = object

web3/execution_types.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type
4343
prevRandao*: Bytes32
4444
suggestedFeeRecipient*: Address
4545
withdrawals*: Opt[seq[WithdrawalV1]]
46-
parentBeaconBlockRoot*: Opt[Bytes32]
46+
parentBeaconBlockRoot*: Opt[Hash32]
4747

4848
SomeOptionalPayloadAttributes* =
4949
Opt[PayloadAttributesV1] |

0 commit comments

Comments
 (0)