Skip to content

Commit 5e06787

Browse files
mkalininfradamt
andauthored
Apply suggestions by @fradamt
Co-authored-by: fradamt <[email protected]>
1 parent b665698 commit 5e06787

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def test_pending_consolidation_future_epoch(spec, state):
233233
assert state.balances[source_index] == expected_source_balance
234234
assert state.pending_consolidations == []
235235

236-
# Pending balance deposit to the target is created
236+
# Pending balance deposit to the target is created as part of `switch_to_compounding_validator`.
237+
# The excess balance to queue are the rewards accumulated over the previous epoch transitions.
237238
expected_pending_balance = state_before_consolidation.balances[target_index] - spec.MIN_ACTIVATION_BALANCE
238239
assert len(state.pending_balance_deposits) > 0
239240
pending_balance_deposit = state.pending_balance_deposits[len(state.pending_balance_deposits) - 1]
@@ -282,10 +283,13 @@ def test_pending_consolidation_compounding_creds(spec, state):
282283
== spec.COMPOUNDING_WITHDRAWAL_PREFIX
283284
)
284285
assert state.balances[target_index] == expected_target_balance
286+
# All source balance is active and moved to the target,
287+
# because the source validator has compounding credentials
285288
assert state.balances[source_index] == 0
286289
assert state.pending_consolidations == []
287290

288-
# Pending balance deposit to the target is not created
291+
# Pending balance deposit to the target is not created,
292+
# because the target already has compounding credentials
289293
assert len(state.pending_balance_deposits) == 0
290294

291295

@@ -337,7 +341,8 @@ def test_pending_consolidation_with_pending_deposit(spec, state):
337341
assert state.balances[source_index] == 0
338342
assert state.pending_consolidations == []
339343

340-
# Pending balance deposit to the source was not processed
344+
# Pending balance deposit to the source was not processed.
345+
# It should only be processed in the next epoch transition
341346
assert len(state.pending_balance_deposits) == 1
342347
assert state.pending_balance_deposits[0] == spec.PendingBalanceDeposit(
343348
index=source_index, amount=spec.MIN_ACTIVATION_BALANCE)

0 commit comments

Comments
 (0)