mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Tx ID as Asset ID (#926)
* Allow AssetLinks to be used in place of Assets in the Transaction Model and enforce `Transaction.transfer()` to only take an AssetLink * Remove AssetLink's inheritance from Asset * Remove id from the Asset model * Fix get_txids_by_asset_id query for rethinkdb after removing asset's uuid Because `CREATE` transactions don't have an asset that contains an id anymore, one way to find all the transactions related to an asset is to query the database twice: once for the `CREATE` transaction and another for the `TRANSFER` transactions. * Add TODO notice for vote test utils to be fixtures * Update asset model documentation to reflect usage of transaction id * Fix outdated asset description in transaction schema
This commit is contained in:
@@ -5,18 +5,17 @@ To avoid redundant data in transactions, the digital asset model is different fo
|
||||
A digital asset's properties are defined in a `CREATE` transaction with the following model:
|
||||
```json
|
||||
{
|
||||
"id": "<uuid>",
|
||||
"data": "<json document>"
|
||||
}
|
||||
```
|
||||
|
||||
For `TRANSFER` transactions we only keep the asset id.
|
||||
For `TRANSFER` transactions we only keep the asset ID:
|
||||
```json
|
||||
{
|
||||
"id": "<uuid>"
|
||||
"id": "<asset's CREATE transaction ID (sha3-256 hash)>"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- `id`: UUID version 4 (random) converted to a string of hex digits in standard form. Added server side.
|
||||
- `id`: The ID of the `CREATE` transaction that created the asset.
|
||||
- `data`: A user supplied JSON document with custom information about the asset. Defaults to null.
|
||||
|
||||
Reference in New Issue
Block a user