mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Remove unnecessary output_has_owner method.
- Refactor the code
This commit is contained in:
parent
aaf4fcb91e
commit
9033ba76f8
@ -1,4 +1,4 @@
|
|||||||
from bigchaindb.utils import output_has_owner
|
from bigchaindb.utils import condition_details_has_owner
|
||||||
from bigchaindb.backend import query
|
from bigchaindb.backend import query
|
||||||
from bigchaindb.common.transaction import TransactionLink
|
from bigchaindb.common.transaction import TransactionLink
|
||||||
|
|
||||||
@ -52,7 +52,8 @@ class FastQuery:
|
|||||||
return [TransactionLink(tx['id'], index)
|
return [TransactionLink(tx['id'], index)
|
||||||
for tx in txs
|
for tx in txs
|
||||||
for index, output in enumerate(tx['outputs'])
|
for index, output in enumerate(tx['outputs'])
|
||||||
if output_has_owner(output, public_key)]
|
if condition_details_has_owner(output['condition']['details'],
|
||||||
|
public_key)]
|
||||||
|
|
||||||
def filter_spent_outputs(self, outputs):
|
def filter_spent_outputs(self, outputs):
|
||||||
"""
|
"""
|
||||||
|
@ -113,11 +113,6 @@ def condition_details_has_owner(condition_details, owner):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def output_has_owner(output, owner):
|
|
||||||
return condition_details_has_owner(output['condition']['details'], owner)
|
|
||||||
# TODO raise proper exception, e.g. invalid tx payload?
|
|
||||||
|
|
||||||
|
|
||||||
def is_genesis_block(block):
|
def is_genesis_block(block):
|
||||||
"""Check if the block is the genesis block.
|
"""Check if the block is the genesis block.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user