wallet-test: missing output error
This commit is contained in:
parent
a2bf18ff18
commit
e40e1c263c
@ -18,6 +18,7 @@ const Input = require('../lib/primitives/input');
|
||||
const Outpoint = require('../lib/primitives/outpoint');
|
||||
const Script = require('../lib/script/script');
|
||||
const HD = require('../lib/hd');
|
||||
const Wallet = require('../lib/wallet/wallet');
|
||||
|
||||
const KEY1 = 'xprv9s21ZrQH143K3Aj6xQBymM31Zb4BVc7wxqfUhMZrzewdDVCt'
|
||||
+ 'qUP9iWfcHgJofs25xbaUpCps9GDXj83NiWvQCAkWQhVj5J4CorfnpKX94AZ';
|
||||
@ -1642,6 +1643,21 @@ describe('Wallet', function() {
|
||||
});
|
||||
}
|
||||
|
||||
it('should throw error with missing outputs', async () => {
|
||||
const wallet = new Wallet({});
|
||||
|
||||
let err = null;
|
||||
|
||||
try {
|
||||
await wallet.send({outputs: []});
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
||||
assert(err);
|
||||
assert.equal(err.message, 'At least one output required.');
|
||||
});
|
||||
|
||||
it('should cleanup', async () => {
|
||||
consensus.COINBASE_MATURITY = 100;
|
||||
// await wdb.close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user