throws error on insufficient fund
This commit is contained in:
parent
7c81bfef72
commit
90921798cf
2 changed files with 19 additions and 0 deletions
test
|
@ -448,6 +448,16 @@ describe('Wallet', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('when there is not enough money', function(){
|
||||
it('throws an error', function(){
|
||||
var value = 1400001
|
||||
|
||||
assert.throws(function() {
|
||||
wallet.createTx(to, value)
|
||||
}, Error, 'Not enough money to send funds including transaction fee. Have: 1420000, needed: 1420001')
|
||||
})
|
||||
})
|
||||
|
||||
function fakeTxHash(i) {
|
||||
return "txtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtxtx" + i
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue