def fixture(fixture_data): fixture_path, fixture_key = fixture_data fixture = load_fixture( fixture_path, fixture_key, ) return fixture
def fixture(fixture_data): fixture_path, fixture_key = fixture_data fixture = load_fixture( fixture_path, fixture_key, normalize_vmtest_fixture, ) return fixture
def fixture(fixture_data): fixture_path, fixture_key, fixture_fork = fixture_data fixture = load_fixture( fixture_path, fixture_key, normalize_blockchain_fixtures, ) return fixture
def fixture(fixture_data): fixture_path, fixture_key, fixture_fork, post_state_index = fixture_data fixture = load_fixture( fixture_path, fixture_key, normalize_statetest_fixture(fork=fixture_fork, post_state_index=post_state_index), ) return fixture
def fixture(fixture_data): fixture_path, fixture_key, fixture_fork = fixture_data fixture = load_fixture( fixture_path, fixture_key, normalize_transactiontest_fixture(fork=fixture_fork), ) return fixture
def fixture(fixture_data): fixture_path, fixture_key = fixture_data fixture = load_fixture( fixture_path, fixture_key, normalize_blockchain_fixtures, ) if fixture['network'] == 'Constantinople': pytest.skip('Constantinople VM rules not yet supported') return fixture
def expand_fixtures_forks(all_fixtures): """ The transaction fixtures have different definitions for each fork and must be expanded one step further to have one fixture for each defined fork within the fixture. """ for fixture_path, fixture_key in all_fixtures: fixture = load_fixture(fixture_path, fixture_key) for fixture_fork, _ in fixture.items(): if fixture_fork not in FIXTURE_FORK_SKIPS: yield fixture_path, fixture_key, fixture_fork
def expand_fixtures_forks(all_fixtures): """ The statetest fixtures have different definitions for each fork and must be expanded one step further to have one fixture for each defined fork within the fixture. """ for fixture_path, fixture_key in all_fixtures: fixture = load_fixture(fixture_path, fixture_key) for fixture_fork, post_states in sorted(fixture['post'].items()): for post_state_index in range(len(post_states)): yield fixture_path, fixture_key, fixture_fork, post_state_index
async def test_eth_getTransactionReceipt(event_bus, tx_hash, fixture, expected_result): fixture_path = BASE_FIXTURE_PATH / fixture[0] chain_fixture = load_fixture(fixture_path, fixture[1]) rpc = await setup_rpc_server(event_bus, chain_fixture, fixture_path) await validate_accounts(rpc, chain_fixture['pre']) for block_fixture in chain_fixture['blocks']: block_result, block_error = await call_rpc(rpc, 'evm_applyBlockFixture', [block_fixture]) assert block_error is None assert block_result == block_fixture['rlp'] result, error = await call_rpc(rpc, 'eth_getTransactionReceipt', [tx_hash]) assert result == expected_result
def chain_fixture(fixture_data): fixture_path, fixture_key, fixture_fork = fixture_data fixture = load_fixture(fixture_path, fixture_key) if fixture_fork == 'Istanbul': pytest.skip('Istanbul VM rules not yet supported') return fixture
def expand_fixtures_forks(all_fixtures): for fixture_path, fixture_key in all_fixtures: fixture = load_fixture(fixture_path, fixture_key) yield fixture_path, fixture_key, fixture['network']
def chain_fixture(fixture_data): fixture_path, fixture_key, fixture_fork = fixture_data fixture = load_fixture(fixture_path, fixture_key) return fixture
def chain_fixture(fixture_data): fixture = load_fixture(*fixture_data) if fixture['network'] == 'Constantinople': pytest.skip('Constantinople VM rules not yet supported') return fixture