Compare commits
2 Commits
philip/sms
...
lash/fixtu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f951cc2f69 | ||
|
|
6a45d5faa7
|
@@ -1,4 +1,4 @@
|
|||||||
cic-base==0.1.3a3+build.984b5cff
|
cic-base==0.1.3a3+build.4aa03607
|
||||||
alembic==1.4.2
|
alembic==1.4.2
|
||||||
confini~=0.3.6rc3
|
confini~=0.3.6rc3
|
||||||
uwsgi==2.0.19.1
|
uwsgi==2.0.19.1
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ sqlparse==0.4.1
|
|||||||
pytest-celery==0.0.0a1
|
pytest-celery==0.0.0a1
|
||||||
eth_tester==0.5.0b3
|
eth_tester==0.5.0b3
|
||||||
py-evm==0.3.0a20
|
py-evm==0.3.0a20
|
||||||
cic_base[full]==0.1.3a3+build.984b5cff
|
cic_base[full]==0.1.3a3+build.4aa03607
|
||||||
sarafu-faucet~=0.0.4a1
|
sarafu-faucet~=0.0.4a1
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ version = (
|
|||||||
0,
|
0,
|
||||||
11,
|
11,
|
||||||
1,
|
1,
|
||||||
'alpha.3',
|
'alpha.2',
|
||||||
)
|
)
|
||||||
|
|
||||||
version_object = semver.VersionInfo(
|
version_object = semver.VersionInfo(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cic-base==0.1.3a3+build.984b5cff
|
cic-base==0.1.3a3+build.4aa03607
|
||||||
celery==4.4.7
|
celery==4.4.7
|
||||||
crypto-dev-signer~=0.4.14b6
|
crypto-dev-signer~=0.4.14b6
|
||||||
confini~=0.3.6rc3
|
confini~=0.3.6rc3
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
from cic_eth.pytest.fixtures_celery import *
|
from tests.fixtures_celery import *
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from chainlib.eth.tx import (
|
|||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from cic_eth.queue.tx import register_tx
|
from cic_eth.queue.tx import register_tx
|
||||||
from cic_eth.error import YouAreBrokeError
|
|
||||||
|
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
|
|
||||||
@@ -168,101 +167,3 @@ def test_erc20_approve_task(
|
|||||||
r = t.get_leaf()
|
r = t.get_leaf()
|
||||||
|
|
||||||
logg.debug('result {}'.format(r))
|
logg.debug('result {}'.format(r))
|
||||||
|
|
||||||
|
|
||||||
def test_erc20_transfer_from_task(
|
|
||||||
default_chain_spec,
|
|
||||||
foo_token,
|
|
||||||
agent_roles,
|
|
||||||
custodial_roles,
|
|
||||||
eth_signer,
|
|
||||||
eth_rpc,
|
|
||||||
init_database,
|
|
||||||
celery_session_worker,
|
|
||||||
token_roles,
|
|
||||||
):
|
|
||||||
|
|
||||||
token_object = {
|
|
||||||
'address': foo_token,
|
|
||||||
}
|
|
||||||
transfer_value = 100 * (10 ** 6)
|
|
||||||
|
|
||||||
nonce_oracle = RPCNonceOracle(token_roles['FOO_TOKEN_OWNER'], conn=eth_rpc)
|
|
||||||
c = ERC20(default_chain_spec, signer=eth_signer, nonce_oracle=nonce_oracle)
|
|
||||||
(tx_hash, o) = c.approve(foo_token, token_roles['FOO_TOKEN_OWNER'], agent_roles['ALICE'], transfer_value)
|
|
||||||
r = eth_rpc.do(o)
|
|
||||||
o = receipt(tx_hash)
|
|
||||||
r = eth_rpc.do(o)
|
|
||||||
assert r['status'] == 1
|
|
||||||
|
|
||||||
s_nonce = celery.signature(
|
|
||||||
'cic_eth.eth.nonce.reserve_nonce',
|
|
||||||
[
|
|
||||||
[token_object],
|
|
||||||
default_chain_spec.asdict(),
|
|
||||||
custodial_roles['FOO_TOKEN_GIFTER'],
|
|
||||||
],
|
|
||||||
queue=None,
|
|
||||||
)
|
|
||||||
s_transfer = celery.signature(
|
|
||||||
'cic_eth.eth.erc20.transfer_from',
|
|
||||||
[
|
|
||||||
custodial_roles['FOO_TOKEN_GIFTER'],
|
|
||||||
agent_roles['BOB'],
|
|
||||||
transfer_value,
|
|
||||||
default_chain_spec.asdict(),
|
|
||||||
agent_roles['ALICE'],
|
|
||||||
],
|
|
||||||
queue=None,
|
|
||||||
)
|
|
||||||
s_nonce.link(s_transfer)
|
|
||||||
t = s_nonce.apply_async()
|
|
||||||
r = t.get_leaf()
|
|
||||||
|
|
||||||
logg.debug('result {}'.format(r))
|
|
||||||
|
|
||||||
|
|
||||||
def test_erc20_allowance_check_task(
|
|
||||||
default_chain_spec,
|
|
||||||
foo_token,
|
|
||||||
agent_roles,
|
|
||||||
custodial_roles,
|
|
||||||
eth_signer,
|
|
||||||
eth_rpc,
|
|
||||||
init_database,
|
|
||||||
celery_session_worker,
|
|
||||||
token_roles,
|
|
||||||
):
|
|
||||||
|
|
||||||
token_object = {
|
|
||||||
'address': foo_token,
|
|
||||||
'symbol': 'FOO',
|
|
||||||
}
|
|
||||||
transfer_value = 100 * (10 ** 6)
|
|
||||||
|
|
||||||
s_check = celery.signature(
|
|
||||||
'cic_eth.eth.erc20.check_allowance',
|
|
||||||
[
|
|
||||||
[token_object],
|
|
||||||
custodial_roles['FOO_TOKEN_GIFTER'],
|
|
||||||
transfer_value,
|
|
||||||
default_chain_spec.asdict(),
|
|
||||||
agent_roles['ALICE']
|
|
||||||
],
|
|
||||||
queue=None,
|
|
||||||
)
|
|
||||||
t = s_check.apply_async()
|
|
||||||
with pytest.raises(YouAreBrokeError):
|
|
||||||
t.get()
|
|
||||||
|
|
||||||
nonce_oracle = RPCNonceOracle(token_roles['FOO_TOKEN_OWNER'], conn=eth_rpc)
|
|
||||||
c = ERC20(default_chain_spec, signer=eth_signer, nonce_oracle=nonce_oracle)
|
|
||||||
(tx_hash, o) = c.approve(foo_token, token_roles['FOO_TOKEN_OWNER'], agent_roles['ALICE'], transfer_value)
|
|
||||||
r = eth_rpc.do(o)
|
|
||||||
o = receipt(tx_hash)
|
|
||||||
r = eth_rpc.do(o)
|
|
||||||
assert r['status'] == 1
|
|
||||||
|
|
||||||
t = s_check.apply_async()
|
|
||||||
t.get()
|
|
||||||
assert t.successful()
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ elif args.v:
|
|||||||
config = confini.Config(args.c, args.env_prefix)
|
config = confini.Config(args.c, args.env_prefix)
|
||||||
config.process()
|
config.process()
|
||||||
config.add(args.q, '_CELERY_QUEUE', True)
|
config.add(args.q, '_CELERY_QUEUE', True)
|
||||||
config.censor('API_KEY', 'AFRICASTALKING')
|
|
||||||
config.censor('API_USERNAME', 'AFRICASTALKING')
|
|
||||||
config.censor('PASSWORD', 'DATABASE')
|
config.censor('PASSWORD', 'DATABASE')
|
||||||
logg.debug('config loaded from {}:\n{}'.format(args.c, config))
|
logg.debug('config loaded from {}:\n{}'.format(args.c, config))
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import semver
|
|||||||
|
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
|
|
||||||
version = (0, 4, 0, 'alpha.7')
|
version = (0, 4, 0, 'alpha.6')
|
||||||
|
|
||||||
version_object = semver.VersionInfo(
|
version_object = semver.VersionInfo(
|
||||||
major=version[0],
|
major=version[0],
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cic_base[full_graph]==0.1.3a3+build.984b5cff
|
cic_base[full_graph]==0.1.3a3+build.4aa03607
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cic_base[full_graph]==0.1.3a3+build.984b5cff
|
cic_base[full_graph]==0.1.3a3+build.4aa03607
|
||||||
cic-eth~=0.11.1a3
|
cic-eth~=0.11.1a2
|
||||||
cic-notify~=0.4.0a7
|
cic-notify~=0.4.0a6
|
||||||
cic-types~=0.1.0a11
|
cic-types~=0.1.0a11
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cic_base[full_graph]==0.1.3a3+build.984b5cff
|
cic_base[full_graph]==0.1.3a3+build.4aa03607
|
||||||
sarafu-faucet==0.0.4a1
|
sarafu-faucet==0.0.4a1
|
||||||
cic-eth==0.11.1a1
|
cic-eth==0.11.1a1
|
||||||
cic-types==0.1.0a13
|
cic-types==0.1.0a13
|
||||||
|
|||||||
@@ -254,10 +254,6 @@ class Verifier:
|
|||||||
if len(k) > 7 and k[:7] == 'verify_':
|
if len(k) > 7 and k[:7] == 'verify_':
|
||||||
logg.debug('verifier has verify method {}'.format(k))
|
logg.debug('verifier has verify method {}'.format(k))
|
||||||
verifymethods.append(k[7:])
|
verifymethods.append(k[7:])
|
||||||
o = self.faucet_tx_factory.token_amount(self.faucet_address, sender_address=ZERO_ADDRESS)
|
|
||||||
r = self.conn.do(o)
|
|
||||||
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, active_tests=active_tests)
|
||||||
|
|
||||||
@@ -288,7 +284,6 @@ class Verifier:
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
actual_balance = int(r)
|
actual_balance = int(r)
|
||||||
balance = int(balance / 1000000) * 1000000
|
balance = int(balance / 1000000) * 1000000
|
||||||
balance += self.faucet_amount
|
|
||||||
logg.debug('balance for {}: {}'.format(address, balance))
|
logg.debug('balance for {}: {}'.format(address, balance))
|
||||||
if balance != actual_balance:
|
if balance != actual_balance:
|
||||||
raise VerifierError((actual_balance, balance), 'balance')
|
raise VerifierError((actual_balance, balance), 'balance')
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cic-base==0.1.3a3+build.984b5cff
|
cic-base==0.1.3a3+build.4aa03607
|
||||||
|
|||||||
@@ -14,11 +14,8 @@ repos=(../../cic-cache ../../cic-eth ../../cic-ussd ../../data-seeding ../../cic
|
|||||||
for r in ${repos[@]}; do
|
for r in ${repos[@]}; do
|
||||||
f="$r/requirements.txt"
|
f="$r/requirements.txt"
|
||||||
>&2 echo updating $f
|
>&2 echo updating $f
|
||||||
pyreq-update $f base_requirement.txt -vv > $t
|
|
||||||
cp $t $f
|
|
||||||
|
|
||||||
f="$r/test_requirements.txt"
|
f="$r/test_requirements.txt"
|
||||||
>&2 echo updating $f
|
>&2 echo updating $f
|
||||||
pyreq-update $f base_requirement.txt -vv > $t
|
pyreq-update $f base_requirement.txt > $t
|
||||||
cp $t $f
|
cp $t $f
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user