mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
simplify query
This commit is contained in:
parent
003d4b8310
commit
0de838c40f
@ -167,8 +167,8 @@ class Bigchain(object):
|
|||||||
break
|
break
|
||||||
|
|
||||||
# Query the transaction in the target block and return
|
# Query the transaction in the target block and return
|
||||||
response = r.table('bigchain').filter(lambda block: block['id'] == target_block_id).nth(0)\
|
response = r.table('bigchain').get(target_block_id).get_field('block')\
|
||||||
.get_field('block').get_field('transactions').filter(lambda tx: tx['id'] == txid).run(self.conn)
|
.get_field('transactions').filter(lambda tx: tx['id'] == txid).run(self.conn)
|
||||||
|
|
||||||
return response[0]
|
return response[0]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user