fix test involving fee and dust.
This commit is contained in:
parent
d54a532a66
commit
33a60e59f2
@ -212,7 +212,7 @@ describe('Wallet', function() {
|
|||||||
tx.out(to, 5460);
|
tx.out(to, 5460);
|
||||||
|
|
||||||
var cost = tx.funds('out');
|
var cost = tx.funds('out');
|
||||||
var total = cost.add(new bn(w1.fee));
|
var total = cost.add(new bn(bcoin.tx.fee));
|
||||||
|
|
||||||
var unspent1 = w1.unspent();
|
var unspent1 = w1.unspent();
|
||||||
var unspent2 = w2.unspent();
|
var unspent2 = w2.unspent();
|
||||||
@ -226,7 +226,7 @@ describe('Wallet', function() {
|
|||||||
tx.input(unspent2[0]);
|
tx.input(unspent2[0]);
|
||||||
|
|
||||||
var left = tx.funds('in').sub(total);
|
var left = tx.funds('in').sub(total);
|
||||||
if (left.cmpn(w1.dust) < 0) {
|
if (left.cmpn(bcoin.tx.dust) < 0) {
|
||||||
tx.outputs[tx.outputs.length - 2].value.iadd(left);
|
tx.outputs[tx.outputs.length - 2].value.iadd(left);
|
||||||
left = new bn(0);
|
left = new bn(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user