2021-03-06 18:55:51 +01:00
|
|
|
# standard imports
|
2021-02-01 18:12:51 +01:00
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
|
2021-03-06 18:55:51 +01:00
|
|
|
# external imports
|
|
|
|
import pytest
|
2021-02-01 18:12:51 +01:00
|
|
|
import celery
|
|
|
|
|
2021-03-06 18:55:51 +01:00
|
|
|
# local imports
|
2021-02-01 18:12:51 +01:00
|
|
|
from cic_eth.db import TxConvertTransfer
|
|
|
|
from cic_eth.eth.bancor import BancorTxFactory
|
|
|
|
|
|
|
|
logg = logging.getLogger()
|
|
|
|
|
|
|
|
|
2021-03-06 18:55:51 +01:00
|
|
|
@pytest.mark.skip()
|
2021-02-01 18:12:51 +01:00
|
|
|
def test_transfer_after_convert(
|
|
|
|
init_w3,
|
|
|
|
init_database,
|
|
|
|
cic_registry,
|
|
|
|
bancor_tokens,
|
|
|
|
bancor_registry,
|
|
|
|
default_chain_spec,
|
|
|
|
celery_session_worker,
|
|
|
|
):
|
|
|
|
|
|
|
|
tx_hash = os.urandom(32).hex()
|
|
|
|
txct = TxConvertTransfer(tx_hash, init_w3.eth.accounts[1], default_chain_spec)
|
|
|
|
init_database.add(txct)
|
|
|
|
init_database.commit()
|
|
|
|
|
|
|
|
s = celery.signature(
|
|
|
|
'cic_eth.eth.bancor.transfer_converted',
|
|
|
|
[
|
|
|
|
[
|
|
|
|
{
|
|
|
|
'address': bancor_tokens[0],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
init_w3.eth.accounts[0],
|
|
|
|
init_w3.eth.accounts[1],
|
|
|
|
1024,
|
|
|
|
tx_hash,
|
|
|
|
str(default_chain_spec),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
t = s.apply_async()
|
|
|
|
t.get()
|
|
|
|
t.collect()
|
|
|
|
assert t.successful()
|