From e7765d5f1803a1cd43dda429e95a3fc728e2dd44 Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 3 Jun 2021 15:35:35 +0200 Subject: [PATCH] Remove remaining stale chainqueue includes --- apps/cic-eth/cic_eth/api/api_admin.py | 2 +- apps/cic-eth/cic_eth/queue/query.py | 12 +++++----- apps/cic-eth/cic_eth/queue/state.py | 22 +++++++++---------- .../cic_eth/runnable/daemons/filters/gas.py | 2 +- .../runnable/daemons/filters/straggler.py | 2 +- apps/cic-eth/tests/filters/test_gas_filter.py | 4 ++-- .../tests/filters/test_register_filter.py | 2 +- .../tests/filters/test_straggler_filter.py | 4 ++-- .../tests/filters/test_transferauth_filter.py | 2 +- apps/cic-eth/tests/filters/test_tx_filter.py | 4 ++-- apps/cic-eth/tests/task/api/test_admin.py | 4 ++-- .../tests/task/api/test_admin_noncritical.py | 6 ++--- apps/cic-eth/tests/task/api/test_app.py | 2 +- apps/cic-eth/tests/task/test_task_admin.py | 4 ++-- apps/cic-eth/tests/task/test_task_gas.py | 6 ++--- apps/cic-eth/tests/task/test_task_tx.py | 4 ++-- apps/cic-eth/tests/task/test_task_tx_misc.py | 4 ++-- 17 files changed, 43 insertions(+), 43 deletions(-) diff --git a/apps/cic-eth/cic_eth/api/api_admin.py b/apps/cic-eth/cic_eth/api/api_admin.py index 519262c7..c5c1e142 100644 --- a/apps/cic-eth/cic_eth/api/api_admin.py +++ b/apps/cic-eth/cic_eth/api/api_admin.py @@ -31,7 +31,7 @@ from chainqueue.db.enum import ( status_str, ) from chainqueue.error import TxStateChangeError -from chainqueue.query import get_tx +from chainqueue.sql.query import get_tx from eth_erc20 import ERC20 # local imports diff --git a/apps/cic-eth/cic_eth/queue/query.py b/apps/cic-eth/cic_eth/queue/query.py index 40dcfbeb..9ce3a17f 100644 --- a/apps/cic-eth/cic_eth/queue/query.py +++ b/apps/cic-eth/cic_eth/queue/query.py @@ -28,7 +28,7 @@ celery_app = celery.current_app def get_tx_cache(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.query.get_tx_cache(chain_spec, tx_hash, session=session) + r = chainqueue.sql.query.get_tx_cache(chain_spec, tx_hash, session=session) session.close() return r @@ -37,7 +37,7 @@ def get_tx_cache(chain_spec_dict, tx_hash): def get_tx(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.query.get_tx(chain_spec, tx_hash, session=session) + r = chainqueue.sql.query.get_tx(chain_spec, tx_hash, session=session) session.close() return r @@ -46,7 +46,7 @@ def get_tx(chain_spec_dict, tx_hash): def get_account_tx(chain_spec_dict, address, as_sender=True, as_recipient=True, counterpart=None): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.query.get_account_tx(chain_spec, address, as_sender=True, as_recipient=True, counterpart=None, session=session) + r = chainqueue.sql.query.get_account_tx(chain_spec, address, as_sender=True, as_recipient=True, counterpart=None, session=session) session.close() return r @@ -55,17 +55,17 @@ def get_account_tx(chain_spec_dict, address, as_sender=True, as_recipient=True, def get_upcoming_tx_nolock(chain_spec_dict, status=StatusEnum.READYSEND, not_status=None, recipient=None, before=None, limit=0, session=None): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.query.get_upcoming_tx(chain_spec, status, not_status=not_status, recipient=recipient, before=before, limit=limit, session=session, decoder=unpack) + r = chainqueue.sql.query.get_upcoming_tx(chain_spec, status, not_status=not_status, recipient=recipient, before=before, limit=limit, session=session, decoder=unpack) session.close() return r def get_status_tx(chain_spec, status, not_status=None, before=None, exact=False, limit=0, session=None): - return chainqueue.query.get_status_tx_cache(chain_spec, status, not_status=not_status, before=before, exact=exact, limit=limit, session=session, decoder=unpack) + return chainqueue.sql.query.get_status_tx_cache(chain_spec, status, not_status=not_status, before=before, exact=exact, limit=limit, session=session, decoder=unpack) def get_paused_tx(chain_spec, status=None, sender=None, session=None, decoder=None): - return chainqueue.query.get_paused_tx_cache(chain_spec, status=status, sender=sender, session=session, decoder=unpack) + return chainqueue.sql.query.get_paused_tx_cache(chain_spec, status=status, sender=sender, session=session, decoder=unpack) def get_nonce_tx(chain_spec, nonce, sender): diff --git a/apps/cic-eth/cic_eth/queue/state.py b/apps/cic-eth/cic_eth/queue/state.py index b97eaa1e..72bd505d 100644 --- a/apps/cic-eth/cic_eth/queue/state.py +++ b/apps/cic-eth/cic_eth/queue/state.py @@ -14,7 +14,7 @@ celery_app = celery.current_app def set_sent(chain_spec_dict, tx_hash, fail=False): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_sent(chain_spec, tx_hash, fail, session=session) + r = chainqueue.sql.state.set_sent(chain_spec, tx_hash, fail, session=session) session.close() return r @@ -23,7 +23,7 @@ def set_sent(chain_spec_dict, tx_hash, fail=False): def set_final(chain_spec_dict, tx_hash, block=None, tx_index=None, fail=False): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_final(chain_spec, tx_hash, block=block, tx_index=tx_index, fail=fail, session=session) + r = chainqueue.sql.state.set_final(chain_spec, tx_hash, block=block, tx_index=tx_index, fail=fail, session=session) session.close() return r @@ -32,7 +32,7 @@ def set_final(chain_spec_dict, tx_hash, block=None, tx_index=None, fail=False): def set_cancel(chain_spec_dict, tx_hash, manual=False): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_cancel(chain_spec, tx_hash, manual, session=session) + r = chainqueue.sql.state.set_cancel(chain_spec, tx_hash, manual, session=session) session.close() return r @@ -41,7 +41,7 @@ def set_cancel(chain_spec_dict, tx_hash, manual=False): def set_rejected(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_rejected(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_rejected(chain_spec, tx_hash, session=session) session.close() return r @@ -50,7 +50,7 @@ def set_rejected(chain_spec_dict, tx_hash): def set_fubar(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_fubar(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_fubar(chain_spec, tx_hash, session=session) session.close() return r @@ -59,7 +59,7 @@ def set_fubar(chain_spec_dict, tx_hash): def set_manual(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_manual(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_manual(chain_spec, tx_hash, session=session) session.close() return r @@ -68,7 +68,7 @@ def set_manual(chain_spec_dict, tx_hash): def set_ready(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_ready(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_ready(chain_spec, tx_hash, session=session) session.close() return r @@ -77,7 +77,7 @@ def set_ready(chain_spec_dict, tx_hash): def set_reserved(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_reserved(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_reserved(chain_spec, tx_hash, session=session) session.close() return r @@ -86,7 +86,7 @@ def set_reserved(chain_spec_dict, tx_hash): def set_waitforgas(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.set_waitforgas(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.set_waitforgas(chain_spec, tx_hash, session=session) session.close() return r @@ -95,7 +95,7 @@ def set_waitforgas(chain_spec_dict, tx_hash): def get_state_log(chain_spec_dict, tx_hash): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.get_state_log(chain_spec, tx_hash, session=session) + r = chainqueue.sql.state.get_state_log(chain_spec, tx_hash, session=session) session.close() return r @@ -104,6 +104,6 @@ def get_state_log(chain_spec_dict, tx_hash): def obsolete(chain_spec_dict, tx_hash, final): chain_spec = ChainSpec.from_dict(chain_spec_dict) session = SessionBase.create_session() - r = chainqueue.state.obsolete_by_cache(chain_spec, tx_hash, final, session=session) + r = chainqueue.sql.state.obsolete_by_cache(chain_spec, tx_hash, final, session=session) session.close() return r diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/gas.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/gas.py index 4b17f86c..702fd8d7 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/gas.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/gas.py @@ -10,7 +10,7 @@ from chainlib.eth.tx import unpack from chainqueue.db.enum import StatusBits from chainqueue.db.models.tx import TxCache from chainqueue.db.models.otx import Otx -from chainqueue.query import get_paused_tx_cache as get_paused_tx +from chainqueue.sql.query import get_paused_tx_cache as get_paused_tx # local imports from cic_eth.db.models.base import SessionBase diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/straggler.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/straggler.py index 79d50cde..a8c5c88d 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/straggler.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/straggler.py @@ -3,7 +3,7 @@ import logging # external imports import celery -from chainqueue.state import obsolete_by_cache +from chainqueue.sql.state import obsolete_by_cache logg = logging.getLogger() diff --git a/apps/cic-eth/tests/filters/test_gas_filter.py b/apps/cic-eth/tests/filters/test_gas_filter.py index 8f91d2fd..2e30cc79 100644 --- a/apps/cic-eth/tests/filters/test_gas_filter.py +++ b/apps/cic-eth/tests/filters/test_gas_filter.py @@ -1,7 +1,7 @@ # external imports from chainlib.connection import RPCConnection from chainlib.eth.nonce import OverrideNonceOracle -from chainqueue.tx import create as queue_create +from chainqueue.sql.tx import create as queue_create from chainlib.eth.tx import ( TxFormat, unpack, @@ -16,7 +16,7 @@ from chainlib.eth.block import ( block_by_number, Block, ) -from chainqueue.state import ( +from chainqueue.sql.state import ( set_waitforgas, ) from hexathon import strip_0x diff --git a/apps/cic-eth/tests/filters/test_register_filter.py b/apps/cic-eth/tests/filters/test_register_filter.py index 9842bc00..ce4543bb 100644 --- a/apps/cic-eth/tests/filters/test_register_filter.py +++ b/apps/cic-eth/tests/filters/test_register_filter.py @@ -15,7 +15,7 @@ from chainlib.eth.block import ( ) from erc20_faucet import Faucet from hexathon import strip_0x -from chainqueue.query import get_account_tx +from chainqueue.sql.query import get_account_tx # local imports from cic_eth.runnable.daemons.filters.register import RegistrationFilter diff --git a/apps/cic-eth/tests/filters/test_straggler_filter.py b/apps/cic-eth/tests/filters/test_straggler_filter.py index 27dc0b75..0c8b5c07 100644 --- a/apps/cic-eth/tests/filters/test_straggler_filter.py +++ b/apps/cic-eth/tests/filters/test_straggler_filter.py @@ -17,8 +17,8 @@ from chainlib.eth.block import ( ) from chainqueue.db.models.otx import Otx from chainqueue.db.enum import StatusBits -from chainqueue.tx import create as queue_create -from chainqueue.state import ( +from chainqueue.sql.tx import create as queue_create +from chainqueue.sql.state import ( set_reserved, set_ready, set_sent, diff --git a/apps/cic-eth/tests/filters/test_transferauth_filter.py b/apps/cic-eth/tests/filters/test_transferauth_filter.py index 25822b83..4d2266c1 100644 --- a/apps/cic-eth/tests/filters/test_transferauth_filter.py +++ b/apps/cic-eth/tests/filters/test_transferauth_filter.py @@ -15,7 +15,7 @@ from chainlib.eth.block import ( Block, ) from hexathon import strip_0x -from chainqueue.query import get_account_tx +from chainqueue.sql.query import get_account_tx # local imports from cic_eth.runnable.daemons.filters.transferauth import TransferAuthFilter diff --git a/apps/cic-eth/tests/filters/test_tx_filter.py b/apps/cic-eth/tests/filters/test_tx_filter.py index 06d2c94e..82d56f65 100644 --- a/apps/cic-eth/tests/filters/test_tx_filter.py +++ b/apps/cic-eth/tests/filters/test_tx_filter.py @@ -17,8 +17,8 @@ from chainlib.eth.block import ( ) from chainqueue.db.models.otx import Otx from chainqueue.db.enum import StatusBits -from chainqueue.tx import create as queue_create -from chainqueue.state import ( +from chainqueue.sql.tx import create as queue_create +from chainqueue.sql.state import ( set_reserved, set_ready, set_sent, diff --git a/apps/cic-eth/tests/task/api/test_admin.py b/apps/cic-eth/tests/task/api/test_admin.py index 95b1a060..62f3c49d 100644 --- a/apps/cic-eth/tests/task/api/test_admin.py +++ b/apps/cic-eth/tests/task/api/test_admin.py @@ -29,12 +29,12 @@ from chainqueue.db.enum import ( StatusBits, status_str, ) -from chainqueue.state import ( +from chainqueue.sql.state import ( set_fubar, set_ready, set_reserved, ) -from chainqueue.query import ( +from chainqueue.sql.query import ( get_tx, get_nonce_tx_cache, ) diff --git a/apps/cic-eth/tests/task/api/test_admin_noncritical.py b/apps/cic-eth/tests/task/api/test_admin_noncritical.py index fc10959d..2e41036c 100644 --- a/apps/cic-eth/tests/task/api/test_admin_noncritical.py +++ b/apps/cic-eth/tests/task/api/test_admin_noncritical.py @@ -11,7 +11,7 @@ from chainlib.eth.nonce import ( OverrideNonceOracle, RPCNonceOracle, ) -from chainqueue.tx import create as queue_create +from chainqueue.sql.tx import create as queue_create from chainlib.eth.tx import ( raw, receipt, @@ -23,14 +23,14 @@ from chainlib.eth.gas import ( Gas, OverrideGasOracle, ) -from chainqueue.state import ( +from chainqueue.sql.state import ( set_reserved, set_sent, set_ready, ) from chainqueue.db.models.otx import Otx from chainqueue.db.enum import StatusBits -from chainqueue.query import get_nonce_tx_cache +from chainqueue.sql.query import get_nonce_tx_cache from eth_erc20 import ERC20 from cic_eth_registry import CICRegistry diff --git a/apps/cic-eth/tests/task/api/test_app.py b/apps/cic-eth/tests/task/api/test_app.py index 321009f6..1e081584 100644 --- a/apps/cic-eth/tests/task/api/test_app.py +++ b/apps/cic-eth/tests/task/api/test_app.py @@ -12,7 +12,7 @@ from eth_accounts_index import AccountsIndex from chainlib.eth.tx import ( transaction, ) -from chainqueue.state import ( +from chainqueue.sql.state import ( set_reserved, ) diff --git a/apps/cic-eth/tests/task/test_task_admin.py b/apps/cic-eth/tests/task/test_task_admin.py index 7efa8283..463d48e7 100644 --- a/apps/cic-eth/tests/task/test_task_admin.py +++ b/apps/cic-eth/tests/task/test_task_admin.py @@ -5,7 +5,7 @@ import logging import celery from chainlib.connection import RPCConnection from chainlib.eth.nonce import OverrideNonceOracle -from chainqueue.tx import ( +from chainqueue.sql.tx import ( create as queue_create, ) from chainlib.eth.gas import ( @@ -13,7 +13,7 @@ from chainlib.eth.gas import ( OverrideGasOracle, ) from chainlib.eth.tx import TxFormat -from chainqueue.query import get_nonce_tx_cache +from chainqueue.sql.query import get_nonce_tx_cache from chainqueue.db.models.otx import Otx from chainqueue.db.enum import StatusBits from hexathon import add_0x diff --git a/apps/cic-eth/tests/task/test_task_gas.py b/apps/cic-eth/tests/task/test_task_gas.py index 3bd3dd80..c525724a 100644 --- a/apps/cic-eth/tests/task/test_task_gas.py +++ b/apps/cic-eth/tests/task/test_task_gas.py @@ -21,10 +21,10 @@ from chainlib.eth.constant import ( MINIMUM_FEE_UNITS, MINIMUM_FEE_PRICE, ) -from chainqueue.tx import create as queue_create -from chainqueue.query import get_tx +from chainqueue.sql.tx import create as queue_create +from chainqueue.sql.query import get_tx from chainqueue.db.enum import StatusBits -from chainqueue.state import ( +from chainqueue.sql.state import ( set_ready, set_reserved, set_sent, diff --git a/apps/cic-eth/tests/task/test_task_tx.py b/apps/cic-eth/tests/task/test_task_tx.py index ecf68992..db2b36ed 100644 --- a/apps/cic-eth/tests/task/test_task_tx.py +++ b/apps/cic-eth/tests/task/test_task_tx.py @@ -18,8 +18,8 @@ from chainlib.eth.tx import ( ) from hexathon import strip_0x from chainqueue.db.models.otx import Otx -from chainqueue.tx import create as queue_create -from chainqueue.state import ( +from chainqueue.sql.tx import create as queue_create +from chainqueue.sql.state import ( set_reserved, set_ready, set_sent, diff --git a/apps/cic-eth/tests/task/test_task_tx_misc.py b/apps/cic-eth/tests/task/test_task_tx_misc.py index 992abb83..94850900 100644 --- a/apps/cic-eth/tests/task/test_task_tx_misc.py +++ b/apps/cic-eth/tests/task/test_task_tx_misc.py @@ -5,7 +5,7 @@ import logging # external imports import pytest import celery -from chainqueue.tx import create as queue_create +from chainqueue.sql.tx import create as queue_create from chainlib.eth.nonce import ( RPCNonceOracle, OverrideNonceOracle, @@ -23,7 +23,7 @@ from hexathon import ( add_0x, strip_0x, ) -from chainqueue.state import ( +from chainqueue.sql.state import ( set_reserved, set_ready, )