diff --git a/bigchaindb/utils.py b/bigchaindb/utils.py index 4dad9377..f87916b7 100644 --- a/bigchaindb/utils.py +++ b/bigchaindb/utils.py @@ -114,11 +114,16 @@ def condition_details_has_owner(condition_details, owner): def output_has_owner(output, owner): - if len(output['public_keys']) > 0: + # TODO + # Check whether it is really necessary to treat the single key case + # differently from the multiple keys case, and why not just use the same + # function for both cases. + if len(output['public_keys']) > 1: return condition_details_has_owner( output['condition']['details'], owner) - return False - # # TODO raise proper exception, e.g. invalid tx payload? + elif len(output['public_keys']) == 1: + return output['condition']['details']['public_key'] == owner + # TODO raise proper exception, e.g. invalid tx payload? def is_genesis_block(block): diff --git a/bigchaindb/web/server.py b/bigchaindb/web/server.py index 16c76b01..539d3f73 100644 --- a/bigchaindb/web/server.py +++ b/bigchaindb/web/server.py @@ -2,6 +2,7 @@ The application is implemented in Flask and runs using Gunicorn. """ + import copy import multiprocessing diff --git a/setup.py b/setup.py index c6a5f63d..ce509518 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ install_requires = [ 'python-rapidjson==0.0.11', 'logstats>=0.2.1', 'flask>=0.10.1', - 'flask-cors==2.1.2', + 'flask-cors~=2.1.2', 'flask-restful~=0.3.0', 'requests~=2.9', 'gunicorn~=19.0',