refactor: Improve cic-cache
This commit is contained in:
@@ -288,7 +288,6 @@ def test_fix_nonce(
|
||||
|
||||
init_database.commit()
|
||||
|
||||
logg.debug('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
||||
txs = get_nonce_tx_local(default_chain_spec, 3, agent_roles['ALICE'], session=init_database)
|
||||
ks = txs.keys()
|
||||
assert len(ks) == 2
|
||||
|
||||
@@ -191,11 +191,17 @@ def test_tokens(
|
||||
break
|
||||
|
||||
api_param = str(uuid.uuid4())
|
||||
fp = os.path.join(CallbackTask.mmap_path, api_param)
|
||||
f = open(fp, 'wb+')
|
||||
f.write(b'\x00')
|
||||
f.close()
|
||||
|
||||
api = Api(str(default_chain_spec), queue=None, callback_param=api_param, callback_task='cic_eth.pytest.mock.callback.test_callback')
|
||||
t = api.tokens(['BAR'], proof=[[bar_token_declaration]])
|
||||
r = t.get()
|
||||
logg.debug('rr {} {}'.format(r, t.children))
|
||||
|
||||
|
||||
while True:
|
||||
fp = os.path.join(CallbackTask.mmap_path, api_param)
|
||||
try:
|
||||
|
||||
@@ -35,10 +35,26 @@ from hexathon import strip_0x
|
||||
from cic_eth.eth.gas import cache_gas_data
|
||||
from cic_eth.error import OutOfGasError
|
||||
from cic_eth.queue.tx import queue_create
|
||||
from cic_eth.task import BaseTask
|
||||
|
||||
logg = logging.getLogger()
|
||||
|
||||
|
||||
def test_task_gas_limit(
|
||||
eth_rpc,
|
||||
eth_signer,
|
||||
default_chain_spec,
|
||||
agent_roles,
|
||||
celery_session_worker,
|
||||
):
|
||||
rpc = RPCConnection.connect(default_chain_spec, 'default')
|
||||
gas_oracle = BaseTask().create_gas_oracle(rpc)
|
||||
c = Gas(default_chain_spec, signer=eth_signer, gas_oracle=gas_oracle)
|
||||
(tx_hash_hex, o) = c.create(agent_roles['ALICE'], agent_roles['BOB'], 10, tx_format=TxFormat.RLP_SIGNED)
|
||||
tx = unpack(bytes.fromhex(strip_0x(o)), default_chain_spec)
|
||||
assert (tx['gas'], BaseTask.min_fee_price)
|
||||
|
||||
|
||||
def test_task_check_gas_ok(
|
||||
default_chain_spec,
|
||||
eth_rpc,
|
||||
|
||||
Reference in New Issue
Block a user