added tests for createTx testnet and createTx custom changeAddress

This commit is contained in:
William Cotton 2014-04-25 13:43:26 -07:00
parent 590bb8e1c3
commit dfbfdafc94

View file

@ -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)