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 ### Fixed
- Added displaying the primaryType during Typed data signing ([#17077](https://github.com/MetaMask/metamask-extension/pull/17077)) - 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] ## [10.24.0]
### Added ### Added
- Add NFT setApprovalForAll warning popover when approving the NFT Colleciton ([#16195](https://github.com/MetaMask/metamask-extension/pull/16195)) - 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 [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 [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.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.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 [10.23.2]: https://github.com/MetaMask/metamask-extension/compare/v10.23.1...v10.23.2

View File

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

View File

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

View File

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

View File

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

View File

@ -10,6 +10,7 @@ import {
accountsWithSendEtherInfoSelector, accountsWithSendEtherInfoSelector,
checkNetworkAndAccountSupports1559, checkNetworkAndAccountSupports1559,
getAddressBook, getAddressBook,
getUseCurrencyRateCheck,
} from '../../selectors'; } from '../../selectors';
import { updateTransactionGasFees } from '../../store/actions'; import { updateTransactionGasFees } from '../../store/actions';
import { setCustomGasLimit, setCustomGasPrice } from '../gas/gas.duck'; import { setCustomGasLimit, setCustomGasPrice } from '../gas/gas.duck';
@ -304,7 +305,10 @@ export function getConversionRate(state) {
} }
export function getNativeCurrency(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) { export function getSendHexDataFeatureFlagState(state) {

View File

@ -40,10 +40,12 @@ describe('MetaMask Reducers', () => {
currentBlockGasLimit: '0x4c1878', currentBlockGasLimit: '0x4c1878',
conversionRate: 1200.88200327, conversionRate: 1200.88200327,
nativeCurrency: 'ETH', nativeCurrency: 'ETH',
useCurrencyRateCheck: true,
network: '5', network: '5',
provider: { provider: {
type: 'testnet', type: 'testnet',
chainId: '0x5', chainId: '0x5',
ticker: 'TestETH',
}, },
accounts: { accounts: {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': {
@ -308,9 +310,21 @@ describe('MetaMask Reducers', () => {
}); });
describe('getNativeCurrency()', () => { 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'); 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()', () => { describe('getSendHexDataFeatureFlagState()', () => {

View File

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

View File

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

View File

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