Skip to content

Commit

Permalink
older versions readme explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
manolodewiner committed Dec 20, 2017
1 parent e745b59 commit 2348a49
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
32 changes: 30 additions & 2 deletions docs/source/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 2348a49

Please sign in to comment.