Skip to content

Commit

Permalink
Merge branch 'main' into feat-3800-settings-drawer-redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyhoward authored Jan 6, 2025
2 parents 42a975a + 724ec84 commit e9c51d6
Show file tree
Hide file tree
Showing 18 changed files with 152 additions and 65 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ app/store/migrations/ @MetaMask/mobile-pla
bitrise.yml @MetaMask/mobile-platform
yarn.lock @MetaMask/mobile-platform
ios/Podfile.lock @MetaMask/mobile-platform
app/components/Views/BrowserTab/BrowserTab.tsx @MetaMask/mobile-platform

# Ramps Team
app/components/UI/Ramp/ @MetaMask/ramp
Expand Down Expand Up @@ -76,6 +77,9 @@ patches/react-native+0.*.patch @MetaMask/supply-chain
**/snaps/** @MetaMask/snaps-devs
**/Snaps/** @MetaMask/snaps-devs

# Wallet API Platform Team
app/core/RPCMethods/ @MetaMask/wallet-api-platform-engineers

# Staking Team
app/components/UI/Stake @MetaMask/metamask-staking

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Current Main Branch

## 7.37.1 - Dec 16, 2024
### Fixed
- [#12577](https://github.com/MetaMask/metamask-mobile/pull/12577): chore: bump {gas-fee,network,selected-network,notification-services,profile-sync,signature}-controller (#12577)
- [#12694](https://github.com/MetaMask/metamask-mobile/pull/12694): fix: small refactoring of the latest migration script + add a new migration case (#12694)
- [#12664](https://github.com/MetaMask/metamask-mobile/pull/12664): fix: mark transactions as failed for cancelled / unknown smart transactions (#12664)

## 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)
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
versionName "7.37.0"
versionCode 1512
versionName "7.37.1"
versionCode 1520
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
21 changes: 19 additions & 2 deletions app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react';
import renderWithProvider from '../../../util/test/renderWithProvider';
import ApprovalTagUrl from './ApprovalTagUrl';
import ApprovalTagUrl, { APPROVAL_TAG_URL_ORIGIN_PILL } from './ApprovalTagUrl';
import { backgroundState } from '../../../util/test/initial-root-state';
import { INTERNAL_ORIGINS } from '../../../constants/transaction';

const ADDRESS_MOCK = '0x1234567890abcdef1234567890abcdef12345678';
const DOMAIN_MOCK = 'metamask.github.io';

const mockInitialState = {
settings: {},
engine: {
Expand All @@ -19,7 +21,7 @@ const mockInitialState = {

describe('ApprovalTagUrl', () => {
it('renders correctly', () => {
const { toJSON } = renderWithProvider(
const { toJSON, getByTestId } = renderWithProvider(
<ApprovalTagUrl
from={ADDRESS_MOCK}
origin={DOMAIN_MOCK}
Expand All @@ -30,5 +32,20 @@ describe('ApprovalTagUrl', () => {
);

expect(toJSON()).toMatchSnapshot();
expect(getByTestId(APPROVAL_TAG_URL_ORIGIN_PILL)).toBeDefined();
});

it('does not render when origin is an internal origin', () => {
const { queryByTestId } = renderWithProvider(
<ApprovalTagUrl
from={ADDRESS_MOCK}
origin={INTERNAL_ORIGINS[0]}
url={`https://${INTERNAL_ORIGINS[0]}`}
sdkDappMetadata={{ url: '', icon: '' }}
/>,
{ state: mockInitialState },
);

expect(queryByTestId(APPROVAL_TAG_URL_ORIGIN_PILL)).toBeNull();
});
});
5 changes: 4 additions & 1 deletion app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { selectAccountsByChainId } from '../../../selectors/accountTrackerContro
import { getHost, prefixUrlWithProtocol } from '../../../util/browser';
import useFavicon from '../../hooks/useFavicon/useFavicon';
import stylesheet from './ApprovalTagUrl.styles';
import { INTERNAL_ORIGINS } from '../../../constants/transaction';

const { ORIGIN_DEEPLINK, ORIGIN_QR_CODE } = AppConstants.DEEPLINKS;
export const APPROVAL_TAG_URL_ORIGIN_PILL = 'APPROVAL_TAG_URL_ORIGIN_PILL';
Expand Down Expand Up @@ -76,7 +77,9 @@ const ApprovalTagUrl = ({
uri: '',
};

if (origin && !isOriginDeepLink) {
const showOrigin = origin && !isOriginDeepLink && !INTERNAL_ORIGINS.includes(origin);

if (showOrigin) {
return (
<TagUrl
testID={APPROVAL_TAG_URL_ORIGIN_PILL}
Expand Down
22 changes: 17 additions & 5 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ stages:
- run_tag_smoke_assets_android: {}
- run_tag_smoke_confirmations_ios: {}
- run_tag_smoke_confirmations_android: {}
- run_tag_smoke_ramps_android: {}
# - run_tag_smoke_swaps_ios: {}
# - run_tag_smoke_swaps_android: {}
- run_tag_smoke_core_ios: {}
Expand All @@ -182,6 +183,7 @@ stages:
- run_tag_smoke_confirmations_android: {}
- run_tag_smoke_accounts_ios: {}
- run_tag_smoke_accounts_android: {}
- run_tag_smoke_ramps_android: {}
# - run_tag_smoke_identity_ios: {}
# - run_tag_smoke_identity_android: {}
# - run_tag_smoke_assets_ios: {}
Expand Down Expand Up @@ -699,6 +701,16 @@ workflows:
- TEST_SUITE_TAG: '.*SmokeMultiChainPermissions.*'
after_run:
- android_e2e_test
run_tag_smoke_ramps_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/ramps/*'
- TEST_SUITE_TAG: '.*SmokeRamps.*'
after_run:
- android_e2e_test
android_e2e_build:
before_run:
- code_setup
Expand Down Expand Up @@ -970,7 +982,7 @@ workflows:
inputs:
- content: |-
#!/usr/bin/env bash
brew install ccache with HOMEBREW_NO_DEPENDENTS_CHECK=1
brew install ccache with HOMEBREW_NO_DEPENDENTS_CHECK=1
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
Expand Down Expand Up @@ -1781,16 +1793,16 @@ app:
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
VERSION_NAME: 7.37.0
VERSION_NAME: 7.37.1
- opts:
is_expand: false
VERSION_NUMBER: 1512
VERSION_NUMBER: 1520
- opts:
is_expand: false
FLASK_VERSION_NAME: 7.37.0
FLASK_VERSION_NAME: 7.37.1
- opts:
is_expand: false
FLASK_VERSION_NUMBER: 1512
FLASK_VERSION_NUMBER: 1520
- opts:
is_expand: false
ANDROID_APK_LINK: ''
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class FixtureBuilder {
whitelist: [],
tabs: [
{
url: 'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/',
url: 'https://metamask.github.io/test-dapp/',
id: 1692550481062,
},
],
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/Browser/ConnectedAccountsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ConnectedAccountsModal {
}

async tapManagePermissionsButton() {
await TestHelpers.delay(3000);
await TestHelpers.delay(4000);
await Gestures.waitAndTap(this.managePermissionsButton);
}

Expand Down
20 changes: 6 additions & 14 deletions e2e/pages/Network/NetworkAddedBottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ class NetworkAddedBottomSheet {
}

get switchNetworkButton() {
return device.getPlatform() === 'android'
? Matchers.getElementByLabel(
NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
)
: Matchers.getElementByID(
NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
);
return Matchers.getElementByID(
NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
);
}

get closeNetworkButton() {
return device.getPlatform() === 'android'
? Matchers.getElementByLabel(
NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
)
: Matchers.getElementByID(
NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
);
return Matchers.getElementByID(
NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
);
}

async tapSwitchToNetwork() {
Expand Down
4 changes: 2 additions & 2 deletions e2e/resources/networks.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PopularNetworksList = {
type: 'rpc',
chainId: toHex('43114'),
rpcUrl: 'https://api.avax.network/ext/bc/C/rpc',
nickname: 'Avalanche Mainnet C-Chain',
nickname: 'Avalanche C-Chain',
ticker: 'AVAX',
},
},
Expand Down Expand Up @@ -46,7 +46,7 @@ const PopularNetworksList = {
type: 'rpc',
chainId: toHex('10'),
rpcUrl: `https://optimism-mainnet.infura.io/v3/${infuraProjectId}`,
nickname: 'Optimism',
nickname: 'OP Mainnet',
ticker: 'ETH',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TestHelpers from '../../helpers';

import { loginToApp } from '../../viewHelper';
import { withFixtures } from '../../fixtures/fixture-helper';
import { SmokeCore } from '../../tags';
import { SmokeRamps } from '../../tags';
import FixtureBuilder from '../../fixtures/fixture-builder';

import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
Expand All @@ -13,8 +13,10 @@ import Assertions from '../../utils/Assertions';
import NetworkAddedBottomSheet from '../../pages/Network/NetworkAddedBottomSheet';
import NetworkApprovalBottomSheet from '../../pages/Network/NetworkApprovalBottomSheet';
import NetworkEducationModal from '../../pages/Network/NetworkEducationModal';
import NetworkListModal from '../../pages/Network/NetworkListModal';
import { PopularNetworksList } from '../../resources/networks.e2e';

describe(SmokeCore('Buy Crypto Deeplinks'), () => {
describe(SmokeRamps('Buy Crypto Deeplinks'), () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
});
Expand All @@ -23,9 +25,8 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => {
jest.setTimeout(150000);
});

it('should deep link to onramp on Base network', async () => {
const BuyDeepLink =
'metamask://buy?chainId=8453&address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=12';
it('should deep link to onramp to unsupported network', async () => {
const BuyDeepLink = 'metamask://buy?chainId=2';

await withFixtures(
{
Expand All @@ -45,12 +46,16 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => {

await BuyGetStartedView.tapGetStartedButton();

await Assertions.checkIfVisible(NetworkApprovalBottomSheet.container);
await Assertions.checkIfTextIsDisplayed('Unsupported buy Network');
await NetworkListModal.changeNetworkTo(
PopularNetworksList.Avalanche.providerConfig.nickname,
);
await NetworkApprovalBottomSheet.tapApproveButton();
await NetworkAddedBottomSheet.tapSwitchToNetwork();
await NetworkAddedBottomSheet.tapCloseButton();
await Assertions.checkIfVisible(NetworkEducationModal.container);
await NetworkEducationModal.tapGotItButton();
await Assertions.checkIfTextIsDisplayed('USD Coin');
await Assertions.checkIfTextIsNotDisplayed('Unsupported buy Network');
await Assertions.checkIfTextIsDisplayed('Avalanche');
},
);
});
Expand Down
40 changes: 38 additions & 2 deletions e2e/specs/ramps/deeplink-to-buy-flow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TestHelpers from '../../helpers';

import { loginToApp } from '../../viewHelper';
import { withFixtures } from '../../fixtures/fixture-helper';
import { SmokeCore } from '../../tags';
import { SmokeRamps } from '../../tags';
import FixtureBuilder from '../../fixtures/fixture-builder';

import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
Expand All @@ -13,7 +13,9 @@ import BuildQuoteView from '../../pages/Ramps/BuildQuoteView';
import TokenSelectBottomSheet from '../../pages/Ramps/TokenSelectBottomSheet';
import Assertions from '../../utils/Assertions';

describe(SmokeCore('Buy Crypto Deeplinks'), () => {
import { PopularNetworksList } from '../../resources/networks.e2e';
import NetworkEducationModal from '../../pages/Network/NetworkEducationModal';
describe(SmokeRamps('Buy Crypto Deeplinks'), () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
});
Expand Down Expand Up @@ -52,4 +54,38 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => {
},
);
});
it('should deep link to onramp on Base network', async () => {
const BuyDeepLink =
'metamask://buy?chainId=8453&address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=12';

await withFixtures(
{
fixture: new FixtureBuilder()
.withPopularNetworks()
.withRampsSelectedRegion()
.build(),
restartDevice: true,
},
async () => {
await loginToApp();
await device.sendToHome();
await device.launchApp({
url: BuyDeepLink,
});

await Assertions.checkIfVisible(
await SellGetStartedView.getStartedButton,
);

await BuyGetStartedView.tapGetStartedButton();

await Assertions.checkIfVisible(NetworkEducationModal.container);
await NetworkEducationModal.tapGotItButton();
await Assertions.checkIfTextIsDisplayed('USD Coin');
await Assertions.checkIfTextIsDisplayed(
PopularNetworksList.Base.providerConfig.nickname,
);
},
);
});
});
Loading

0 comments on commit e9c51d6

Please sign in to comment.