bump web3 and add shouldOverrideBuilder field to GetPayloadV3Response (#1807)

* bump web3 and add shouldOverrideBuilder field to GetPayloadV3Response

* Resolve ambiguous identifier error
This commit is contained in:
andri lim 2023-10-05 20:54:51 +07:00 committed by GitHub
parent f433297631
commit 744e4f9739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View File

@ -237,7 +237,7 @@ proc toTransactions(txs: openArray[JsonNode]): seq[Transaction] =
for x in txs:
result.add parseTransaction(x)
proc toWithdrawal(wd: WithdrawalObject): Withdrawal =
proc toWithdrawal(wd: rpc_types.WithdrawalObject): Withdrawal =
Withdrawal(
index: hexToInt(string wd.index, uint64),
validatorIndex: hexToInt(string wd.validatorIndex, uint64),
@ -245,12 +245,12 @@ proc toWithdrawal(wd: WithdrawalObject): Withdrawal =
amount: hexToInt(string wd.amount, uint64),
)
proc toWithdrawals(list: seq[WithdrawalObject]): seq[Withdrawal] =
proc toWithdrawals(list: seq[rpc_types.WithdrawalObject]): seq[Withdrawal] =
result = newSeqOfCap[Withdrawal](list.len)
for wd in list:
result.add toWithdrawal(wd)
proc toWithdrawals(list: Option[seq[WithdrawalObject]]): Option[seq[Withdrawal]] =
proc toWithdrawals(list: Option[seq[rpc_types.WithdrawalObject]]): Option[seq[Withdrawal]] =
if list.isNone:
return none(seq[Withdrawal])
some(toWithdrawals(list.get))

View File

@ -64,5 +64,6 @@ proc getPayloadV3*(ben: BeaconEngineRef, id: PayloadID): GetPayloadV3Response =
GetPayloadV3Response(
executionPayload: payload,
blockValue: blockValue,
blobsBundle: blobsBundle
blobsBundle: blobsBundle,
shouldOverrideBuilder: false
)

View File

@ -56,6 +56,7 @@ type
executionPayload*: ExecutionPayload
blockValue*: Option[UInt256]
blobsBundle*: Option[BlobsBundleV1]
shouldOverrideBuilder*: Option[bool]
Version* {.pure.} = enum
V1
@ -79,7 +80,7 @@ func version*(attr: PayloadAttributes): Version =
Version.V1
func version*(res: GetPayloadResponse): Version =
if res.blobsBundle.isSome:
if res.blobsBundle.isSome and res.shouldOverrideBuilder.isSome:
Version.V3
elif res.blockValue.isSome:
Version.V2
@ -349,5 +350,6 @@ func V3*(res: GetPayloadResponse): GetPayloadV3Response =
GetPayloadV3Response(
executionPayload: res.executionPayload.V3,
blockValue: res.blockValue.get,
blobsBundle: res.blobsBundle.get
blobsBundle: res.blobsBundle.get,
shouldOverrideBuilder: res.shouldOverrideBuilder.get
)

2
vendor/nim-web3 vendored

@ -1 +1 @@
Subproject commit 759c31439c5e01655bf0a8e8a47f6db010c7a5b8
Subproject commit b52a53e7a544850569002224f7bada07fb757ded