mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-06-23 01:36:42 +02: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.common.transaction import TransactionLink
|
||||
|
||||
|
@ -52,7 +52,8 @@ class FastQuery:
|
|||
return [TransactionLink(tx['id'], index)
|
||||
for tx in txs
|
||||
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):
|
||||
"""
|
||||
|
|
|
@ -113,11 +113,6 @@ def condition_details_has_owner(condition_details, owner):
|
|||
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):
|
||||
"""Check if the block is the genesis block.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user