Skip to content

Commit

Permalink
feat: InactiveAccountError -> SmallAmountError
Browse files Browse the repository at this point in the history
  • Loading branch information
mahnunchik committed Aug 30, 2023
1 parent 77fd951 commit 6724a4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/RippleWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class RippleWallet extends CsWallet {
async validateAmount({ address, amount, meta = {} }) {
super.validateAmount({ address, amount, meta });
if (!this.#isActive) {
throw new errors.InactiveAccountError();
throw new errors.SmallAmountError(new Amount(this.#dustThreshold, this.crypto.decimals));
}
const { value } = amount;
if (value < this.#dustThreshold) {
Expand Down
5 changes: 3 additions & 2 deletions test/wallet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,9 @@ describe('Ripple Wallet', () => {
amount: new Amount(123n, wallet.crypto.decimals),
});
}, {
name: 'InactiveAccountError',
message: 'Inactive account',
name: 'SmallAmountError',
message: 'Small amount',
amount: new Amount(1n, wallet.crypto.decimals),
});
});

Expand Down

0 comments on commit 6724a4f

Please sign in to comment.