mirror of
git://holbrook.no/eth-contract-registry
synced 2024-12-22 12:27:31 +01:00
Add default role in test fixture
This commit is contained in:
parent
286914eb0e
commit
e313638c7b
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user