mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Switch to more compact jsonify argument syntax
This commit is contained in:
parent
e3441aa011
commit
5046de270e
@ -48,6 +48,7 @@ def create_transaction():
|
|||||||
Return:
|
Return:
|
||||||
A JSON string containing the data about the transaction.
|
A JSON string containing the data about the transaction.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bigchain = current_app.config['bigchain']
|
bigchain = current_app.config['bigchain']
|
||||||
|
|
||||||
val = {}
|
val = {}
|
||||||
@ -78,6 +79,7 @@ def validate_transaction():
|
|||||||
A JSON object with the `valid` field populated with a boolean value
|
A JSON object with the `valid` field populated with a boolean value
|
||||||
and the `error` field populated with an error message or an empty str
|
and the `error` field populated with an error message or an empty str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bigchain = current_app.config['bigchain']
|
bigchain = current_app.config['bigchain']
|
||||||
|
|
||||||
tx = request.get_json(force=True)
|
tx = request.get_json(force=True)
|
||||||
@ -97,8 +99,8 @@ def validate_transaction():
|
|||||||
except exceptions.InvalidSignature as e:
|
except exceptions.InvalidSignature as e:
|
||||||
# We skipped signing CREATEs with the node's private key, so expect this
|
# We skipped signing CREATEs with the node's private key, so expect this
|
||||||
if validate_sig:
|
if validate_sig:
|
||||||
return flask.jsonify({'valid': False, 'error': repr(e)})
|
return flask.jsonify(valid=False, error=repr(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return flask.jsonify({'valid': False, 'error': repr(e)})
|
return flask.jsonify(valid=False, error=repr(e))
|
||||||
|
|
||||||
return flask.jsonify({'valid': True, 'error': ''})
|
return flask.jsonify(valid=True, error='')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user