mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: changed the return type of get_transaction_filtered
Solution: return tx class instead of dict
This commit is contained in:
parent
c0cad540ab
commit
078e767abc
@ -262,8 +262,10 @@ class BigchainDB(object):
|
|||||||
def get_transactions_filtered(self, asset_id, operation=None):
|
def get_transactions_filtered(self, asset_id, operation=None):
|
||||||
"""Get a list of transactions filtered on some criteria
|
"""Get a list of transactions filtered on some criteria
|
||||||
"""
|
"""
|
||||||
return backend.query.get_txids_filtered(self.connection, asset_id,
|
txids = backend.query.get_txids_filtered(self.connection, asset_id,
|
||||||
operation)
|
operation)
|
||||||
|
for txid in txids:
|
||||||
|
yield self.get_transaction(txid)
|
||||||
|
|
||||||
def get_outputs_filtered(self, owner, spent=None):
|
def get_outputs_filtered(self, owner, spent=None):
|
||||||
"""Get a list of output links filtered on some criteria
|
"""Get a list of output links filtered on some criteria
|
||||||
|
|||||||
@ -35,11 +35,11 @@ def txlist(b, user_pk, user2_pk, user_sk, user2_sk):
|
|||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_get_txlist_by_asset(b, txlist):
|
def test_get_txlist_by_asset(b, txlist):
|
||||||
res = b.get_transactions_filtered(txlist.create1.id)
|
res = b.get_transactions_filtered(txlist.create1.id)
|
||||||
assert sorted(set(tx for tx in res)) == sorted(
|
assert sorted(set(tx.id for tx in res)) == sorted(
|
||||||
set([txlist.transfer1.id, txlist.create1.id]))
|
set([txlist.transfer1.id, txlist.create1.id]))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_get_txlist_by_operation(b, txlist):
|
def test_get_txlist_by_operation(b, txlist):
|
||||||
res = b.get_transactions_filtered(txlist.create1.id, operation='CREATE')
|
res = b.get_transactions_filtered(txlist.create1.id, operation='CREATE')
|
||||||
assert set(tx for tx in res) == {txlist.create1.id}
|
assert set(tx.id for tx in res) == {txlist.create1.id}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user