Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 fix: insufficient balance error toast OK-27573 #4535

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading