Skip to content

Commit

Permalink
feat(suite): use min fee for bump evm chain fee
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Dec 27, 2024
1 parent 235294d commit 489029b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/suite/src/components/wallet/Fees/CustomFee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ export const CustomFee = <TFieldValues extends FormState>({
}),
range: (value: string) => {
const feeBig = new BigNumber(value);

if (feeBig.isGreaterThan(maxFee) || feeBig.isLessThan(minFee)) {
return translationString('CUSTOM_FEE_NOT_IN_RANGE', { minFee, maxFee });
return translationString('CUSTOM_FEE_NOT_IN_RANGE', {
minFee,
maxFee,
});
}
},
},
Expand Down
6 changes: 3 additions & 3 deletions packages/suite/src/hooks/wallet/useRbfForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const getEthereumFeeInfo = (info: FeeInfo, gasPrice: string) => {
const minFeeFromNetwork = new BigNumber(fromWei(feeInfo.levels[0].feePerUnit, 'gwei'));

const getFee = () => {
if (minFeeFromNetwork.lte(current.plus(1))) {
return current.plus(1);
if (minFeeFromNetwork.lte(current.plus(feeInfo.minFee))) {
return current.plus(feeInfo.minFee);
}

return minFeeFromNetwork;
Expand All @@ -74,7 +74,7 @@ const getEthereumFeeInfo = (info: FeeInfo, gasPrice: string) => {
return {
...feeInfo,
levels,
minFee: current.plus(1).toNumber(), // increase required minFee rate
minFee: current.plus(feeInfo.minFee).toNumber(), // increase required minFee rate
};
};

Expand Down

0 comments on commit 489029b

Please sign in to comment.