contract-registry

Ethereum Smart Contract key-value registry
Log | Files | Refs

commit e313638c7bdfea851fc7a816dbdd91d8f40f1de6
parent 286914eb0ef2707802bd64a5fcd9611c190dc6f8
Author: nolash <dev@holbrook.no>
Date:   Sun, 21 Mar 2021 14:02:39 +0100

Add default role in test fixture

Diffstat:
Mpython/contract_registry/pytest/fixtures_registry.py | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/python/contract_registry/pytest/fixtures_registry.py b/python/contract_registry/pytest/fixtures_registry.py @@ -14,7 +14,8 @@ from chainlib.eth.nonce import RPCNonceOracle from contract_registry.registry import Registry from contract_registry.encoding import to_identifier -logg = logging.getLogger(__name__) +#logg = logging.getLogger(__name__) +logg = logging.getLogger() valid_identifiers = [ 'ContractRegistry', @@ -26,9 +27,11 @@ def roles( eth_accounts, ): return { - 'CONTRACT_DEPLOYER': eth_accounts[0], + 'DEFAULT': eth_accounts[0], + 'CONTRACT_DEPLOYER': eth_accounts[1], } + @pytest.fixture(scope='function') def registry( default_chain_spec, @@ -43,13 +46,12 @@ def registry( nonce_oracle = RPCNonceOracle(roles['CONTRACT_DEPLOYER'], eth_rpc) builder = Registry(signer=eth_signer, nonce_oracle=nonce_oracle) + logg.info('registering identifiers {} in contract registry'.format(valid_identifiers)) (tx_hash_hex, o) = builder.constructor(roles['CONTRACT_DEPLOYER'], valid_identifiers) r = eth_rpc.do(o) - logg.debug('r {}'.format(r)) o = receipt(r) rcpt = eth_rpc.do(o) - assert rcpt['status'] == 1 registry_address = rcpt['contract_address']