Call the parent error of the fee errors FeeError for backwards compatibility.
This commit is contained in:
parent
8da9c4a44a
commit
b1e54101d3
@ -85,16 +85,16 @@ module.exports = [{
|
||||
name: 'InvalidSatoshis',
|
||||
message: 'Output satoshis are invalid',
|
||||
}, {
|
||||
name: 'Fee',
|
||||
name: 'FeeError',
|
||||
message: 'Internal Error on Fee {0}',
|
||||
errors: [{
|
||||
name: 'TooSmallError',
|
||||
name: 'TooSmall',
|
||||
message: 'Fee is too small: {0}',
|
||||
}, {
|
||||
name: 'TooLargeError',
|
||||
name: 'TooLarge',
|
||||
message: 'Fee is too large: {0}',
|
||||
}, {
|
||||
name: 'DifferentError',
|
||||
name: 'Different',
|
||||
message: 'Unspent value is different from specified fee: {0}',
|
||||
}]
|
||||
}, {
|
||||
|
||||
@ -203,16 +203,16 @@ Transaction.prototype.getSerializationError = function(opts) {
|
||||
var isFullySigned = this.isFullySigned();
|
||||
|
||||
if (!opts.disableDifferentFees && feeIsDifferent) {
|
||||
return new errors.Transaction.Fee.DifferentError(feeIsDifferent);
|
||||
return new errors.Transaction.FeeError.Different(feeIsDifferent);
|
||||
}
|
||||
if (!opts.disableLargeFees && feeIsTooLarge) {
|
||||
if (missingChange) {
|
||||
return new errors.Transaction.ChangeAddressMissing('Fee is too large and no change address was provided');
|
||||
}
|
||||
return new errors.Transaction.Fee.TooLargeError(feeIsTooLarge);
|
||||
return new errors.Transaction.FeeError.TooLarge(feeIsTooLarge);
|
||||
}
|
||||
if (!opts.disableSmallFees && feeIsTooSmall) {
|
||||
return new errors.Transaction.Fee.TooSmallError(feeIsTooSmall);
|
||||
return new errors.Transaction.FeeError.TooSmall(feeIsTooSmall);
|
||||
}
|
||||
if (!opts.disableDustOutputs && this._hasDustOutputs()) {
|
||||
return new errors.Transaction.DustOutputs();
|
||||
|
||||
@ -266,7 +266,7 @@ describe('Transaction', function() {
|
||||
.sign(privateKey);
|
||||
expect(function() {
|
||||
return transaction.serialize();
|
||||
}).to.throw(errors.Transaction.Fee.TooSmallError);
|
||||
}).to.throw(errors.Transaction.FeeError.TooSmall);
|
||||
});
|
||||
it('on second call to sign, change is not recalculated', function() {
|
||||
var transaction = new Transaction()
|
||||
@ -332,7 +332,7 @@ describe('Transaction', function() {
|
||||
.to(toAddress, 40000000);
|
||||
expect(function() {
|
||||
return transaction.serialize();
|
||||
}).to.throw(errors.Transaction.Fee.TooLargeError);
|
||||
}).to.throw(errors.Transaction.FeeError.TooLarge);
|
||||
});
|
||||
it('fails if a dust output is created', function() {
|
||||
var transaction = new Transaction()
|
||||
@ -372,7 +372,7 @@ describe('Transaction', function() {
|
||||
.sign(privateKey);
|
||||
expect(function() {
|
||||
return transaction.serialize();
|
||||
}).to.throw(errors.Transaction.Fee.DifferentError);
|
||||
}).to.throw(errors.Transaction.FeeError.Different);
|
||||
});
|
||||
describe('skipping checks', function() {
|
||||
var buildSkipTest = function(builder, check) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user