From 2348a49965bf15400f17f077a52a2083d8142eb6 Mon Sep 17 00:00:00 2001 From: manolodewiner Date: Wed, 20 Dec 2017 11:32:34 +0100 Subject: [PATCH] older versions readme explanation --- README.md | 2 +- docs/source/readme.rst | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ce90b26..ad80009e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ | ----------------- |------------------------------| | `0.10` | `0.1.x` | | `1.0.0` | `0.3.x` | -| `>= 1.3.0` | `>= 3.1.x` | +| `>= 1.3.0` | `3.x.x` | ## Breaking changes Version 3.2 of BigchainDB JavaScript Driver introduces a new way of creating transfer transactions. Check [older versions](https://docs.bigchaindb.com/projects/js-driver/en/latest/readme.html#features) diff --git a/docs/source/readme.rst b/docs/source/readme.rst index 50095ad8..afccbd17 100644 --- a/docs/source/readme.rst +++ b/docs/source/readme.rst @@ -34,13 +34,13 @@ Compatibility Matrix +-----------------------+----------------------------------+ | ``1.0`` | ``0.3.x`` | +-----------------------+----------------------------------+ -| ``1.3`` | ``3.1.x`` | +| ``1.3`` | ``3.x.x`` | +-----------------------+----------------------------------+ Older versions -------------------- -For versions below 3.2, the transfer transaction is like this: +For versions below 3.2, a transfer transaction looked like: .. code-block:: js @@ -52,3 +52,31 @@ For versions below 3.2, the transfer transaction is like this: ) const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey) + + +In order to upgrade and do it compatible with the new driver version, this transaction should be now: + +.. code-block:: js + + const createTranfer = BigchainDB.Transaction.makeTransferTransaction( + [{ tx: txCreated, output_index: 0 }], + [aliceOutput], + metaData + ) + + const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey) + + +The upgrade allows to create transfer transaction spending outputs that belong to different transactions. +So for instance is now possible to create a transfer transaction spending two outputs from two different create transactions: + + +.. code-block:: js + + const createTranfer = BigchainDB.Transaction.makeTransferTransaction( + [{ tx: txCreated1, output_index: 0 }, { tx: txCreated2, output_index: 0 }], + [aliceOutput], + metaData + ) + + const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey)