1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge remote-tracking branch 'origin/master' into Version-v10.25.0

This commit is contained in:
ryanml 2023-02-01 14:50:26 -07:00
commit fad3ebd476
10 changed files with 49 additions and 14 deletions

View File

@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Added displaying the primaryType during Typed data signing ([#17077](https://github.com/MetaMask/metamask-extension/pull/17077))
## [10.24.2]
### Fixed
- Fix incorrect network information after switching networks when "Show balance and token price checker" is toggled off ([#17450](https://github.com/MetaMask/metamask-extension/pull/17450))
- Improve rendering time of signTypedData confirmation screens for large payloads ([#17432](https://github.com/MetaMask/metamask-extension/pull/17432))
## [10.24.1]
### Added
- Ensure app name appears for Taiwanese language speakers in the extension stores ([#17304](https://github.com/MetaMask/metamask-extension/pull/17304))
## [10.24.0]
### Added
- Add NFT setApprovalForAll warning popover when approving the NFT Colleciton ([#16195](https://github.com/MetaMask/metamask-extension/pull/16195))
@ -3427,6 +3436,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.25.0...HEAD
[10.25.0]: https://github.com/MetaMask/metamask-extension/compare/v10.24.0...v10.25.0
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.24.2...HEAD
[10.24.2]: https://github.com/MetaMask/metamask-extension/compare/v10.24.1...v10.24.2
[10.24.1]: https://github.com/MetaMask/metamask-extension/compare/v10.24.0...v10.24.1
[10.24.0]: https://github.com/MetaMask/metamask-extension/compare/v10.23.3...v10.24.0
[10.23.3]: https://github.com/MetaMask/metamask-extension/compare/v10.23.2...v10.23.3
[10.23.2]: https://github.com/MetaMask/metamask-extension/compare/v10.23.1...v10.23.2

View File

@ -87,6 +87,7 @@
},
"resolutions": {
"analytics-node/axios": "^0.21.2",
"cookiejar": "^2.1.4",
"ganache-core/lodash": "^4.17.21",
"netmask": "^2.0.1",
"pubnub/superagent-proxy": "^3.0.0",

View File

@ -74,7 +74,8 @@
"network": "5",
"provider": {
"type": "rpc",
"chainId": "0x5"
"chainId": "0x5",
"ticker": "ETH"
},
"keyrings": [
{

View File

@ -18,6 +18,9 @@ describe('TransactionActivityLog container', () => {
conversionRate: 280.45,
nativeCurrency: 'ETH',
frequentRpcListDetail: [],
provider: {
ticker: 'ETH',
},
},
};
@ -43,6 +46,7 @@ describe('TransactionActivityLog container', () => {
],
provider: {
rpcUrl: 'https://customnetwork.com/',
ticker: 'ETH',
},
},
};

View File

@ -290,6 +290,9 @@ describe('Confirm Transaction Duck', () => {
metamask: {
conversionRate: 468.58,
currentCurrency: 'usd',
provider: {
ticker: 'ETH',
},
},
confirmTransaction: {
ethTransactionAmount: '1',

View File

@ -10,6 +10,7 @@ import {
accountsWithSendEtherInfoSelector,
checkNetworkAndAccountSupports1559,
getAddressBook,
getUseCurrencyRateCheck,
} from '../../selectors';
import { updateTransactionGasFees } from '../../store/actions';
import { setCustomGasLimit, setCustomGasPrice } from '../gas/gas.duck';
@ -304,7 +305,10 @@ export function getConversionRate(state) {
}
export function getNativeCurrency(state) {
return state.metamask.nativeCurrency;
const useCurrencyRateCheck = getUseCurrencyRateCheck(state);
return useCurrencyRateCheck
? state.metamask.nativeCurrency
: state.metamask.provider.ticker;
}
export function getSendHexDataFeatureFlagState(state) {

View File

@ -40,10 +40,12 @@ describe('MetaMask Reducers', () => {
currentBlockGasLimit: '0x4c1878',
conversionRate: 1200.88200327,
nativeCurrency: 'ETH',
useCurrencyRateCheck: true,
network: '5',
provider: {
type: 'testnet',
chainId: '0x5',
ticker: 'TestETH',
},
accounts: {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': {
@ -308,9 +310,21 @@ describe('MetaMask Reducers', () => {
});
describe('getNativeCurrency()', () => {
it('should return the ticker symbol of the selected network', () => {
it('should return nativeCurrency when useCurrencyRateCheck is true', () => {
expect(getNativeCurrency(mockState)).toStrictEqual('ETH');
});
it('should return the ticker symbol of the selected network when useCurrencyRateCheck is false', () => {
expect(
getNativeCurrency({
...mockState,
metamask: {
...mockState.metamask,
useCurrencyRateCheck: false,
},
}),
).toStrictEqual('TestETH');
});
});
describe('getSendHexDataFeatureFlagState()', () => {

View File

@ -60,9 +60,8 @@ export default function GasDisplay({ gasError }) {
const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck);
const { showFiatInTestnets, useNativeCurrencyAsPrimaryCurrency } =
useSelector(getPreferences);
const { nativeCurrency, provider, unapprovedTxs } = useSelector(
(state) => state.metamask,
);
const { provider, unapprovedTxs } = useSelector((state) => state.metamask);
const nativeCurrency = provider.ticker;
const { chainId } = provider;
const networkName = NETWORK_TO_NAME_MAP[chainId];
const isInsufficientTokenError =

View File

@ -31,10 +31,8 @@ exports[`SendContent Component render should match snapshot 1`] = `
<div
class="send-v2__asset-dropdown__asset-icon"
>
<img
alt=""
class="identicon"
src="./images/eth_logo.svg"
<div
class="identicon__image-border"
style="height: 36px; width: 36px; border-radius: 18px;"
/>
</div>
@ -43,9 +41,7 @@ exports[`SendContent Component render should match snapshot 1`] = `
>
<div
class="send-v2__asset-dropdown__symbol"
>
ETH
</div>
/>
<div
class="send-v2__asset-dropdown__name"
>

View File

@ -831,8 +831,9 @@ export const getMemoizedMetadataContractName = createDeepEqualSelector(
getTokenList,
(_tokenList, address) => address,
(tokenList, address) => {
const checksumHexAddress = toChecksumHexAddress(address);
const entry = Object.values(tokenList).find((identity) =>
isEqualCaseInsensitive(identity.address, toChecksumHexAddress(address)),
isEqualCaseInsensitive(identity.address, checksumHexAddress),
);
return entry && entry.name !== '' ? entry.name : '';
},