chainqueue

Blockchain transaction queue control
Log | Files | Refs | LICENSE

commit 39afbb71c1896ab3fd45b56339f7cc1adfe2ff44
parent fb14961c1b7f1fbfcfda774a61d7be762ccb7163
Author: nolash <dev@holbrook.no>
Date:   Fri,  2 Apr 2021 14:56:57 +0200

Add test for nonce txs, paused txs queries

Diffstat:
Mchainqueue/query.py | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/chainqueue/query.py b/chainqueue/query.py @@ -123,7 +123,7 @@ def get_nonce_tx_cache(chain_spec, nonce, sender, decoder=None): for r in q.all(): tx_signed_bytes = bytes.fromhex(r.signed_tx) if decoder != None: - tx = unpack(tx_signed_bytes, chain_id) + tx = decoder(tx_signed_bytes, chain_spec) if sender != None and tx['from'] != sender: raise IntegrityError('Cache sender {} does not match sender in tx {} using decoder {}'.format(sender, r.tx_hash, str(decoder))) txs[r.tx_hash] = r.signed_tx @@ -168,13 +168,11 @@ def get_paused_tx_cache(chain_spec, status=None, sender=None, session=None, deco for r in q.all(): tx_signed_bytes = bytes.fromhex(r.signed_tx) if decoder != None: - tx = unpack(tx_signed_bytes, chain_id) + tx = decoder(tx_signed_bytes, chain_spec) if sender != None and tx['from'] != sender: raise IntegrityError('Cache sender {} does not match sender in tx {} using decoder {}'.format(sender, r.tx_hash, str(decoder))) gas += tx['gas'] * tx['gasPrice'] - #tx = unpack(tx_signed_bytes, chain_id) - #if sender == None or tx['from'] == sender: txs[r.tx_hash] = r.signed_tx SessionBase.release_session(session)