From dfbfdafc94962236428a46d486f081f63a1f59a5 Mon Sep 17 00:00:00 2001 From: William Cotton Date: Fri, 25 Apr 2014 13:43:26 -0700 Subject: [PATCH] added tests for createTx testnet and createTx custom changeAddress --- test/wallet.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/wallet.js b/test/wallet.js index 565e3c8..f5a3be7 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -459,6 +459,25 @@ describe('Wallet', function() { }) }) + describe('testnet', function(){ + it('should create transaction', function(){ + var to = 'mt7MyTVVEWnbwpF5hBn6fgnJcv95Syk2ue' + var wallet = new Wallet(seed, {network: 'testnet'}) + var tx = wallet.createTx(to, value) + assert.equal(tx.outs.length, 1) + }) + }) + + describe('changeAddress', function(){ + it('should allow custom changeAddress', function(){ + var to = "mt7MyTVVEWnbwpF5hBn6fgnJcv95Syk2ue" + var changeAddress = 'mfrFjnKZUvTcvdAK2fUX5D8v1Epu5H8JCk' + var wallet = new Wallet(seed, {network: 'testnet'}) + var tx = wallet.createTx(to, value, false, changeAddress) + assert.equal(tx.outs.length, 1) + }) + }) + describe('transaction outputs', function(){ it('includes the specified address and amount', function(){ var tx = wallet.createTx(to, value)