Ethereum Test Fixtures package¶
Ethereum test fixture format definitions.
BaseFixture
¶
Bases: CamelModel
Represents a base Ethereum test fixture of any type.
Source code in src/ethereum_test_fixtures/base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
output_base_dir_name()
classmethod
¶
Returns the name of the subdirectory where this type of fixture should be dumped to.
Source code in src/ethereum_test_fixtures/base.py
26 27 28 29 30 31 |
|
json_dict: Dict[str, Any]
cached
property
¶
Returns the JSON representation of the fixture.
hash: str
cached
property
¶
Returns the hash of the fixture.
json_dict_with_info(hash_only=False)
¶
Returns the JSON representation of the fixture with the info field.
Source code in src/ethereum_test_fixtures/base.py
49 50 51 52 53 54 55 56 57 |
|
fill_info(t8n_version, test_case_description, fixture_source_url, ref_spec)
¶
Fill the info field for this fixture
Source code in src/ethereum_test_fixtures/base.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
get_fork()
¶
Returns the fork of the fixture as a string.
Source code in src/ethereum_test_fixtures/base.py
78 79 80 81 82 |
|
supports_fork(fork)
classmethod
¶
Returns whether the fixture can be generated for the given fork.
By default, all fixtures support all forks.
Source code in src/ethereum_test_fixtures/base.py
84 85 86 87 88 89 90 91 |
|
BlockchainEngineFixture
¶
Bases: FixtureCommon
Engine specific test fixture information.
Source code in src/ethereum_test_fixtures/blockchain.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
|
supports_fork(fork)
classmethod
¶
Returns whether the fixture can be generated for the given fork.
The Engine API is available only on Paris and afterwards.
Source code in src/ethereum_test_fixtures/blockchain.py
501 502 503 504 505 506 507 508 |
|
BlockchainFixture
¶
Bases: FixtureCommon
Cross-client specific blockchain test model use in JSON fixtures.
Source code in src/ethereum_test_fixtures/blockchain.py
475 476 477 478 479 480 481 482 483 484 485 |
|
BlockchainFixtureCommon
¶
Bases: BaseFixture
Base blockchain test fixture model.
Source code in src/ethereum_test_fixtures/blockchain.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
|
get_fork()
¶
Returns the fork of the fixture as a string.
Source code in src/ethereum_test_fixtures/blockchain.py
468 469 470 471 472 |
|
FixtureCollector
dataclass
¶
Collects all fixtures generated by the test cases.
Source code in src/ethereum_test_fixtures/collector.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
get_fixture_basename(info)
¶
Returns the basename of the fixture file for a given test case.
Source code in src/ethereum_test_fixtures/collector.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
add_fixture(info, fixture)
¶
Adds a fixture to the list of fixtures of a given test case.
Source code in src/ethereum_test_fixtures/collector.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
dump_fixtures()
¶
Dumps all collected fixtures to their respective files.
Source code in src/ethereum_test_fixtures/collector.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
verify_fixture_files(evm_fixture_verification)
¶
Runs evm [state|block]test
on each fixture.
Source code in src/ethereum_test_fixtures/collector.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
TestInfo
dataclass
¶
Contains test information from the current node.
Source code in src/ethereum_test_fixtures/collector.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
get_name_and_parameters()
¶
Converts a test name to a tuple containing the test name and test parameters.
Example: test_push0_key_sstore[fork_Shanghai] -> test_push0_key_sstore, fork_Shanghai
Source code in src/ethereum_test_fixtures/collector.py
59 60 61 62 63 64 65 66 67 |
|
get_single_test_name()
¶
Converts a test name to a single test name.
Source code in src/ethereum_test_fixtures/collector.py
69 70 71 72 73 74 |
|
get_dump_dir_path(base_dump_dir, filler_path, level='test_parameter')
¶
The path to dump the debug output as defined by the level to dump at.
Source code in src/ethereum_test_fixtures/collector.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
EOFFixture
¶
Bases: BaseFixture
Fixture for a single EOFTest.
Source code in src/ethereum_test_fixtures/eof.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
get_fork()
¶
Returns the fork of the fixture as a string.
Source code in src/ethereum_test_fixtures/eof.py
57 58 59 60 61 |
|
StateFixture
¶
Bases: BaseFixture
Fixture for a single StateTest.
Source code in src/ethereum_test_fixtures/state.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
get_fork()
¶
Returns the fork of the fixture as a string.
Source code in src/ethereum_test_fixtures/state.py
117 118 119 120 121 122 123 |
|
TransactionFixture
¶
Bases: BaseFixture
Fixture for a single TransactionTest.
Source code in src/ethereum_test_fixtures/transaction.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
get_fork()
¶
Returns the fork of the fixture as a string.
Source code in src/ethereum_test_fixtures/transaction.py
38 39 40 41 42 43 44 |
|
FixtureVerifier
¶
Bases: ABC
Abstract class for verifying Ethereum test fixtures.
Source code in src/ethereum_test_fixtures/verify.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
is_verifiable(fixture_format)
¶
Returns whether the fixture format is verifiable by this verifier.
Source code in src/ethereum_test_fixtures/verify.py
16 17 18 19 20 21 22 23 |
|
verify_fixture(fixture_format, fixture_path, fixture_name=None, debug_output_path=None)
abstractmethod
¶
Executes evm [state|block]test
to verify the fixture at fixture_path
.
Currently only implemented by geth's evm.
Source code in src/ethereum_test_fixtures/verify.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|