mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #1518 from bigchaindb/require_asset_data
Require asset.data for CREATE and asset.id for TRANSFER in the schemas
This commit is contained in:
commit
c9b5637681
@ -14,6 +14,8 @@ properties:
|
||||
- type: object
|
||||
additionalProperties: true
|
||||
- type: 'null'
|
||||
required:
|
||||
- data
|
||||
inputs:
|
||||
type: array
|
||||
title: "Transaction inputs"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user