Merge branch 'lash/cic-eth-upgrade-more' into 'master'

Upgrade cic-ussd deps

See merge request grassrootseconomics/cic-internal-integration!247
This commit is contained in:
Louis Holbrook 2021-08-24 15:25:11 +00:00
commit 7684fe3883
5 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,5 @@
crypto-dev-signer>=0.4.15a1,<=0.4.15 crypto-dev-signer>=0.4.15a1,<=0.4.15
chainqueue>=0.0.3a1,<0.1.0 chainqueue>=0.0.3a1,<0.1.0
confini>=0.3.6rc4,<0.5.0
cic-eth-registry>=0.6.1a1,<0.7.0 cic-eth-registry>=0.6.1a1,<0.7.0
redis==3.5.3 redis==3.5.3
hexathon~=0.0.1a8 hexathon~=0.0.1a8

View File

@ -1,7 +1,7 @@
# standard imports # standard imports
import semver import semver
version = (0, 3, 0, 'alpha.10') version = (0, 3, 1, 'alpha.1')
version_object = semver.VersionInfo( version_object = semver.VersionInfo(
major=version[0], major=version[0],

View File

@ -1,10 +1,10 @@
alembic==1.4.2 alembic==1.4.2
bcrypt==3.2.0 bcrypt==3.2.0
celery==4.4.7 celery==4.4.7
cic-eth[services]==0.12.2a3 cic-eth[services]~=0.12.4a3
cic-notify~=0.4.0a10 cic-notify~=0.4.0a10
cic-types~=0.1.0a14 cic-types~=0.1.0a14
confini~=0.4.1a1 confini>=0.4.1a1,<0.5.0
phonenumbers==8.12.12 phonenumbers==8.12.12
psycopg2==2.8.6 psycopg2==2.8.6
python-i18n[YAML]==0.3.9 python-i18n[YAML]==0.3.9

View File

@ -37,7 +37,8 @@ from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
from crypto_dev_signer.keystore.dict import DictKeystore from crypto_dev_signer.keystore.dict import DictKeystore
from cic_types.models.person import Person from cic_types.models.person import Person
from eth_erc20 import ERC20 from eth_erc20 import ERC20
from cic_base.eth.syncer import chain_interface #from cic_base.eth.syncer import chain_interface
from cic_eth.cli.chain import chain_interface
from eth_accounts_index import AccountsIndex from eth_accounts_index import AccountsIndex
from eth_contract_registry import Registry from eth_contract_registry import Registry
from eth_token_index import TokenUniqueSymbolIndex from eth_token_index import TokenUniqueSymbolIndex
@ -172,6 +173,7 @@ class Handler:
erc20 = ERC20(self.chain_spec, signer=self.signer, gas_oracle=self.gas_oracle, nonce_oracle=self.nonce_oracle) erc20 = ERC20(self.chain_spec, signer=self.signer, gas_oracle=self.gas_oracle, nonce_oracle=self.nonce_oracle)
o = erc20.decimals(self.token_address) o = erc20.decimals(self.token_address)
r = conn.do(o) r = conn.do(o)
logg.debug('parse dec {}'.format(r))
decimals = erc20.parse_decimals(r) decimals = erc20.parse_decimals(r)
multiplier = 10 ** decimals multiplier = 10 ** decimals
balance_full = balance * multiplier balance_full = balance * multiplier

View File

@ -205,8 +205,9 @@ def send_ussd_request(address, data_dir):
class VerifierState: class VerifierState:
def __init__(self, item_keys, active_tests=None): def __init__(self, item_keys, target_count, active_tests=None):
self.items = {} self.items = {}
self.target_count = target_count
for k in item_keys: for k in item_keys:
self.items[k] = 0 self.items[k] = 0
if active_tests == None: if active_tests == None:
@ -223,7 +224,7 @@ class VerifierState:
r = '' r = ''
for k in self.items.keys(): for k in self.items.keys():
if k in self.active_tests: if k in self.active_tests:
r += '{}: {}\n'.format(k, self.items[k]) r += '{}: {}/{}\n'.format(k, self.items[k], self.target_count)
else: else:
r += '{}: skipped\n'.format(k) r += '{}: skipped\n'.format(k)
return r return r
@ -244,7 +245,7 @@ class VerifierError(Exception):
class Verifier: class Verifier:
# TODO: what an awful function signature # TODO: what an awful function signature
def __init__(self, conn, cic_eth_api, gas_oracle, chain_spec, index_address, token_address, faucet_address, data_dir, exit_on_error=False): def __init__(self, conn, target_count, cic_eth_api, gas_oracle, chain_spec, index_address, token_address, faucet_address, data_dir, exit_on_error=False):
self.conn = conn self.conn = conn
self.gas_oracle = gas_oracle self.gas_oracle = gas_oracle
self.chain_spec = chain_spec self.chain_spec = chain_spec
@ -268,7 +269,7 @@ class Verifier:
self.faucet_amount = self.faucet_tx_factory.parse_token_amount(r) self.faucet_amount = self.faucet_tx_factory.parse_token_amount(r)
logg.info('faucet amount set to {} at verify initialization time'.format(self.faucet_amount)) logg.info('faucet amount set to {} at verify initialization time'.format(self.faucet_amount))
self.state = VerifierState(verifymethods, active_tests=active_tests) self.state = VerifierState(verifymethods, target_count, active_tests=active_tests)
def verify_accounts_index(self, address, balance=None): def verify_accounts_index(self, address, balance=None):
@ -481,7 +482,7 @@ def main():
f.close() f.close()
verifier = Verifier(conn, api, gas_oracle, chain_spec, account_index_address, token_address, faucet_address, user_dir, exit_on_error) verifier = Verifier(conn, i, api, gas_oracle, chain_spec, account_index_address, token_address, faucet_address, user_dir, exit_on_error)
user_new_dir = os.path.join(user_dir, 'new') user_new_dir = os.path.join(user_dir, 'new')
i = 0 i = 0
@ -517,6 +518,7 @@ def main():
verifier.verify(new_address, balance, debug_stem=s) verifier.verify(new_address, balance, debug_stem=s)
i += 1 i += 1
print()
print(verifier) print(verifier)