diff --git a/bigchaindb/util.py b/bigchaindb/util.py index 8492cc81..9e08b415 100644 --- a/bigchaindb/util.py +++ b/bigchaindb/util.py @@ -169,8 +169,8 @@ def create_tx(current_owners, new_owners, inputs, operation, payload=None): Reference: { "id": "", - "version": "transaction version number", "transaction": { + "version": "transaction version number", "fulfillments": [ { "current_owners": ["list of "], @@ -278,6 +278,7 @@ def create_tx(current_owners, new_owners, inputs, operation, payload=None): }) tx = { + 'version': 1, 'fulfillments': fulfillments, 'conditions': conditions, 'operation': operation, @@ -291,7 +292,6 @@ def create_tx(current_owners, new_owners, inputs, operation, payload=None): # create the transaction transaction = { 'id': tx_hash, - 'version': 1, 'transaction': tx } diff --git a/docs/source/topic-guides/models.md b/docs/source/topic-guides/models.md index c130ce83..8e0add9d 100644 --- a/docs/source/topic-guides/models.md +++ b/docs/source/topic-guides/models.md @@ -58,8 +58,8 @@ Assets can be mutable (changeable) or immutable. To change a mutable asset, you ```json { "id": "", - "version": "", "transaction": { + "version": "", "fulfillments": [""], "conditions": [""], "operation": "", @@ -75,8 +75,8 @@ Assets can be mutable (changeable) or immutable. To change a mutable asset, you Here's some explanation of the contents of a transaction: - `id`: The hash of everything inside the serialized `transaction` body (i.e. `fulfillments`, `conditions`, `operation`, `timestamp` and `data`; see below), with one wrinkle: for each fulfillment in `fulfillments`, `fulfillment` is set to `null`. The `id` is also the database primary key. -- `version`: Version number of the transaction model, so that software can support different transaction models. - `transaction`: + - `version`: Version number of the transaction model, so that software can support different transaction models. - `fulfillments`: List of fulfillments. Each _fulfillment_ contains a pointer to an unspent asset and a _crypto fulfillment_ that satisfies a spending condition set on the unspent asset. A _fulfillment_ is usually a signature proving the ownership of the asset.