Dust: Add test: OP_RETURN is not dust

This commit is contained in:
Esteban Ordano 2015-02-06 09:24:47 -03:00
parent 89400c0a56
commit d136715322
1 changed files with 11 additions and 1 deletions

View File

@ -279,7 +279,7 @@ describe('Transaction', function() {
return transaction.serialize();
}).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()
.from(simpleUtxoWith1BTC)
.to(toAddress, 1)
@ -289,6 +289,16 @@ describe('Transaction', function() {
return transaction.serialize();
}).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() {