-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
verify intermidiate block state in blockchain test
- Loading branch information
Showing
4 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Test examples, patterns, templates to use in .py tests.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Test the SELFDESTRUCT opcode.""" | ||
|
||
import pytest | ||
|
||
from ethereum_test_tools import ( | ||
Account, | ||
Alloc, | ||
Block, | ||
BlockchainTestFiller, | ||
Environment, | ||
Transaction, | ||
) | ||
|
||
|
||
@pytest.mark.valid_from("Frontier") | ||
@pytest.mark.valid_until("Homestead") | ||
def test_block_intermidiate_state(blockchain_test: BlockchainTestFiller, pre: Alloc): | ||
"""Verify intermidiate block states.""" | ||
env = Environment() | ||
sender = pre.fund_eoa() | ||
|
||
tx = Transaction(gas_limit=100_000, to=None, data=b"", sender=sender) | ||
tx_2 = Transaction(gas_limit=100_000, to=None, data=b"", sender=sender) | ||
|
||
block_1 = Block( | ||
txs=[tx], | ||
expected_post_state={ | ||
sender: Account( | ||
nonce=1, | ||
), | ||
}, | ||
) | ||
|
||
block_2 = Block(txs=[]) | ||
|
||
block_3 = Block( | ||
txs=[tx_2], | ||
expected_post_state={ | ||
sender: Account( | ||
nonce=2, | ||
), | ||
}, | ||
) | ||
|
||
blockchain_test( | ||
genesis_environment=env, | ||
pre=pre, | ||
post=block_3.expected_post_state, | ||
blocks=[block_1, block_2, block_3], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,7 @@ isort | |
isort's | ||
ispkg | ||
itemName | ||
intermidiate | ||
javascripts | ||
jimporter | ||
joinpath | ||
|