chainqueue

Blockchain transaction queue control
Log | Files | Refs | LICENSE

commit 73f097f2bed1a88164b56a86f1da3afb3ebd38d7
parent fa9a992d9cb84023281597c3181373337e0f21d6
Author: nolash <dev@holbrook.no>
Date:   Fri,  2 Apr 2021 19:48:13 +0200

Move chainspec to first position increate method

Diffstat:
Mchainqueue/query.py | 3---
Mchainqueue/tx.py | 2+-
Msetup.cfg | 3+++
Mtests/base.py | 2+-
Mtests/test_query.py | 8++++----
5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/chainqueue/query.py b/chainqueue/query.py @@ -240,8 +240,6 @@ def get_upcoming_tx(chain_spec, status=StatusEnum.READYSEND, not_status=None, re func.min(Otx.nonce).label('nonce'), ) q_outer = q_outer.join(TxCache) - q_outer = q_outer.join(Lock, isouter=True) - q_outer = q_outer.filter(or_(Lock.flags==None, Lock.flags.op('&')(LockEnum.SEND.value)==0)) if not is_alive(status): SessionBase.release_session(session) @@ -339,4 +337,3 @@ def get_account_tx(chain_spec, address, as_sender=True, as_recipient=True, count session.close() return txs - diff --git a/chainqueue/tx.py b/chainqueue/tx.py @@ -13,7 +13,7 @@ from chainqueue.error import TxStateChangeError logg = logging.getLogger().getChild(__name__) -def create(nonce, holder_address, tx_hash, signed_tx, chain_spec, obsolete_predecessors=True, session=None): +def create(chain_spec, nonce, holder_address, tx_hash, signed_tx, obsolete_predecessors=True, session=None): """Create a new transaction queue record. :param nonce: Transaction nonce diff --git a/setup.cfg b/setup.cfg @@ -28,6 +28,9 @@ licence_files = python_requires = >= 3.6 packages = chainqueue + chainqueue.db + chainqueue.db.models + chainqueue.db.migrations #[options.entry_points] #console_scripts = diff --git a/tests/base.py b/tests/base.py @@ -73,7 +73,7 @@ class TestOtxBase(TestBase): self.nonce = 42 self.alice = add_0x(os.urandom(20).hex()) - tx_hash = create(self.nonce, self.alice, self.tx_hash, self.tx, self.chain_spec, session=self.session) + tx_hash = create(self.chain_spec, self.nonce, self.alice, self.tx_hash, self.tx, session=self.session) self.assertEqual(tx_hash, self.tx_hash) diff --git a/tests/test_query.py b/tests/test_query.py @@ -41,11 +41,11 @@ class TestTxQuery(TestTxBase): tx_hash = add_0x(os.urandom(32).hex()) signed_tx = add_0x(os.urandom(128).hex()) create( + self.chain_spec, 42, self.alice, tx_hash, signed_tx, - self.chain_spec, session=self.session, ) txc = TxCache( @@ -66,11 +66,11 @@ class TestTxQuery(TestTxBase): tx_hash = add_0x(os.urandom(32).hex()) signed_tx = add_0x(os.urandom(128).hex()) create( + self.chain_spec, 41, self.alice, tx_hash, signed_tx, - self.chain_spec, session=self.session, ) txc = TxCache( @@ -98,11 +98,11 @@ class TestTxQuery(TestTxBase): tx_hash = add_0x(os.urandom(32).hex()) signed_tx = add_0x(os.urandom(128).hex()) create( + self.chain_spec, 43, self.alice, tx_hash, signed_tx, - self.chain_spec, session=self.session, ) txc = TxCache( @@ -127,11 +127,11 @@ class TestTxQuery(TestTxBase): tx_hash = add_0x(os.urandom(32).hex()) signed_tx = add_0x(os.urandom(128).hex()) create( + self.chain_spec, 42, self.bob, tx_hash, signed_tx, - self.chain_spec, session=self.session, ) txc = TxCache(