diff --git a/acceptance/python/src/conftest.py b/acceptance/python/src/conftest.py index 34e8a3f..8583969 100644 --- a/acceptance/python/src/conftest.py +++ b/acceptance/python/src/conftest.py @@ -36,20 +36,22 @@ FULFILL_SCRIPT = \ When I verify the 'houses' has a signature in 'data.signature' by 'Alice' Then print the string 'ok'""" -HOUSE_ASSETS = { - "data": { - "houses": [ - { - "name": "Harry", - "team": "Gryffindor", - }, - { - "name": "Draco", - "team": "Slytherin", - } - ], +HOUSE_ASSETS = [ + { + "data": { + "houses": [ + { + "name": "Harry", + "team": "Gryffindor", + }, + { + "name": "Draco", + "team": "Slytherin", + } + ], + } } -} +] ZENROOM_DATA = { 'also': 'more data' diff --git a/acceptance/python/src/test_basic.py b/acceptance/python/src/test_basic.py index 5e09085..65d08de 100644 --- a/acceptance/python/src/test_basic.py +++ b/acceptance/python/src/test_basic.py @@ -44,13 +44,13 @@ def test_basic(): # ## Alice registers her bike in Planetmint # Alice has a nice bike, and here she creates the "digital twin" # of her bike. - bike = {'data': {'bicycle': {'serial_number': 420420}}} + bike = [{'data': {'bicycle': {'serial_number': 420420}}}] # She prepares a `CREATE` transaction... prepared_creation_tx = bdb.transactions.prepare( operation='CREATE', signers=alice.public_key, - asset=bike) + assets=bike) # ... and she fulfills it with her private key. fulfilled_creation_tx = bdb.transactions.fulfill( @@ -98,7 +98,7 @@ def test_basic(): # Now that all the elements are set, she creates the actual transaction... prepared_transfer_tx = bdb.transactions.prepare( operation='TRANSFER', - asset=transfer_asset, + assets=transfer_asset, inputs=transfer_input, recipients=bob.public_key) diff --git a/acceptance/python/src/test_divisible_asset.py b/acceptance/python/src/test_divisible_asset.py index 1967237..6d7db5f 100644 --- a/acceptance/python/src/test_divisible_asset.py +++ b/acceptance/python/src/test_divisible_asset.py @@ -68,7 +68,7 @@ def test_divisible_assets(): operation='CREATE', signers=alice.public_key, recipients=[([bob.public_key], 10)], - asset=bike_token) + assets=bike_token) # She fulfills and sends the transaction. fulfilled_token_tx = bdb.transactions.fulfill( @@ -108,7 +108,7 @@ def test_divisible_assets(): # amount he wants to use to Alice. prepared_transfer_tx = bdb.transactions.prepare( operation='TRANSFER', - asset=transfer_asset, + assets=transfer_asset, inputs=transfer_input, recipients=[([alice.public_key], 3), ([bob.public_key], 7)]) @@ -155,7 +155,7 @@ def test_divisible_assets(): # to spend all his tokens prepared_transfer_tx = bdb.transactions.prepare( operation='TRANSFER', - asset=transfer_asset, + assets=transfer_asset, inputs=transfer_input, recipients=[([alice.public_key], 8)]) diff --git a/acceptance/python/src/test_double_spend.py b/acceptance/python/src/test_double_spend.py index 8f8fab9..48eca3b 100644 --- a/acceptance/python/src/test_double_spend.py +++ b/acceptance/python/src/test_double_spend.py @@ -26,7 +26,7 @@ def test_double_create(): bdb.transactions.prepare( operation='CREATE', signers=alice.public_key, - asset={'data': {'uuid': str(uuid4())}}), + assets={'data': {'uuid': str(uuid4())}}), private_keys=alice.private_key) def send_and_queue(tx): diff --git a/acceptance/python/src/test_multiple_owners.py b/acceptance/python/src/test_multiple_owners.py index e60c63a..6400477 100644 --- a/acceptance/python/src/test_multiple_owners.py +++ b/acceptance/python/src/test_multiple_owners.py @@ -57,7 +57,7 @@ def test_multiple_owners(): operation='CREATE', signers=alice.public_key, recipients=(alice.public_key, bob.public_key), - asset=dw_asset) + assets=dw_asset) # Now they both sign the transaction by providing their private keys. # And send it afterwards. @@ -101,7 +101,7 @@ def test_multiple_owners(): # Now they create the transaction... prepared_transfer_tx = bdb.transactions.prepare( operation='TRANSFER', - asset=transfer_asset, + assets=transfer_asset, inputs=transfer_input, recipients=carol.public_key) diff --git a/acceptance/python/src/test_naughty_strings.py b/acceptance/python/src/test_naughty_strings.py index 423ae01..be7438c 100644 --- a/acceptance/python/src/test_naughty_strings.py +++ b/acceptance/python/src/test_naughty_strings.py @@ -32,7 +32,7 @@ naughty_strings = blns.all() # This is our base test case, but we'll reuse it to send naughty strings as both keys and values. -def send_naughty_tx(asset, metadata): +def send_naughty_tx(assets, metadata): # ## Set up a connection to Planetmint # Check [test_basic.py](./test_basic.html) to get some more details # about the endpoint. @@ -45,7 +45,7 @@ def send_naughty_tx(asset, metadata): prepared_transaction = bdb.transactions.prepare( operation='CREATE', signers=alice.public_key, - asset=asset, + assets=assets, metadata=metadata) # She fulfills the transaction @@ -86,16 +86,16 @@ def send_naughty_tx(asset, metadata): @pytest.mark.parametrize("naughty_string", naughty_strings, ids=naughty_strings) def test_naughty_keys(naughty_string): - asset = {'data': {naughty_string: 'nice_value'}} + assets = [{'data': {naughty_string: 'nice_value'}}] metadata = {naughty_string: 'nice_value'} - send_naughty_tx(asset, metadata) + send_naughty_tx(assets, metadata) @pytest.mark.parametrize("naughty_string", naughty_strings, ids=naughty_strings) def test_naughty_values(naughty_string): - asset = {'data': {'nice_key': naughty_string}} + assets = [{'data': {'nice_key': naughty_string}}] metadata = {'nice_key': naughty_string} - send_naughty_tx(asset, metadata) + send_naughty_tx(assets, metadata) diff --git a/acceptance/python/src/test_stream.py b/acceptance/python/src/test_stream.py index c6d037b..b9f2161 100644 --- a/acceptance/python/src/test_stream.py +++ b/acceptance/python/src/test_stream.py @@ -93,7 +93,7 @@ def test_stream(): bdb.transactions.prepare( operation='CREATE', signers=alice.public_key, - asset={'data': {'uuid': str(uuid4())}}), + assets=[{'data': {'uuid': str(uuid4())}}]), private_keys=alice.private_key) # We don't want to wait for each transaction to be in a block. By using # `async` mode, we make sure that the driver returns as soon as the diff --git a/acceptance/python/src/test_zenroom.py b/acceptance/python/src/test_zenroom.py index 2829fab..97cd440 100644 --- a/acceptance/python/src/test_zenroom.py +++ b/acceptance/python/src/test_zenroom.py @@ -58,7 +58,7 @@ condition_script_zencode, zenroom_data, zenroom_house_assets): token_creation_tx = { 'operation': 'CREATE', - 'asset': zenroom_house_assets, + 'assets': zenroom_house_assets, 'metadata': None, 'outputs': (output,), 'inputs': (input_,), diff --git a/docs/root/source/installation/api/http-samples/api-index-response.http b/docs/root/source/installation/api/http-samples/api-index-response.http index 7ba7be8..601f9ef 100644 --- a/docs/root/source/installation/api/http-samples/api-index-response.http +++ b/docs/root/source/installation/api/http-samples/api-index-response.http @@ -4,7 +4,7 @@ Content-Type: application/json { "assets": "/assets/", "blocks": "/blocks/", - "docs": "https://docs.planetmint.com/projects/server/en/v0.9.0/http-client-server-api.html", + "docs": "https://docs.planetmint.com/projects/server/en/v0.9.1/http-client-server-api.html", "metadata": "/metadata/", "outputs": "/outputs/", "streams": "ws://localhost:9985/api/v1/streams/valid_transactions", diff --git a/docs/root/source/installation/api/http-samples/get-block-response.http b/docs/root/source/installation/api/http-samples/get-block-response.http index 168c60c..01dffd9 100644 --- a/docs/root/source/installation/api/http-samples/get-block-response.http +++ b/docs/root/source/installation/api/http-samples/get-block-response.http @@ -5,15 +5,17 @@ Content-Type: application/json "height": 1, "transactions": [ { - "asset": { - "data": { - "msg": "Hello Planetmint!" + "assets": [ + { + "data": { + "msg": "Hello Planetmint!" + } } - }, - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2", + ], + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac", "inputs": [ { - "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUBcdRj6EnG3MPl47m3XPd1HNfe7q3WL4T6MewNNnat33UvzVnPHo_vossv57M7L064VwrYMLGp097H7IeHpDngK", + "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUCWcUaLa2U-nkmZ6oYj14aeV6B4TJH2NvZ8k2ZTwcGiaiCGXDQT2dEPfMCFwM8lwSousafCu4c7EgVZ1GzUDjsN", "fulfills": null, "owners_before": [ "4K9sWUMFwTgaDGPfdynrbxWqWS6sWmKbZoTjxLtVUibD" diff --git a/docs/root/source/installation/api/http-samples/get-block-txid-request.http b/docs/root/source/installation/api/http-samples/get-block-txid-request.http index 7ecb018..b3e8bd3 100644 --- a/docs/root/source/installation/api/http-samples/get-block-txid-request.http +++ b/docs/root/source/installation/api/http-samples/get-block-txid-request.http @@ -1,3 +1,3 @@ -GET /api/v1/blocks?transaction_id=6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2 HTTP/1.1 +GET /api/v1/blocks?transaction_id=61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac HTTP/1.1 Host: example.com diff --git a/docs/root/source/installation/api/http-samples/get-tx-by-asset-request.http b/docs/root/source/installation/api/http-samples/get-tx-by-asset-request.http index fb15c84..560bcbc 100644 --- a/docs/root/source/installation/api/http-samples/get-tx-by-asset-request.http +++ b/docs/root/source/installation/api/http-samples/get-tx-by-asset-request.http @@ -1,3 +1,3 @@ -GET /api/v1/transactions?operation=TRANSFER&asset_id=6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2 HTTP/1.1 +GET /api/v1/transactions?operation=TRANSFER&asset_id=61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac HTTP/1.1 Host: example.com diff --git a/docs/root/source/installation/api/http-samples/get-tx-by-asset-response.http b/docs/root/source/installation/api/http-samples/get-tx-by-asset-response.http index 6ed97dc..32d5554 100644 --- a/docs/root/source/installation/api/http-samples/get-tx-by-asset-response.http +++ b/docs/root/source/installation/api/http-samples/get-tx-by-asset-response.http @@ -2,16 +2,18 @@ HTTP/1.1 200 OK Content-Type: application/json [{ - "asset": { - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2" - }, - "id": "2bf8ae1e3bc889a26df129dd6bbe6ccab30d1ae8e9e434fae1c4446042a68931", + "assets": [ + { + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac" + } + ], + "id": "b6e1ab3d48bbbbb0e40b952e70ec5d439b2745e0ba0c44b4ee877657e9ac33f0", "inputs": [ { - "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUA90mMa9AWnbI70CUSVgzV9kRFf3tQ20RUIczNFqmwg9xrpOk_5uNoJB4bWRIojZmUhEyxSueCHLpqPXCEuyisE", + "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUA4BB4fxDXK3CQTbKpH5gTAN76NG-iopNuuDEfBbZ1Fl-ipNU46t8VCvK9ghm9Q53aFRW6DDiW5wcWXxY0sS4EJ", "fulfills": { "output_index": 0, - "transaction_id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2" + "transaction_id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac" }, "owners_before": [ "4K9sWUMFwTgaDGPfdynrbxWqWS6sWmKbZoTjxLtVUibD" @@ -40,16 +42,18 @@ Content-Type: application/json "version": "2.0" }, { - "asset": { - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2" - }, - "id": "b9b614175eaed7cc93d9b80ebc2a91d35ae31928a7c218ae982272bb1785ef16", + "assets": [ + { + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac" + } + ], + "id": "e43d3f93d90d22ef11c21607e3415bfcda4e0c7dd60412fbb55daf32978a3126", "inputs": [ { - "fulfillment": "pGSAICw7Ul-c2lG6NFbHp3FbKRC7fivQcNGO7GS4wV3A-1QggUDi2bAVKJgEyE3LzMrAnAu1PnNs9DbDNkABaY6j3OCNEVwNVNg3V3qELOFNnH8vGUevREr4E-8Vb1Kzk4VR71MO", + "fulfillment": "pGSAICw7Ul-c2lG6NFbHp3FbKRC7fivQcNGO7GS4wV3A-1QggUBjj_XTjB3yJdG8JMNKnkkHvcX_BTOkl-YacRD4yKqxUCeL-VTgbrLgi5a3gGxNJcTkZP1gF0nsby8cgV4xmOcB", "fulfills": { "output_index": 0, - "transaction_id": "2bf8ae1e3bc889a26df129dd6bbe6ccab30d1ae8e9e434fae1c4446042a68931" + "transaction_id": "b6e1ab3d48bbbbb0e40b952e70ec5d439b2745e0ba0c44b4ee877657e9ac33f0" }, "owners_before": [ "3yfQPHeWAa1MxTX9Zf9176QqcpcnWcanVZZbaHb8B3h9" diff --git a/docs/root/source/installation/api/http-samples/get-tx-id-request.http b/docs/root/source/installation/api/http-samples/get-tx-id-request.http index c6c834c..1574cdd 100644 --- a/docs/root/source/installation/api/http-samples/get-tx-id-request.http +++ b/docs/root/source/installation/api/http-samples/get-tx-id-request.http @@ -1,3 +1,3 @@ -GET /api/v1/transactions/6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2 HTTP/1.1 +GET /api/v1/transactions/61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac HTTP/1.1 Host: example.com diff --git a/docs/root/source/installation/api/http-samples/get-tx-id-response.http b/docs/root/source/installation/api/http-samples/get-tx-id-response.http index c5f3b71..0ee9bb2 100644 --- a/docs/root/source/installation/api/http-samples/get-tx-id-response.http +++ b/docs/root/source/installation/api/http-samples/get-tx-id-response.http @@ -2,15 +2,17 @@ HTTP/1.1 200 OK Content-Type: application/json { - "asset": { - "data": { - "msg": "Hello Planetmint!" + "assets": [ + { + "data": { + "msg": "Hello Planetmint!" + } } - }, - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2", + ], + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac", "inputs": [ { - "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUBcdRj6EnG3MPl47m3XPd1HNfe7q3WL4T6MewNNnat33UvzVnPHo_vossv57M7L064VwrYMLGp097H7IeHpDngK", + "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUCWcUaLa2U-nkmZ6oYj14aeV6B4TJH2NvZ8k2ZTwcGiaiCGXDQT2dEPfMCFwM8lwSousafCu4c7EgVZ1GzUDjsN", "fulfills": null, "owners_before": [ "4K9sWUMFwTgaDGPfdynrbxWqWS6sWmKbZoTjxLtVUibD" diff --git a/docs/root/source/installation/api/http-samples/index-response.http b/docs/root/source/installation/api/http-samples/index-response.http index c593a91..f7e524e 100644 --- a/docs/root/source/installation/api/http-samples/index-response.http +++ b/docs/root/source/installation/api/http-samples/index-response.http @@ -6,7 +6,7 @@ Content-Type: application/json "v1": { "assets": "/api/v1/assets/", "blocks": "/api/v1/blocks/", - "docs": "https://docs.planetmint.com/projects/server/en/v0.9.0/http-client-server-api.html", + "docs": "https://docs.planetmint.com/projects/server/en/v0.9.1/http-client-server-api.html", "metadata": "/api/v1/metadata/", "outputs": "/api/v1/outputs/", "streams": "ws://localhost:9985/api/v1/streams/valid_transactions", @@ -14,7 +14,7 @@ Content-Type: application/json "validators": "/api/v1/validators" } }, - "docs": "https://docs.planetmint.com/projects/server/en/v0.9.0/", + "docs": "https://docs.planetmint.com/projects/server/en/v0.9.1/", "software": "Planetmint", - "version": "0.9.0" + "version": "0.9.1" } diff --git a/docs/root/source/installation/api/http-samples/post-tx-request.http b/docs/root/source/installation/api/http-samples/post-tx-request.http index 8ab0710..a2bca94 100644 --- a/docs/root/source/installation/api/http-samples/post-tx-request.http +++ b/docs/root/source/installation/api/http-samples/post-tx-request.http @@ -3,15 +3,17 @@ Host: example.com Content-Type: application/json { - "asset": { - "data": { - "msg": "Hello Planetmint!" + "assets": [ + { + "data": { + "msg": "Hello Planetmint!" + } } - }, - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2", + ], + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac", "inputs": [ { - "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUBcdRj6EnG3MPl47m3XPd1HNfe7q3WL4T6MewNNnat33UvzVnPHo_vossv57M7L064VwrYMLGp097H7IeHpDngK", + "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUCWcUaLa2U-nkmZ6oYj14aeV6B4TJH2NvZ8k2ZTwcGiaiCGXDQT2dEPfMCFwM8lwSousafCu4c7EgVZ1GzUDjsN", "fulfills": null, "owners_before": [ "4K9sWUMFwTgaDGPfdynrbxWqWS6sWmKbZoTjxLtVUibD" diff --git a/docs/root/source/installation/api/http-samples/post-tx-response.http b/docs/root/source/installation/api/http-samples/post-tx-response.http index 653014e..eabf577 100644 --- a/docs/root/source/installation/api/http-samples/post-tx-response.http +++ b/docs/root/source/installation/api/http-samples/post-tx-response.http @@ -2,15 +2,17 @@ HTTP/1.1 202 Accepted Content-Type: application/json { - "asset": { - "data": { - "msg": "Hello Planetmint!" + "assets": [ + { + "data": { + "msg": "Hello Planetmint!" + } } - }, - "id": "6438c733f53dff60bdeded80e8c95126dd3a7ce8c1ee5d5591d030e61cde35d2", + ], + "id": "61e1312b80705e0dabb948c9d78dae7f62d64832abda822b13d89c4a7305d4ac", "inputs": [ { - "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUBcdRj6EnG3MPl47m3XPd1HNfe7q3WL4T6MewNNnat33UvzVnPHo_vossv57M7L064VwrYMLGp097H7IeHpDngK", + "fulfillment": "pGSAIDE5i63cn4X8T8N1sZ2mGkJD5lNRnBM4PZgI_zvzbr-cgUCWcUaLa2U-nkmZ6oYj14aeV6B4TJH2NvZ8k2ZTwcGiaiCGXDQT2dEPfMCFwM8lwSousafCu4c7EgVZ1GzUDjsN", "fulfills": null, "owners_before": [ "4K9sWUMFwTgaDGPfdynrbxWqWS6sWmKbZoTjxLtVUibD"