mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-13 13:55:45 +00:00
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:
parent
f433297631
commit
744e4f9739
@ -237,7 +237,7 @@ proc toTransactions(txs: openArray[JsonNode]): seq[Transaction] =
|
|||||||
for x in txs:
|
for x in txs:
|
||||||
result.add parseTransaction(x)
|
result.add parseTransaction(x)
|
||||||
|
|
||||||
proc toWithdrawal(wd: WithdrawalObject): Withdrawal =
|
proc toWithdrawal(wd: rpc_types.WithdrawalObject): Withdrawal =
|
||||||
Withdrawal(
|
Withdrawal(
|
||||||
index: hexToInt(string wd.index, uint64),
|
index: hexToInt(string wd.index, uint64),
|
||||||
validatorIndex: hexToInt(string wd.validatorIndex, uint64),
|
validatorIndex: hexToInt(string wd.validatorIndex, uint64),
|
||||||
@ -245,12 +245,12 @@ proc toWithdrawal(wd: WithdrawalObject): Withdrawal =
|
|||||||
amount: hexToInt(string wd.amount, uint64),
|
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)
|
result = newSeqOfCap[Withdrawal](list.len)
|
||||||
for wd in list:
|
for wd in list:
|
||||||
result.add toWithdrawal(wd)
|
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:
|
if list.isNone:
|
||||||
return none(seq[Withdrawal])
|
return none(seq[Withdrawal])
|
||||||
some(toWithdrawals(list.get))
|
some(toWithdrawals(list.get))
|
||||||
|
@ -64,5 +64,6 @@ proc getPayloadV3*(ben: BeaconEngineRef, id: PayloadID): GetPayloadV3Response =
|
|||||||
GetPayloadV3Response(
|
GetPayloadV3Response(
|
||||||
executionPayload: payload,
|
executionPayload: payload,
|
||||||
blockValue: blockValue,
|
blockValue: blockValue,
|
||||||
blobsBundle: blobsBundle
|
blobsBundle: blobsBundle,
|
||||||
|
shouldOverrideBuilder: false
|
||||||
)
|
)
|
||||||
|
@ -56,6 +56,7 @@ type
|
|||||||
executionPayload*: ExecutionPayload
|
executionPayload*: ExecutionPayload
|
||||||
blockValue*: Option[UInt256]
|
blockValue*: Option[UInt256]
|
||||||
blobsBundle*: Option[BlobsBundleV1]
|
blobsBundle*: Option[BlobsBundleV1]
|
||||||
|
shouldOverrideBuilder*: Option[bool]
|
||||||
|
|
||||||
Version* {.pure.} = enum
|
Version* {.pure.} = enum
|
||||||
V1
|
V1
|
||||||
@ -79,7 +80,7 @@ func version*(attr: PayloadAttributes): Version =
|
|||||||
Version.V1
|
Version.V1
|
||||||
|
|
||||||
func version*(res: GetPayloadResponse): Version =
|
func version*(res: GetPayloadResponse): Version =
|
||||||
if res.blobsBundle.isSome:
|
if res.blobsBundle.isSome and res.shouldOverrideBuilder.isSome:
|
||||||
Version.V3
|
Version.V3
|
||||||
elif res.blockValue.isSome:
|
elif res.blockValue.isSome:
|
||||||
Version.V2
|
Version.V2
|
||||||
@ -349,5 +350,6 @@ func V3*(res: GetPayloadResponse): GetPayloadV3Response =
|
|||||||
GetPayloadV3Response(
|
GetPayloadV3Response(
|
||||||
executionPayload: res.executionPayload.V3,
|
executionPayload: res.executionPayload.V3,
|
||||||
blockValue: res.blockValue.get,
|
blockValue: res.blockValue.get,
|
||||||
blobsBundle: res.blobsBundle.get
|
blobsBundle: res.blobsBundle.get,
|
||||||
|
shouldOverrideBuilder: res.shouldOverrideBuilder.get
|
||||||
)
|
)
|
||||||
|
2
vendor/nim-web3
vendored
2
vendor/nim-web3
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 759c31439c5e01655bf0a8e8a47f6db010c7a5b8
|
Subproject commit b52a53e7a544850569002224f7bada07fb757ded
|
Loading…
x
Reference in New Issue
Block a user