# standard imports import logging # external imports import pytest from chainlib.connection import RPCConnection from chainlib.eth.tx import receipt # local imports from contract_registry.registry import Registry logg = logging.getLogger(__name__) valid_identifiers = [ 'ContractRegistry', ] @pytest.fixture(scope='function') def registry( default_chain_spec, init_eth_tester, init_eth_rpc, eth_accounts, ): conn = RPCConnection.connect(default_chain_spec, 'default') builder = Registry(signer=conn.signer) (tx_hash_hex, o) = builder.constructor(eth_accounts[0], valid_identifiers) r = conn.do(o) logg.debug('r {}'.format(r)) o = receipt(r) rcpt = conn.do(o) assert rcpt['status'] == 1 return rcpt['contract_address']