Compare commits
8 Commits
master
...
lash/cic-e
Author | SHA1 | Date | |
---|---|---|---|
|
86432f3073 | ||
|
a8e677f636 | ||
|
fca4e92cae | ||
|
77710636ee | ||
|
d4bb9eace3 | ||
|
139de9e102 | ||
|
b36ac33882 | ||
|
2c29dd56dc |
@ -1,6 +1,5 @@
|
||||
crypto-dev-signer>=0.4.15a1,<=0.4.15
|
||||
chainqueue>=0.0.3a1,<0.1.0
|
||||
confini>=0.3.6rc4,<0.5.0
|
||||
cic-eth-registry>=0.6.1a1,<0.7.0
|
||||
redis==3.5.3
|
||||
hexathon~=0.0.1a8
|
||||
|
@ -1,7 +1,7 @@
|
||||
# standard imports
|
||||
import semver
|
||||
|
||||
version = (0, 3, 0, 'alpha.10')
|
||||
version = (0, 3, 1, 'alpha.1')
|
||||
|
||||
version_object = semver.VersionInfo(
|
||||
major=version[0],
|
||||
|
@ -1,10 +1,10 @@
|
||||
alembic==1.4.2
|
||||
bcrypt==3.2.0
|
||||
celery==4.4.7
|
||||
cic-eth[services]==0.12.2a3
|
||||
cic-eth[services]~=0.12.4a3
|
||||
cic-notify~=0.4.0a10
|
||||
cic-types~=0.1.0a14
|
||||
confini~=0.4.1a1
|
||||
confini>=0.4.1a1,<0.5.0
|
||||
phonenumbers==8.12.12
|
||||
psycopg2==2.8.6
|
||||
python-i18n[YAML]==0.3.9
|
||||
|
@ -37,7 +37,8 @@ from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
|
||||
from crypto_dev_signer.keystore.dict import DictKeystore
|
||||
from cic_types.models.person import Person
|
||||
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_contract_registry import Registry
|
||||
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)
|
||||
o = erc20.decimals(self.token_address)
|
||||
r = conn.do(o)
|
||||
logg.debug('parse dec {}'.format(r))
|
||||
decimals = erc20.parse_decimals(r)
|
||||
multiplier = 10 ** decimals
|
||||
balance_full = balance * multiplier
|
||||
|
@ -205,8 +205,9 @@ def send_ussd_request(address, data_dir):
|
||||
|
||||
class VerifierState:
|
||||
|
||||
def __init__(self, item_keys, active_tests=None):
|
||||
def __init__(self, item_keys, target_count, active_tests=None):
|
||||
self.items = {}
|
||||
self.target_count = target_count
|
||||
for k in item_keys:
|
||||
self.items[k] = 0
|
||||
if active_tests == None:
|
||||
@ -223,7 +224,7 @@ class VerifierState:
|
||||
r = ''
|
||||
for k in self.items.keys():
|
||||
if k in self.active_tests:
|
||||
r += '{}: {}\n'.format(k, self.items[k])
|
||||
r += '{}: {}/{}\n'.format(k, self.items[k], self.target_count)
|
||||
else:
|
||||
r += '{}: skipped\n'.format(k)
|
||||
return r
|
||||
@ -244,7 +245,7 @@ class VerifierError(Exception):
|
||||
class Verifier:
|
||||
|
||||
# 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.gas_oracle = gas_oracle
|
||||
self.chain_spec = chain_spec
|
||||
@ -268,7 +269,7 @@ class Verifier:
|
||||
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))
|
||||
|
||||
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):
|
||||
@ -481,7 +482,7 @@ def main():
|
||||
|
||||
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')
|
||||
i = 0
|
||||
@ -517,6 +518,7 @@ def main():
|
||||
verifier.verify(new_address, balance, debug_stem=s)
|
||||
i += 1
|
||||
|
||||
print()
|
||||
print(verifier)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user