rename ExitV1 to WithdrawalRequestV1 (#147)

This commit is contained in:
tersec 2024-05-15 04:12:34 +03:00 committed by GitHub
parent a00b28a0ce
commit 5610e21dcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 14 deletions

View File

@ -72,7 +72,7 @@ suite "Execution types tests":
index: 9.Quantity
)
exit = ExitV1(
exit = WithdrawalRequestV1(
sourceAddress: address(7),
validatorPublicKey: FixedBytes[48].conv(9)
)
@ -176,7 +176,7 @@ suite "Execution types tests":
check bad41.version == Version.V4
var bad42 = v4
bad42.exits = none(seq[ExitV1])
bad42.exits = none(seq[WithdrawalRequestV1])
check bad42.version == Version.V4
let v41 = bad41.V4
@ -185,7 +185,7 @@ suite "Execution types tests":
let v42 = bad42.V4
check v42.depositReceipts == v4.depositReceipts.get
check v42.exits == newSeq[ExitV1]()
check v42.exits == newSeq[WithdrawalRequestV1]()
# roundtrip
let v4p = v4.V4
@ -198,4 +198,4 @@ suite "Execution types tests":
# response roundtrip
let rv3p = resv4.V4
check rv3p == rv3p.getPayloadResponse.V4
check rv3p == rv3p.getPayloadResponse.V4

View File

@ -55,7 +55,7 @@ derefType(ReceiptObject).useDefaultSerializationIn JrpcConv
WithdrawalV1.useDefaultSerializationIn JrpcConv
DepositReceiptV1.useDefaultSerializationIn JrpcConv
ExitV1.useDefaultSerializationIn JrpcConv
WithdrawalRequestV1.useDefaultSerializationIn JrpcConv
ExecutionPayloadV1.useDefaultSerializationIn JrpcConv
ExecutionPayloadV2.useDefaultSerializationIn JrpcConv
ExecutionPayloadV1OrV2.useDefaultSerializationIn JrpcConv

View File

@ -25,7 +25,7 @@ type
address*: Address
amount*: Quantity
# https://github.com/ethereum/execution-apis/blob/90a46e9137c89d58e818e62fa33a0347bba50085/src/engine/prague.md#depositreceiptv1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/prague.md#depositrequestv1
DepositReceiptV1* = object
pubkey*: FixedBytes[48]
withdrawalCredentials*: FixedBytes[32]
@ -33,10 +33,11 @@ type
signature*: FixedBytes[96]
index*: Quantity
# https://github.com/ethereum/execution-apis/blob/90a46e9137c89d58e818e62fa33a0347bba50085/src/engine/prague.md#exitv1
ExitV1* = object
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/prague.md#withdrawalrequestv1
WithdrawalRequestV1* = object
sourceAddress*: Address
validatorPublicKey*: FixedBytes[48]
amount*: Quantity
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#executionpayloadv1
ExecutionPayloadV1* = object
@ -123,7 +124,7 @@ type
blobGasUsed*: Quantity
excessBlobGas*: Quantity
# https://github.com/ethereum/execution-apis/blob/90a46e9137c89d58e818e62fa33a0347bba50085/src/engine/prague.md#executionpayloadv4
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/prague.md#executionpayloadv4
ExecutionPayloadV4* = object
parentHash*: Hash256
feeRecipient*: Address
@ -143,7 +144,7 @@ type
blobGasUsed*: Quantity
excessBlobGas*: Quantity
depositReceipts*: seq[DepositReceiptV1]
exits*: seq[ExitV1]
exits*: seq[WithdrawalRequestV1]
SomeExecutionPayload* =
ExecutionPayloadV1 |

View File

@ -35,7 +35,7 @@ type
blobGasUsed*: Option[Quantity]
excessBlobGas*: Option[Quantity]
depositReceipts*: Option[seq[DepositReceiptV1]]
exits*: Option[seq[ExitV1]]
exits*: Option[seq[WithdrawalRequestV1]]
PayloadAttributes* = object
timestamp*: Quantity
@ -273,7 +273,7 @@ func V4*(p: ExecutionPayload): ExecutionPayloadV4 =
blobGasUsed: p.blobGasUsed.get(0.Quantity),
excessBlobGas: p.excessBlobGas.get(0.Quantity),
depositReceipts: p.depositReceipts.get(newSeq[DepositReceiptV1]()),
exits: p.exits.get(newSeq[ExitV1]())
exits: p.exits.get(newSeq[WithdrawalRequestV1]())
)
func V1*(p: ExecutionPayloadV1OrV2): ExecutionPayloadV1 =
@ -461,5 +461,4 @@ func getPayloadResponse*(x: GetPayloadV4Response): GetPayloadResponse =
blockValue: some(x.blockValue),
blobsBundle: some(x.blobsBundle),
shouldOverrideBuilder: some(x.shouldOverrideBuilder)
)
)