1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Fix copy issues related to layer 2 fee changes (#12667)

This commit is contained in:
Dan J Miller 2021-11-11 20:45:43 -03:30 committed by Dan Miller
parent 18c10c8bc2
commit 15a4ab7381
3 changed files with 13 additions and 6 deletions

View File

@ -2822,13 +2822,13 @@
"message": "Base Fee (GWEI)" "message": "Base Fee (GWEI)"
}, },
"transactionHistoryL1GasLabel": { "transactionHistoryL1GasLabel": {
"message": "Total L1 gas fee" "message": "Total L1 Gas Fee"
}, },
"transactionHistoryL2GasLimitLabel": { "transactionHistoryL2GasLimitLabel": {
"message": "L2 gas limit`" "message": "L2 Gas Limit"
}, },
"transactionHistoryL2GasPriceLabel": { "transactionHistoryL2GasPriceLabel": {
"message": "L2 gas price`" "message": "L2 Gas Price"
}, },
"transactionHistoryMaxFeePerGas": { "transactionHistoryMaxFeePerGas": {
"message": "Max Fee Per Gas" "message": "Max Fee Per Gas"

View File

@ -10,7 +10,11 @@ import {
toNormalizedDenomination, toNormalizedDenomination,
} from '../../../../shared/modules/conversion.utils'; } from '../../../../shared/modules/conversion.utils';
export default function MultilayerFeeMessage({ transaction, layer2fee }) { export default function MultilayerFeeMessage({
transaction,
layer2fee,
nativeCurrency,
}) {
const t = useContext(I18nContext); const t = useContext(I18nContext);
const [fetchedLayer1Total, setLayer1Total] = useState(null); const [fetchedLayer1Total, setLayer1Total] = useState(null);
@ -21,7 +25,7 @@ export default function MultilayerFeeMessage({ transaction, layer2fee }) {
const layer1TotalBN = toBigNumber.hex(fetchedLayer1Total); const layer1TotalBN = toBigNumber.hex(fetchedLayer1Total);
layer1Total = `${toNormalizedDenomination layer1Total = `${toNormalizedDenomination
.WEI(layer1TotalBN) .WEI(layer1TotalBN)
.toString(10)} ETH`; .toString(10)} ${nativeCurrency}`;
} }
const totalInWeiHex = sumHexes( const totalInWeiHex = sumHexes(
@ -32,7 +36,7 @@ export default function MultilayerFeeMessage({ transaction, layer2fee }) {
const totalBN = toBigNumber.hex(totalInWeiHex); const totalBN = toBigNumber.hex(totalInWeiHex);
const totalInEth = `${toNormalizedDenomination const totalInEth = `${toNormalizedDenomination
.WEI(totalBN) .WEI(totalBN)
.toString(10)} ETH`; .toString(10)} ${nativeCurrency}`;
useEffect(() => { useEffect(() => {
const getEstimatedL1Fee = async () => { const getEstimatedL1Fee = async () => {
@ -67,4 +71,5 @@ export default function MultilayerFeeMessage({ transaction, layer2fee }) {
MultilayerFeeMessage.propTypes = { MultilayerFeeMessage.propTypes = {
transaction: PropTypes.object, transaction: PropTypes.object,
layer2fee: PropTypes.string, layer2fee: PropTypes.string,
nativeCurrency: PropTypes.string,
}; };

View File

@ -313,6 +313,7 @@ export default class ConfirmTransactionBase extends Component {
showLedgerSteps, showLedgerSteps,
supportsEIP1559, supportsEIP1559,
isMultiLayerFeeNetwork, isMultiLayerFeeNetwork,
nativeCurrency,
} = this.props; } = this.props;
const { t } = this.context; const { t } = this.context;
@ -533,6 +534,7 @@ export default class ConfirmTransactionBase extends Component {
<MultiLayerFeeMessage <MultiLayerFeeMessage
transaction={txData} transaction={txData}
layer2fee={hexMinimumTransactionFee} layer2fee={hexMinimumTransactionFee}
nativeCurrency={nativeCurrency}
/> />
), ),
!isMultiLayerFeeNetwork && ( !isMultiLayerFeeNetwork && (