From 93c4417c2126b1a8c2db10b3ee3f0dab149da4d2 Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 16 Dec 2024 12:39:15 +0000 Subject: [PATCH] update to https://github.com/ethereum/execution-apis/pull/599 --- tests/test_json_marshalling.nim | 6 ++---- web3/engine_api.nim | 4 ++-- web3/engine_api_types.nim | 6 +++--- web3/execution_types.nim | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/test_json_marshalling.nim b/tests/test_json_marshalling.nim index d5280de4..3dd1c079 100644 --- a/tests/test_json_marshalling.nim +++ b/tests/test_json_marshalling.nim @@ -89,12 +89,10 @@ proc rand[T](_: type seq[T]): seq[T] = for i in 0..<3: result[i] = rand(T) -proc rand(_: type array[3, seq[byte]]): array[3, seq[byte]] = +proc rand(_: type seq[seq[byte]]): seq[seq[byte]] = var z = newSeq[byte](10) discard randomBytes(z) - result[0] = z - result[1] = z - result[2] = z + @[z, z, z] proc rand[T](_: type SingleOrList[T]): SingleOrList[T] = SingleOrList[T](kind: slkSingle, single: rand(T)) diff --git a/web3/engine_api.nim b/web3/engine_api.nim index 64340830..ccd9e9c2 100644 --- a/web3/engine_api.nim +++ b/web3/engine_api.nim @@ -27,7 +27,7 @@ createRpcSigsFromNim(RpcClient): proc engine_newPayloadV1(payload: ExecutionPayloadV1): PayloadStatusV1 proc engine_newPayloadV2(payload: ExecutionPayloadV2): PayloadStatusV1 proc engine_newPayloadV3(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32): PayloadStatusV1 - proc engine_newPayloadV4(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32, executionRequests: array[3, seq[byte]]): PayloadStatusV1 + proc engine_newPayloadV4(payload: ExecutionPayloadV3, expectedBlobVersionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32, executionRequests: seq[seq[byte]]): 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 @@ -55,7 +55,7 @@ createRpcSigsFromNim(RpcClient): proc engine_newPayloadV4(payload: ExecutionPayload, expectedBlobVersionedHashes: Opt[seq[VersionedHash]], parentBeaconBlockRoot: Opt[Hash32], - executionRequests: Opt[array[3, seq[byte]]]): PayloadStatusV1 + executionRequests: Opt[seq[seq[byte]]]): PayloadStatusV1 proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Opt[PayloadAttributes]): ForkchoiceUpdatedResponse diff --git a/web3/engine_api_types.nim b/web3/engine_api_types.nim index 5dff6b94..bb08d3e0 100644 --- a/web3/engine_api_types.nim +++ b/web3/engine_api_types.nim @@ -215,13 +215,13 @@ type blobsBundle*: BlobsBundleV1 shouldOverrideBuilder*: bool - # https://github.com/ethereum/execution-apis/blob/4140e528360fea53c34a766d86a000c6c039100e/src/engine/prague.md#response-1 + # https://github.com/ethereum/execution-apis/blob/7c9772f95c2472ccfc6f6128dc2e1b568284a2da/src/engine/prague.md#response-1 GetPayloadV4Response* = object executionPayload*: ExecutionPayloadV3 blockValue*: UInt256 blobsBundle*: BlobsBundleV1 shouldOverrideBuilder*: bool - executionRequests*: array[3, seq[byte]] + executionRequests*: seq[seq[byte]] SomeGetPayloadResponse* = ExecutionPayloadV1 | @@ -256,4 +256,4 @@ template `==`*(a, b: TypedTransaction): bool = # Backwards compatibility type - PayloadID* {.deprecated.} = Bytes8 \ No newline at end of file + PayloadID* {.deprecated.} = Bytes8 diff --git a/web3/execution_types.nim b/web3/execution_types.nim index 3607d012..79d79fc9 100644 --- a/web3/execution_types.nim +++ b/web3/execution_types.nim @@ -54,7 +54,7 @@ type blockValue*: Opt[UInt256] blobsBundle*: Opt[BlobsBundleV1] shouldOverrideBuilder*: Opt[bool] - executionRequests*: Opt[array[3, seq[byte]]] + executionRequests*: Opt[seq[seq[byte]]] Version* {.pure.} = enum V1