From 9a9ab3b8837213c2e74526bfc5f3d3d0f10a222a Mon Sep 17 00:00:00 2001 From: junderw Date: Wed, 22 Aug 2018 14:33:58 +0900 Subject: [PATCH] Add examples to readme --- README.md | 5 +++++ test/integration/csv.js | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2a7b5b8..edcb265 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,11 @@ Some examples interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP). - [Create (and broadcast via 3PBP) a Transaction where Alice can redeem the output after the expiry (in the future)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/cltv.js#L88) - [Create (and broadcast via 3PBP) a Transaction where Alice and Bob can redeem the output at any time](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/cltv.js#L144) - [Create (but fail to broadcast via 3PBP) a Transaction where Alice attempts to redeem before the expiry](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/cltv.js#L190) +- [Create (and broadcast via 3PBP) a Transaction where Alice can redeem the output after the expiry (in the future) (simple CHECKSEQUENCEVERIFY)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.js#L72) +- [Create (but fail to broadcast via 3PBP) a Transaction where Alice attempts to redeem before the expiry (simple CHECKSEQUENCEVERIFY)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.js#L131) +- [Create (and broadcast via 3PBP) a Transaction where Bob and Charles can send (complex CHECKSEQUENCEVERIFY)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.js#L177) +- [Create (and broadcast via 3PBP) a Transaction where Alice (lawyer) and Bob can send after 2 blocks (complex CHECKSEQUENCEVERIFY)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.js#L234) +- [Create (and broadcast via 3PBP) a Transaction where Alice (lawyer) can send after 5 blocks (complex CHECKSEQUENCEVERIFY)](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.js#L296) - [Recover a private key from duplicate R values](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/crypto.js#L14) - [Recover a BIP32 parent private key from the parent public key, and a derived, non-hardened child private key](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/crypto.js#L68) - [Generate a single-key stealth address](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/stealth.js#L72) diff --git a/test/integration/csv.js b/test/integration/csv.js index dbfea1d..91e4ceb 100644 --- a/test/integration/csv.js +++ b/test/integration/csv.js @@ -69,7 +69,7 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { } // expiry will pass, {Alice's signature} OP_TRUE - it('can create (and broadcast via 3PBP) a Transaction where Alice can redeem the output after the expiry (in the future)', function (done) { + it('can create (and broadcast via 3PBP) a Transaction where Alice can redeem the output after the expiry (in the future) (simple CHECKSEQUENCEVERIFY)', function (done) { regtestUtils.height(function (err, height) { if (err) return done(err) @@ -128,7 +128,7 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { }) // expiry in the future, {Alice's signature} OP_TRUE - it('can create (but fail to broadcast via 3PBP) a Transaction where Alice attempts to redeem before the expiry', function (done) { + it('can create (but fail to broadcast via 3PBP) a Transaction where Alice attempts to redeem before the expiry (simple CHECKSEQUENCEVERIFY)', function (done) { // two hours after confirmation const sequence = bip68.encode({ seconds: 7168 }) const p2sh = bitcoin.payments.p2sh({ @@ -174,7 +174,7 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { }) // Check first combination of complex CSV, 2 of 3 - it('can create (and broadcast via 3PBP) a Transaction where Bob and Charles can send ', function (done) { + it('can create (and broadcast via 3PBP) a Transaction where Bob and Charles can send (complex CHECKSEQUENCEVERIFY)', function (done) { regtestUtils.height(function (err, height) { if (err) return done(err) @@ -231,7 +231,7 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { }) // Check first combination of complex CSV, lawyer + 1 of 3 after 2 blocks - it('can create (and broadcast via 3PBP) a Transaction where Alice (lawyer) and Bob can send after 2 blocks ', function (done) { + it('can create (and broadcast via 3PBP) a Transaction where Alice (lawyer) and Bob can send after 2 blocks (complex CHECKSEQUENCEVERIFY)', function (done) { regtestUtils.height(function (err, height) { if (err) return done(err) @@ -293,7 +293,7 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { }) // Check first combination of complex CSV, lawyer after 5 blocks - it('can create (and broadcast via 3PBP) a Transaction where Alice (lawyer) can send after 5 blocks ', function (done) { + it('can create (and broadcast via 3PBP) a Transaction where Alice (lawyer) can send after 5 blocks (complex CHECKSEQUENCEVERIFY)', function (done) { regtestUtils.height(function (err, height) { if (err) return done(err)