Skip to content

Commit

Permalink
rename depositReceipts/exits to depositRequests/withdrawalRequests
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed May 16, 2024
1 parent 5610e21 commit 9aed14a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/test_execution_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ suite "Execution types tests":
check bad42.version == Version.V4

let v41 = bad41.V4
check v41.depositReceipts == newSeq[DepositReceiptV1]()
check v41.exits == v4.exits.get
check v41.depositRequests == newSeq[DepositReceiptV1]()
check v41.withdrawalRequests == v4.exits.get

let v42 = bad42.V4
check v42.depositReceipts == v4.depositReceipts.get
check v42.exits == newSeq[WithdrawalRequestV1]()
check v42.depositRequests == v4.depositReceipts.get
check v42.withdrawalRequests == newSeq[WithdrawalRequestV1]()

# roundtrip
let v4p = v4.V4
Expand Down
9 changes: 7 additions & 2 deletions web3/engine_api_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ type
withdrawals*: seq[WithdrawalV1]
blobGasUsed*: Quantity
excessBlobGas*: Quantity
depositReceipts*: seq[DepositReceiptV1]
exits*: seq[WithdrawalRequestV1]

# https://github.com/ethereum/consensus-specs/pull/3757
# https://github.com/ethereum/execution-apis/pull/544
# mainly for devnet-0
depositRequests*: seq[DepositReceiptV1]

withdrawalRequests*: seq[WithdrawalRequestV1]

SomeExecutionPayload* =
ExecutionPayloadV1 |
Expand Down
8 changes: 4 additions & 4 deletions web3/execution_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ func V4*(p: ExecutionPayload): ExecutionPayloadV4 =
withdrawals: p.withdrawals.get,
blobGasUsed: p.blobGasUsed.get(0.Quantity),
excessBlobGas: p.excessBlobGas.get(0.Quantity),
depositReceipts: p.depositReceipts.get(newSeq[DepositReceiptV1]()),
exits: p.exits.get(newSeq[WithdrawalRequestV1]())
depositRequests: p.depositReceipts.get(newSeq[DepositReceiptV1]()),
withdrawalRequests: p.exits.get(newSeq[WithdrawalRequestV1]())
)

func V1*(p: ExecutionPayloadV1OrV2): ExecutionPayloadV1 =
Expand Down Expand Up @@ -390,8 +390,8 @@ func executionPayload*(p: ExecutionPayloadV4): ExecutionPayload =
withdrawals: some(p.withdrawals),
blobGasUsed: some(p.blobGasUsed),
excessBlobGas: some(p.excessBlobGas),
depositReceipts: some(p.depositReceipts),
exits: some(p.exits)
depositReceipts: some(p.depositRequests),
exits: some(p.withdrawalRequests)
)

func executionPayload*(p: ExecutionPayloadV1OrV2): ExecutionPayload =
Expand Down

0 comments on commit 9aed14a

Please sign in to comment.