Skip to content

Commit

Permalink
refactor(crypto): change MaximumPaymentCountExceededError error (#3152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemii authored and faustbrian committed Oct 29, 2019
1 parent 8b64f7f commit 6b3e0cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/crypto/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export class MissingMilestoneFeeError extends CryptoError {
}

export class MaximumPaymentCountExceededError extends CryptoError {
constructor(given: number) {
super(`Expected a maximum of 500 payments, but got ${given}.`);
constructor(limit: number) {
super(`Number of payments exceeded the allowed maximum of ${limit}.`);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class MultiPaymentBuilder extends TransactionBuilder<MultiPaymentBuilder>
const limit: number = configManager.getMilestone().multiPaymentLimit || 500;

if (this.data.asset.payments.length >= limit) {
throw new MaximumPaymentCountExceededError(this.data.asset.payments.length + 1);
throw new MaximumPaymentCountExceededError(limit);
}

this.data.asset.payments.push({
Expand Down

0 comments on commit 6b3e0cb

Please sign in to comment.