From 89a12cdc37fc2631f0a87bead82958a06a0a1cde Mon Sep 17 00:00:00 2001 From: Albina Nikiforova Date: Wed, 26 Feb 2025 13:48:02 +0100 Subject: [PATCH] chore(suite): prepare for independent from eip1559 merge --- .../TransactionReviewSummary.tsx | 8 ++-- .../Fees/CustomFee/CustomFeeEthereum.tsx | 47 ++++++++++--------- packages/suite/src/support/messages.ts | 5 -- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx index eb0d1b3bd48..6d636e19b10 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx @@ -1,5 +1,5 @@ import { formatDurationStrict } from '@suite-common/suite-utils'; -import { NetworkType, getNetworkFeatures, networks } from '@suite-common/wallet-config'; +import { NetworkType, networks } from '@suite-common/wallet-config'; import { FeeInfo, GeneralPrecomposedTransactionFinal, StakeType } from '@suite-common/wallet-types'; import { getFee, getFeeUnits } from '@suite-common/wallet-utils'; import { Box, IconButton, Note, Row, Text } from '@trezor/components'; @@ -51,10 +51,10 @@ export const TransactionReviewSummary = ({ const network = networks[symbol]; const baseFee = fees[symbol].levels[0].baseFeePerGas; - const hasEip1559Feature = getNetworkFeatures(symbol).includes('eip1559'); + const hasEip1559Feature = false; + // getNetworkFeatures(symbol).includes('eip1559') const shouldUsePriorityFees = !!tx.fee && hasEip1559Feature && !!baseFee; - console.log('shouldUsePriorityFees', shouldUsePriorityFees, tx, hasEip1559Feature, baseFee); - const fee = getFee({ account, tx, shouldUsePriorityFees }); + const fee = getFee(networkType, tx); const estimateTime = getEstimatedTime(networkType, fees[account.symbol], tx); diff --git a/packages/suite/src/components/wallet/Fees/CustomFee/CustomFeeEthereum.tsx b/packages/suite/src/components/wallet/Fees/CustomFee/CustomFeeEthereum.tsx index 2ac1cf49f90..27080c55d13 100644 --- a/packages/suite/src/components/wallet/Fees/CustomFee/CustomFeeEthereum.tsx +++ b/packages/suite/src/components/wallet/Fees/CustomFee/CustomFeeEthereum.tsx @@ -39,8 +39,10 @@ export const CustomFeeEthereum = ({ const estimatedFeeLimit = getValues('estimatedFeeLimit'); const feePerUnitError = errors.feePerUnit; const feeLimitError = errors.feeLimit; - const customMaxBaseFeePerGasError = errors.customMaxBaseFeePerGas; - const customMaxPriorityFeePerGasError = errors.customMaxPriorityFeePerGas; + const customMaxBaseFeePerGasError = undefined; // prepared for when priority fee is implemented + const customMaxPriorityFeePerGasError = undefined; // prepared for when priority fee is implemented + // const customMaxBaseFeePerGasError = errors.customMaxBaseFeePerGas; + // const customMaxPriorityFeePerGasError = errors.customMaxPriorityFeePerGas; const feeLimitRules = { required: translationString('GAS_LIMIT_IS_NOT_SET'), @@ -109,19 +111,18 @@ export const CustomFeeEthereum = ({ const feeLimitValidationButtonProps = feeLimitError?.type === 'feeLimit' ? feeLimitValidationProps : undefined; - const customMaxBaseFeeValidationProps = { - onClick: () => - estimatedFeeLimit && - setValue(CUSTOM_MAX_BASE_FEE_PER_GAS, currentBaseFee, { - shouldValidate: true, - }), - text: translationString('TR_CUSTOM_MAX_BASE_FEE_USE_NETWORK_BASE_FEE'), - }; + // const customMaxBaseFeeValidationProps = { + // onClick: () => + // estimatedFeeLimit && + // setValue(CUSTOM_MAX_BASE_FEE_PER_GAS, currentBaseFee, { + // shouldValidate: true, + // }), + // text: translationString('TR_CUSTOM_MAX_BASE_FEE_USE_NETWORK_BASE_FEE'), + // }; - const customMaxBaseFeeValidationButtonProps = - customMaxBaseFeePerGasError?.type === 'customMaxBaseFeePerGas' - ? customMaxBaseFeeValidationProps - : undefined; + // const customMaxBaseFeeValidationButtonProps = customMaxBaseFeePerGasError?.type === 'customMaxBaseFeePerGas' + // ? customMaxBaseFeeValidationProps + // : undefined; const gasLimitInput = ( ({ data-testid={CUSTOM_MAX_BASE_FEE_PER_GAS} rules={customMaxBaseFeePerGasRules} bottomText={ - customMaxBaseFeePerGasError?.message ? ( - - ) : null + // customMaxBaseFeePerGasError?.message ? ( + // + // ) : + null } /> ({ name={CUSTOM_MAX_PRIORITY_FEE_PER_GAS} data-testid={CUSTOM_MAX_PRIORITY_FEE_PER_GAS} rules={customMaxPriorityFeePerGasRules} - bottomText={customMaxPriorityFeePerGasError?.message || null} + bottomText={ + // customMaxPriorityFeePerGasError?.message || + null + } /> ); diff --git a/packages/suite/src/support/messages.ts b/packages/suite/src/support/messages.ts index 5046843fc06..3ddc70f5d84 100644 --- a/packages/suite/src/support/messages.ts +++ b/packages/suite/src/support/messages.ts @@ -3430,11 +3430,6 @@ export default defineMessages({ id: 'TR_CUSTOM_MAX_BASE_FEE_USE_NETWORK_BASE_FEE', defaultMessage: 'Use network base fee', }, - - TR_MINIMUM_FEE_PER_GAS: { - id: 'TR_MINIMUM_FEE_PER_GAS', - defaultMessage: 'Minimum fee per gas', - }, GAS_LIMIT_IS_NOT_SET: { id: 'GAS_LIMIT_IS_NOT_SET', defaultMessage: 'Set gas limit for this transaction',