Skip to content

Commit abee0f4

Browse files
committed
feat(test): Better describe the BAL for selfdestruct revert
1 parent e927a67 commit abee0f4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
Alloc,
1111
BalAccountExpectation,
1212
BalBalanceChange,
13+
BalCodeChange,
14+
BalNonceChange,
15+
BalStorageChange,
16+
BalStorageSlot,
1317
BlockAccessListExpectation,
1418
Bytecode,
1519
Environment,
@@ -458,6 +462,31 @@ def test_selfdestruct_created_in_same_tx_with_revert( # noqa SC200
458462
],
459463
)
460464
)
465+
else:
466+
account_expectations[
467+
selfdestruct_with_transfer_contract_address
468+
] = BalAccountExpectation(
469+
storage_reads=[1],
470+
nonce_changes=[BalNonceChange(tx_index=1, post_nonce=1)],
471+
balance_changes=[BalBalanceChange(tx_index=1, post_balance=1)],
472+
code_changes=[
473+
BalCodeChange(
474+
tx_index=1,
475+
new_code=selfdestruct_with_transfer_contract_code,
476+
),
477+
],
478+
storage_changes=[
479+
BalStorageSlot(
480+
slot=0,
481+
slot_changes=[
482+
BalStorageChange(tx_index=1, post_value=1),
483+
],
484+
),
485+
],
486+
)
487+
account_expectations[selfdestruct_recipient_address] = (
488+
BalAccountExpectation.empty()
489+
)
461490

462491
expected_block_access_list = BlockAccessListExpectation(
463492
account_expectations=account_expectations

0 commit comments

Comments
 (0)