Dust: Add test: OP_RETURN is not dust
This commit is contained in:
parent
89400c0a56
commit
d136715322
@ -279,7 +279,7 @@ describe('Transaction', function() {
|
|||||||
return transaction.serialize();
|
return transaction.serialize();
|
||||||
}).to.throw(errors.Transaction.FeeError);
|
}).to.throw(errors.Transaction.FeeError);
|
||||||
});
|
});
|
||||||
it('fails if a dust transaction is created', function() {
|
it('fails if a dust output is created', function() {
|
||||||
var transaction = new Transaction()
|
var transaction = new Transaction()
|
||||||
.from(simpleUtxoWith1BTC)
|
.from(simpleUtxoWith1BTC)
|
||||||
.to(toAddress, 1)
|
.to(toAddress, 1)
|
||||||
@ -289,6 +289,16 @@ describe('Transaction', function() {
|
|||||||
return transaction.serialize();
|
return transaction.serialize();
|
||||||
}).to.throw(errors.Transaction.DustOutputs);
|
}).to.throw(errors.Transaction.DustOutputs);
|
||||||
});
|
});
|
||||||
|
it('doesn\'t fail if a dust output is an op_return', function() {
|
||||||
|
var transaction = new Transaction()
|
||||||
|
.from(simpleUtxoWith1BTC)
|
||||||
|
.addData('not dust!')
|
||||||
|
.change(changeAddress)
|
||||||
|
.sign(privateKey);
|
||||||
|
expect(function() {
|
||||||
|
return transaction.serialize();
|
||||||
|
}).to.not.throw(errors.Transaction.DustOutputs);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('to and from JSON', function() {
|
describe('to and from JSON', function() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user