[EIP-7251] rename PartialWithdrawal field

This commit is contained in:
Paul Harris 2024-04-02 15:43:28 +10:00
parent a2c4c273f0
commit 4606ab43e5
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@
- [Containers](#containers) - [Containers](#containers)
- [New containers](#new-containers) - [New containers](#new-containers)
- [New `PendingBalanceDeposit`](#new-pendingbalancedeposit) - [New `PendingBalanceDeposit`](#new-pendingbalancedeposit)
- [New `PartialWithdrawal`](#new-partialwithdrawal) - [New `PendingPartialWithdrawal`](#new-pendingPartialWithdrawal)
- [New `ExecutionLayerWithdrawRequest`](#new-executionlayerwithdrawrequest) - [New `ExecutionLayerWithdrawRequest`](#new-executionlayerwithdrawrequest)
- [New `Consolidation`](#new-consolidation) - [New `Consolidation`](#new-consolidation)
- [New `SignedConsolidation`](#new-signedconsolidation) - [New `SignedConsolidation`](#new-signedconsolidation)
@ -160,10 +160,10 @@ class PendingBalanceDeposit(Container):
amount: Gwei amount: Gwei
``` ```
#### New `PartialWithdrawal` #### New `PendingPartialWithdrawal`
```python ```python
class PartialWithdrawal(Container): class PendingPartialWithdrawal(Container):
index: ValidatorIndex index: ValidatorIndex
amount: Gwei amount: Gwei
withdrawable_epoch: Epoch withdrawable_epoch: Epoch
@ -254,7 +254,7 @@ class BeaconState(Container):
consolidation_balance_to_consume: Gwei # [New in EIP-7251] consolidation_balance_to_consume: Gwei # [New in EIP-7251]
earliest_consolidation_epoch: Epoch # [New in EIP-7251] earliest_consolidation_epoch: Epoch # [New in EIP-7251]
pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] # [New in EIP-7251] pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] # [New in EIP-7251]
pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] # [New in EIP-7251] pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] # [New in EIP-7251]
pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] # [New in EIP-7251] pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] # [New in EIP-7251]
``` ```
@ -904,7 +904,7 @@ def process_execution_layer_withdraw_request(
) )
exit_queue_epoch = compute_exit_epoch_and_update_churn(state, to_withdraw) exit_queue_epoch = compute_exit_epoch_and_update_churn(state, to_withdraw)
withdrawable_epoch = Epoch(exit_queue_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) withdrawable_epoch = Epoch(exit_queue_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY)
state.pending_partial_withdrawals.append(PartialWithdrawal( state.pending_partial_withdrawals.append(PendingPartialWithdrawal(
index=index, index=index,
amount=to_withdraw, amount=to_withdraw,
withdrawable_epoch=withdrawable_epoch, withdrawable_epoch=withdrawable_epoch,

View File

@ -154,7 +154,7 @@ def test_partial_withdrawal_queue_full(spec, state):
amount=10 ** 9, amount=10 ** 9,
) )
partial_withdrawal = spec.PartialWithdrawal(index=0, amount=1, withdrawable_epoch=current_epoch) partial_withdrawal = spec.PendingPartialWithdrawal(index=0, amount=1, withdrawable_epoch=current_epoch)
state.pending_partial_withdrawals = [partial_withdrawal] * spec.PENDING_PARTIAL_WITHDRAWALS_LIMIT state.pending_partial_withdrawals = [partial_withdrawal] * spec.PENDING_PARTIAL_WITHDRAWALS_LIMIT
yield from run_execution_layer_withdraw_request_processing( yield from run_execution_layer_withdraw_request_processing(
spec, state, execution_layer_withdraw_request, success=False spec, state, execution_layer_withdraw_request, success=False