Move chainspec to first position increate method

This commit is contained in:
nolash 2021-04-02 19:48:13 +02:00
parent fa9a992d9c
commit 73f097f2be
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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 =

View File

@ -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)

View File

@ -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(