Skip to content

Commit

Permalink
Merge branch 'main' into feat/stake-884-add-more-mobile-pooled-stakin…
Browse files Browse the repository at this point in the history
…g-events
  • Loading branch information
Matt561 authored Dec 12, 2024
2 parents 60f1ec1 + 715476c commit d489b7e
Show file tree
Hide file tree
Showing 40 changed files with 646 additions and 102 deletions.
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,68 @@

## Current Main Branch

## 7.37.0 - Nov 28, 2024
### Added
- [#12091](https://github.com/MetaMask/metamask-mobile/pull/12091): feat: 2020 Add a performance test for iOS in Bitrise (#12091)
- [#12148](https://github.com/MetaMask/metamask-mobile/pull/12148): feat: Enable smart transactions for new users (#12148)
- [#12442](https://github.com/MetaMask/metamask-mobile/pull/12442): test: add a new unit test to cover for multichain feature flags ON (#12442)
- [#12420](https://github.com/MetaMask/metamask-mobile/pull/12420): feat(3598): non permitted chain flow small improvements (#12420)
- [#12198](https://github.com/MetaMask/metamask-mobile/pull/12198): feat: custom names for snap accounts (Flask only) (#12198)
- [#12396](https://github.com/MetaMask/metamask-mobile/pull/12396): feat(ramp): enable buy button in asset overview (#12396)
- [#11613](https://github.com/MetaMask/metamask-mobile/pull/11613): feat(ramp): improve amount editing formatting (#11613)
- [#12393](https://github.com/MetaMask/metamask-mobile/pull/12393): feat: Creating data tree for signed type V1 signatures (#12393)
- [#12160](https://github.com/MetaMask/metamask-mobile/pull/12160): feat: Integrate NFT api to display image & names in simulations includes `erc721`s (#12160)
- [#12324](https://github.com/MetaMask/metamask-mobile/pull/12324): feat: confirmation re-designs add basic page for types sign V1 signature request (#12324)
- [#11424](https://github.com/MetaMask/metamask-mobile/pull/11424): feat: add workflow for updating automated test results in TestRail (#11424)
- [#12337](https://github.com/MetaMask/metamask-mobile/pull/12337): feat: updated staking events to use withMetaMetrics helper (#12337)
- [#12363](https://github.com/MetaMask/metamask-mobile/pull/12363): feat: add PooledStaking slice for managing staking state (#12363)
- [#12398](https://github.com/MetaMask/metamask-mobile/pull/12398): feat: limit input digits to 12 in useInputHandler (#12398)
- [#12344](https://github.com/MetaMask/metamask-mobile/pull/12344): feat: upgrade assets controllers to v44 (#12344)
- [#12340](https://github.com/MetaMask/metamask-mobile/pull/12340): feat: upgrade assets controllers to version 43 (#12340)
- [#12270](https://github.com/MetaMask/metamask-mobile/pull/12270): feat: upgrade assets controllers to 42 with multichain token rates (#12270)
- [#12452](https://github.com/MetaMask/metamask-mobile/pull/12452): feat: updated staking events to use withMetaMetrics helper (#12337) (#12452)

### Changed
- [#12356](https://github.com/MetaMask/metamask-mobile/pull/12356): chore: Remove unnecessary event prop (#12356)
- [#12425](https://github.com/MetaMask/metamask-mobile/pull/12425): ci: create ci workflow for multichain flow (#12425)
- [#12350](https://github.com/MetaMask/metamask-mobile/pull/12350): chore: Bump Snaps packages (#12350)
- [#11409](https://github.com/MetaMask/metamask-mobile/pull/11409): refactor: use `withKeyring` to batch account restore operation (#11409)
- [#12339](https://github.com/MetaMask/metamask-mobile/pull/12339): chore: Update accounts-controller @v19.0.0 and keyring-controller @v18.0.0 (#12339)
- [#12440](https://github.com/MetaMask/metamask-mobile/pull/12440): chore(ramp): upgrade sdk to 1.28.7 (#12440)
- [#12351](https://github.com/MetaMask/metamask-mobile/pull/12351): refactor(ramp): remove anonymous events (#12351)
- [#12355](https://github.com/MetaMask/metamask-mobile/pull/12355): chore: Add missing confirmation unit tests (#12355)
- [#12369](https://github.com/MetaMask/metamask-mobile/pull/12369): chore: upgrade transaction controller to increase polling rate (#12369)
- [#12202](https://github.com/MetaMask/metamask-mobile/pull/12202): refactor: update swaps quote poll count (#12202)
- [#10743](https://github.com/MetaMask/metamask-mobile/pull/10743): chore: @metamask/swaps-controller v9 -> v10 (#10743)
- [#12415](https://github.com/MetaMask/metamask-mobile/pull/12415): chore: Cherry pick 2506358 (merge in trackEvent work) (#12415)
- [#12238](https://github.com/MetaMask/metamask-mobile/pull/12238): chore: update codeowners (#12238)
- [#12416](https://github.com/MetaMask/metamask-mobile/pull/12416): chore: Chore/update accounts controller messenger code owner (#12416)
- [#12366](https://github.com/MetaMask/metamask-mobile/pull/12366): chore: #12184 MVP split engine file (#12366)
- [#12362](https://github.com/MetaMask/metamask-mobile/pull/12362): chore: Unit tests for tags approval controller undefined (#12362)
- [#12343](https://github.com/MetaMask/metamask-mobile/pull/12343): chore: Cherry pick f35d583 (#12343)
- [#12332](https://github.com/MetaMask/metamask-mobile/pull/12332): chore: do not show staked eth balance when balance is zero on homepage or asset detail (#12332)
- [#12413](https://github.com/MetaMask/metamask-mobile/pull/12413): chore: simplify cicd rls script (#12413)
- [#12334](https://github.com/MetaMask/metamask-mobile/pull/12334): chore: updating filter icon (#12334)

### Fixed
- [#12313](https://github.com/MetaMask/metamask-mobile/pull/12313): fix: Remove run all tests section (#12313)
- [#12489](https://github.com/MetaMask/metamask-mobile/pull/12489): fix: replace end of navigation init and UIStartup span (#12489)
- [#12331](https://github.com/MetaMask/metamask-mobile/pull/12331): fix: tags pending approvals receiving undefined (#12331)
- [#10486](https://github.com/MetaMask/metamask-mobile/pull/10486): fix: limit ReactNativeWebview message size (#10486)
- [#12478](https://github.com/MetaMask/metamask-mobile/pull/12478): fix: incorrect event source in analytics and connection (#12478)
- [#10786](https://github.com/MetaMask/metamask-mobile/pull/10786): fix: added icon to walletconnect metadata (#10786)
- [#12455](https://github.com/MetaMask/metamask-mobile/pull/12455): fix: gas fee edit from swaps (#12455)
- [#12370](https://github.com/MetaMask/metamask-mobile/pull/12370): fix: Fix copy of ""Network fee"" on approval (#12370)
- [#12273](https://github.com/MetaMask/metamask-mobile/pull/12273): fix: Disable confirm button if `transactionMeta` is undefined (#12273)
- [#12367](https://github.com/MetaMask/metamask-mobile/pull/12367): fix: app crashing after send or swap (#12367)
- [#12446](https://github.com/MetaMask/metamask-mobile/pull/12446): fix: update wallet_addEthereumChain.js with correct MetricsEventBuilder (#12446)
- [#12180](https://github.com/MetaMask/metamask-mobile/pull/12180): fix: trackevent enabled is undefined (#12180)
- [#12315](https://github.com/MetaMask/metamask-mobile/pull/12315): fix: e2e: ensure Decrypt button is displayed (#12315)
- [#12402](https://github.com/MetaMask/metamask-mobile/pull/12402): fix: fix missing variable patch (#12402)
- [#12319](https://github.com/MetaMask/metamask-mobile/pull/12319): fix: hide rpc url selector for networks with one rpc (#12319)
- [#12371](https://github.com/MetaMask/metamask-mobile/pull/12371): fix: fix patch missing variable sentry error (#12371)
- [#12375](https://github.com/MetaMask/metamask-mobile/pull/12375): fix: breaking selector due to missing controller state (#12375)

## 7.36.0 - Nov 15, 2024
### Added
- [#12015](https://github.com/MetaMask/metamask-mobile/pull/12015): feat: 1957 crash screen redesign (#12015)
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1505
versionName "7.36.0"
versionName "7.37.0"
versionCode 1512
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 3 additions & 0 deletions app/components/UI/PermissionsSummary/PermissionsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ const PermissionsSummary = ({
<Button
variant={ButtonVariants.Secondary}
label={strings('permissions.choose_from_permitted_networks')}
testID={
NetworkNonPemittedBottomSheetSelectorsIDs.CHOOSE_FROM_PERMITTED_NETWORKS_BUTTON
}
onPress={onChooseFromPermittedNetworks}
size={ButtonSize.Lg}
style={{
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Tokens/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ exports[`Tokens Portfolio View should match the snapshot when portfolio view is
}
}
>
Ethereum Main Network
All Networks
</Text>
<SvgMock
color="#141618"
Expand Down
13 changes: 13 additions & 0 deletions app/components/UI/Transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class Transactions extends PureComponent {
*/
onScrollThroughContent: PropTypes.func,
gasFeeEstimates: PropTypes.object,
/**
* Chain ID of the token
*/
tokenChainId: PropTypes.string,
};

static defaultProps = {
Expand Down Expand Up @@ -372,6 +376,15 @@ class Transactions extends PureComponent {
renderEmpty = () => {
const { colors, typography } = this.context || mockTheme;
const styles = createStyles(colors, typography);
if (this.props.tokenChainId !== this.props.chainId) {
return (
<View style={styles.emptyContainer}>
<Text style={styles.textTransactions}>
{strings('wallet.switch_network_to_view_transactions')}
</Text>
</View>
);
}
return (
<View style={styles.emptyContainer}>
<Text style={styles.text}>{strings('wallet.no_transactions')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import Button, {
ButtonVariants,
ButtonWidthTypes,
} from '../../../../component-library/components/Buttons/Button';
import { NetworkNonPemittedBottomSheetSelectorsIDs } from '../../../../../e2e/selectors/Network/NetworkNonPemittedBottomSheet.selectors';
import { handleNetworkSwitch } from '../../../../util/networks/handleNetworkSwitch';

const AccountPermissionsConnected = ({
Expand Down Expand Up @@ -215,6 +216,9 @@ const AccountPermissionsConnected = ({
style={styles.managePermissionsButton}
variant={ButtonVariants.Secondary}
label={strings('permissions.edit_permissions')}
testID={
NetworkNonPemittedBottomSheetSelectorsIDs.EDIT_PERMISSIONS_BUTTON
}
size={ButtonSize.Lg}
onPress={() => {
onSetPermissionsScreen(
Expand Down
11 changes: 8 additions & 3 deletions app/components/Views/Asset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from '../../../constants/transaction';
import AppConstants from '../../../core/AppConstants';
import {
swapsLivenessMultichainSelector,
swapsLivenessSelector,
swapsTokensMultiChainObjectSelector,
swapsTokensObjectSelector,
Expand Down Expand Up @@ -476,7 +477,9 @@ class Asset extends PureComponent {
const styles = createStyles(colors);
const asset = navigation && params;
const isSwapsFeatureLive = this.props.swapsIsLive;
const isNetworkAllowed = isSwapsAllowed(chainId);
const isNetworkAllowed = isPortfolioViewEnabled()
? isSwapsAllowed(asset.chainId)
: isSwapsAllowed(chainId);

const isAssetAllowed =
asset.isETH || asset.address?.toLowerCase() in this.props.swapsTokens;
Expand Down Expand Up @@ -529,8 +532,10 @@ class Asset extends PureComponent {

Asset.contextType = ThemeContext;

const mapStateToProps = (state) => ({
swapsIsLive: swapsLivenessSelector(state),
const mapStateToProps = (state, { route }) => ({
swapsIsLive: isPortfolioViewEnabled()
? swapsLivenessMultichainSelector(state, route.params.chainId)
: swapsLivenessSelector(state),
swapsTokens: isPortfolioViewEnabled()
? swapsTokensMultiChainObjectSelector(state)
: swapsTokensObjectSelector(state),
Expand Down
18 changes: 10 additions & 8 deletions app/components/Views/AssetOptions/AssetOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ const AssetOptions = (props: Props) => {
networkConfigurations[networkId as Hex]?.rpcEndpoints?.[
networkConfigurations[networkId as Hex]?.defaultRpcEndpointIndex
];
let providerConfigToken;
if (isPortfolioViewEnabled()) {
providerConfigToken = createProviderConfig(
tokenNetworkConfig,
tokenRpcEndpoint,
);
} else {
providerConfigToken = providerConfig;
}

const providerConfigToken = createProviderConfig(
tokenNetworkConfig,
tokenRpcEndpoint,
);

const providerConfigTokenExplorerToken = isPortfolioViewEnabled()
? providerConfigToken
: providerConfig;
const providerConfigTokenExplorerToken = providerConfigToken;

return {
providerConfigTokenExplorer: providerConfigTokenExplorerToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { PermissionKeys } from '../../../../core/Permissions/specifications';
import { CaveatTypes } from '../../../../core/Permissions/constants';
import { getNetworkImageSource } from '../../../../util/networks';
import { ConnectedAccountsSelectorsIDs } from '../../../../../e2e/selectors/Browser/ConnectedAccountModal.selectors';
import { NetworkConnectMultiSelectorSelectorsIDs } from '../../../../../e2e/selectors/Browser/NetworkConnectMultiSelector.selectors';
import Logger from '../../../../util/Logger';

const NetworkConnectMultiSelector = ({
Expand Down Expand Up @@ -271,6 +272,9 @@ const NetworkConnectMultiSelector = ({
variant={ButtonVariants.Primary}
label={strings('networks.update')}
onPress={handleUpdateNetworkPermissions}
testID={
NetworkConnectMultiSelectorSelectorsIDs.UPDATE_CHAIN_PERMISSIONS
}
size={ButtonSize.Lg}
style={{
...styles.buttonPositioning,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import React from 'react';
import useApprovalRequest from '../../../hooks/useApprovalRequest';
import PersonalSign from './PersonalSign';
import TypedSignV1 from './TypedSignV1';
import TypedSignV3V4 from './TypedSignV3V4';

const ConfirmationInfoComponentMap = {
[TransactionType.personalSign]: () => PersonalSign,
[TransactionType.signTypedData]: () => TypedSignV1,
[TransactionType.signTypedData]: (approvalRequestVersion: string) => {
if (approvalRequestVersion === 'V1') return TypedSignV1;
return TypedSignV3V4;
},
};

const Info = () => {
Expand All @@ -17,10 +21,14 @@ const Info = () => {
return null;
}

const InfoComponent: React.FC =
ConfirmationInfoComponentMap[
approvalRequest?.type as keyof typeof ConfirmationInfoComponentMap
]();
const { requestData } = approvalRequest ?? {
requestData: {},
};
const approvalRequestVersion = requestData?.version;

const InfoComponent: React.FC = ConfirmationInfoComponentMap[
approvalRequest?.type as keyof typeof ConfirmationInfoComponentMap
](approvalRequestVersion);

return <InfoComponent />;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react';

import { strings } from '../../../../../../../../locales/i18n';
import useApprovalRequest from '../../../../hooks/useApprovalRequest';
import InfoSection from '../../../UI/InfoRow/InfoSection';
import InfoRow from '../../../UI/InfoRow';
import DisplayURL from '../../../UI/InfoRow/InfoValue/DisplayURL';
import NoChangeSimulation from '../../NoChangeSimulation';
import InfoRowOrigin from '../Shared/InfoRowOrigin';
import Message from './Message';

const PersonalSign = () => {
Expand All @@ -18,14 +15,7 @@ const PersonalSign = () => {
return (
<>
<NoChangeSimulation />
<InfoSection>
<InfoRow
label={strings('confirm.request_from')}
tooltip={strings('confirm.personal_sign_tooltip')}
>
<DisplayURL url={approvalRequest.origin} />
</InfoRow>
</InfoSection>
<InfoRowOrigin />
<Message />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import renderWithProvider from '../../../../../../../../util/test/renderWithProvider';
import { typedSignV1ConfirmationState } from '../../../../../../../../util/test/confirm-data-helpers';
import InfoRowOrigin from './InfoRowOrigin';

describe('InfoRowOrigin', () => {
it('should contained required text', async () => {
const { getByText } = renderWithProvider(<InfoRowOrigin />, {
state: typedSignV1ConfirmationState,
});
expect(getByText('Request from')).toBeDefined();
expect(getByText('metamask.github.io')).toBeDefined();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';

import { strings } from '../../../../../../../../../locales/i18n';
import useApprovalRequest from '../../../../../hooks/useApprovalRequest';
import InfoSection from '../../../../UI/InfoRow/InfoSection';
import InfoRow from '../../../../UI/InfoRow';
import DisplayURL from '../../../../UI/InfoRow/InfoValue/DisplayURL';

const InfoRowOrigin = () => {
const { approvalRequest } = useApprovalRequest();

if (!approvalRequest) {
return null;
}

return (
<InfoSection>
<InfoRow
label={strings('confirm.request_from')}
tooltip={strings('confirm.personal_sign_tooltip')}
>
<DisplayURL url={approvalRequest.origin} />
</InfoRow>
</InfoSection>
);
};

export default InfoRowOrigin;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './InfoRowOrigin';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import renderWithProvider from '../../../../../../../util/test/renderWithProvider';
import { typedSignV1ConfirmationState } from '../../../../../../../util/test/confirm-data-helpers';
import TypedSignV1 from './index';
import TypedSignV1 from './TypedSignV1';

describe('TypedSignV1', () => {
it('should contained required text', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React from 'react';

import { strings } from '../../../../../../../../locales/i18n';
import useApprovalRequest from '../../../../hooks/useApprovalRequest';
import InfoSection from '../../../UI/InfoRow/InfoSection';
import InfoRow from '../../../UI/InfoRow';
import DisplayURL from '../../../UI/InfoRow/InfoValue/DisplayURL';
import Message from './Message';
import NoChangeSimulation from '../../NoChangeSimulation';
import InfoRowOrigin from '../Shared/InfoRowOrigin';
import Message from './Message';

const TypedSignV1 = () => {
const { approvalRequest } = useApprovalRequest();
Expand All @@ -18,14 +15,7 @@ const TypedSignV1 = () => {
return (
<>
<NoChangeSimulation />
<InfoSection>
<InfoRow
label={strings('confirm.request_from')}
tooltip={strings('confirm.personal_sign_tooltip')}
>
<DisplayURL url={approvalRequest.origin} />
</InfoRow>
</InfoSection>
<InfoRowOrigin />
<Message />
</>
);
Expand Down
Loading

0 comments on commit d489b7e

Please sign in to comment.