fixed flake issues

Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Juergen Eckel 2019-10-02 14:39:29 +02:00
parent a9476719a8
commit 3ab858b785

View File

@ -41,8 +41,8 @@ class TransactionApi(Resource):
return tx.to_dict() return tx.to_dict()
class TransactionListApi(Resource):
class TransactionListApi(Resource):
def get(self): def get(self):
parser = reqparse.RequestParser() parser = reqparse.RequestParser()
parser.add_argument('operation', type=parameters.valid_operation) parser.add_argument('operation', type=parameters.valid_operation)
@ -54,14 +54,13 @@ class TransactionListApi(Resource):
with current_app.config['bigchain_pool']() as bigchain: with current_app.config['bigchain_pool']() as bigchain:
txs = bigchain.get_transactions_filtered(**args) txs = bigchain.get_transactions_filtered(**args)
print( txs ) if args['last_tx'] and args['last_tx'] is True:
if args['last_tx'] and args['last_tx']==True:
lastTX = None lastTX = None
for x in txs: for x in txs:
lastTX = x lastTX = x
if lastTX: if lastTX:
return [ lastTX.to_dict() ] return [lastTX.to_dict]
else: else:
return [] return []
else: else: