added tests for createTx testnet and createTx custom changeAddress
This commit is contained in:
parent
590bb8e1c3
commit
dfbfdafc94
1 changed files with 19 additions and 0 deletions
|
@ -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(){
|
describe('transaction outputs', function(){
|
||||||
it('includes the specified address and amount', function(){
|
it('includes the specified address and amount', function(){
|
||||||
var tx = wallet.createTx(to, value)
|
var tx = wallet.createTx(to, value)
|
||||||
|
|
Loading…
Reference in a new issue