1
0
mirror of https://github.com/bigchaindb/bigchaindb.git synced 2024-06-28 00:27:45 +02:00

require asset.data for CREATE and asset.id for TRANSFER in the schemas

This commit is contained in:
Scott Sadler 2017-06-07 13:39:24 +02:00
parent 1d96768db8
commit 622885aef8
3 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,8 @@ properties:
- type: object
additionalProperties: true
- type: 'null'
required:
- data
inputs:
type: array
title: "Transaction inputs"

View File

@ -12,6 +12,8 @@ properties:
"$ref": "#/definitions/sha3_hexdigest"
description: |
ID of the transaction that created the asset.
required:
- id
inputs:
type: array
title: "Transaction inputs"

View File

@ -101,6 +101,15 @@ def test_create_tx_asset_type(create_tx):
validate_raises(create_tx)
def test_create_tx_no_asset_data(create_tx):
tx_body = create_tx.to_dict()
del tx_body['asset']['data']
tx_body_no_signatures = Transaction._remove_signatures(tx_body)
tx_body_serialized = Transaction._to_str(tx_body_no_signatures)
tx_body['id'] = Transaction._to_hash(tx_body_serialized)
validate_raises(tx_body)
################################################################################
# Inputs