Skip to content

Commit

Permalink
fix: insufficient balance error toast (#4535)
Browse files Browse the repository at this point in the history
  • Loading branch information
weatherstar authored May 4, 2024
1 parent aa3694a commit 43df70a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/engine/src/vaults/impl/dynex/Vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import debugLogger from '@onekeyhq/shared/src/logger/debugLogger';
import { memoizee } from '@onekeyhq/shared/src/utils/cacheUtils';

import simpleDb from '../../../dbs/simple/simpleDb';
import { InvalidAddress, NotImplemented } from '../../../errors';
import {
InsufficientBalance,
InvalidAddress,
NotImplemented,
} from '../../../errors';
import {
type IApproveInfo,
type IDecodedTx,
Expand Down Expand Up @@ -417,7 +421,7 @@ export default class Vault extends VaultBase {
);

if (totalUnspentOutputsAmount.lte(fee)) {
throw new Error('Insufficient balance');
throw new InsufficientBalance();
}

if (totalUnspentOutputsAmount.lt(new BigNumber(finalAmount).plus(fee))) {
Expand Down

0 comments on commit 43df70a

Please sign in to comment.