WIP receive new registry
This commit is contained in:
parent
e20a099570
commit
a6fd20124c
@ -23,3 +23,4 @@ chainlib~=0.0.1a25
|
||||
hexathon~=0.0.1a3
|
||||
chainsyncer~=0.0.1a19
|
||||
pysha3==1.0.2
|
||||
coincurve==15.0.0
|
||||
|
@ -1,13 +1,14 @@
|
||||
# standard imports
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
root_dir = os.path.dirname(script_dir)
|
||||
sys.path.insert(0, root_dir)
|
||||
|
||||
from tests.fixtures_config import *
|
||||
from tests.fixtures_chainlib import *
|
||||
from tests.fixtures_celery import *
|
||||
from tests.fixtures_database import *
|
||||
from tests.fixtures_registry import *
|
||||
from chainlib.pytest.fixtures_ethtester import *
|
||||
|
@ -1,7 +1,29 @@
|
||||
# external imports
|
||||
import pytest
|
||||
from cic_registry import CICRegistry
|
||||
from chainlib.chain import ChainSpec
|
||||
from eth_accounts_index import AccountRegistry
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def default_chain_spec():
|
||||
return ChainSpec('evm', 'bloxberg', 8996)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def accounts_registry(
|
||||
default_chain_spec,
|
||||
cic_registry,
|
||||
):
|
||||
#abi = AccountRegistry.abi()
|
||||
#constructor = w3.eth.contract(abi=abi, bytecode=AccountRegistry.bytecode())
|
||||
#tx_hash = constructor.constructor().transact()
|
||||
r = w3.eth.getTransactionReceipt(tx_hash)
|
||||
logg.debug('accounts registry deployed {}'.format(r.contractAddress))
|
||||
account_registry = AccountRegistry(w3, r.contractAddress)
|
||||
|
||||
c = w3.eth.contract(abi=abi, address=r.contractAddress)
|
||||
c.functions.addWriter(w3.eth.accounts[0]).transact()
|
||||
|
||||
CICRegistry.add_contract(default_chain_spec, c, 'AccountRegistry')
|
||||
|
||||
return account_registry
|
||||
|
Loading…
Reference in New Issue
Block a user