WIP receive new registry

This commit is contained in:
nolash 2021-03-13 21:31:37 +01:00
parent e20a099570
commit a6fd20124c
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 25 additions and 1 deletions

View File

@ -23,3 +23,4 @@ chainlib~=0.0.1a25
hexathon~=0.0.1a3 hexathon~=0.0.1a3
chainsyncer~=0.0.1a19 chainsyncer~=0.0.1a19
pysha3==1.0.2 pysha3==1.0.2
coincurve==15.0.0

View File

@ -1,13 +1,14 @@
# standard imports # standard imports
import os import os
import sys import sys
import logging
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
root_dir = os.path.dirname(script_dir) root_dir = os.path.dirname(script_dir)
sys.path.insert(0, root_dir) sys.path.insert(0, root_dir)
from tests.fixtures_config import * from tests.fixtures_config import *
from tests.fixtures_chainlib import *
from tests.fixtures_celery import * from tests.fixtures_celery import *
from tests.fixtures_database import * from tests.fixtures_database import *
from tests.fixtures_registry import * from tests.fixtures_registry import *
from chainlib.pytest.fixtures_ethtester import *

View File

@ -1,7 +1,29 @@
# external imports # external imports
import pytest import pytest
from cic_registry import CICRegistry
from chainlib.chain import ChainSpec from chainlib.chain import ChainSpec
from eth_accounts_index import AccountRegistry
@pytest.fixture(scope='session') @pytest.fixture(scope='session')
def default_chain_spec(): def default_chain_spec():
return ChainSpec('evm', 'bloxberg', 8996) 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