-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/12728_getAnalyticsParams_anon_prop
- Loading branch information
Showing
113 changed files
with
6,323 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Create Release Pull Request V2 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base-branch: | ||
description: 'The base branch, tag, or SHA for git operations and the pull request.' | ||
required: true | ||
semver-version: | ||
description: 'A semantic version. eg: x.x.x' | ||
required: true | ||
previous-version-tag: | ||
description: 'Previous release version tag. eg: v7.7.0' | ||
required: true | ||
jobs: | ||
generate-build-version: | ||
uses: MetaMask/metamask-mobile-build-version/.github/workflows/[email protected] | ||
permissions: | ||
id-token: write | ||
|
||
create-release-pr: | ||
needs: generate-build-version | ||
uses: MetaMask/github-tools/.github/workflows/[email protected] | ||
with: | ||
platform: mobile | ||
base-branch: ${{ inputs.base-branch }} | ||
semver-version: ${{ inputs.semver-version }} | ||
previous-version-tag: ${{ inputs.previous-version-tag }} | ||
mobile-build-version: ${{ needs.generate-build-version.outputs.build-version }} | ||
secrets: | ||
# This token needs read permissions to metamask-planning & write permissions to metamask-mobile | ||
github-token: ${{ secrets.PR_TOKEN }} | ||
permissions: | ||
contents: write | ||
pull-requests: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,6 @@ android/app/src/main/assets/modules.json | |
.expo | ||
dist/ | ||
web-build/ | ||
|
||
# CICD | ||
github-tools/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const MISSMATCH_RPC_URL_TEST_ID = | ||
'networks.rpc-url-missmatch-review-and-compare'; |
133 changes: 133 additions & 0 deletions
133
app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.ff-on.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/** | ||
* This separate test file was created to test the component with isMultichainVersion1Enabled=true. | ||
* Due to the way feature flags are imported and used, it's cleaner to mock them in a separate file. | ||
* When the feature flag is removed, these tests should be merged into the main NetworkVerificationInfo.test.tsx file. | ||
*/ | ||
import React from 'react'; | ||
import NetworkVerificationInfo from './NetworkVerificationInfo'; | ||
import { BannerAlertSeverity } from '../../../component-library/components/Banners/Banner'; | ||
import { strings } from '../../../../locales/i18n'; | ||
import { useSelector } from 'react-redux'; | ||
import renderWithProvider from '../../../util/test/renderWithProvider'; | ||
import { PopularList } from '../../../util/networks/customNetworks'; | ||
import { MISSMATCH_RPC_URL_TEST_ID } from './NetworkVerificationInfo.constants'; | ||
|
||
jest.mock('react-redux', () => ({ | ||
...jest.requireActual('react-redux'), | ||
useSelector: jest.fn(), | ||
})); | ||
|
||
// Mock feature flags | ||
jest.mock('../../../util/networks/index.js', () => ({ | ||
...jest.requireActual('../../../util/networks/index.js'), | ||
isMultichainVersion1Enabled: true, | ||
isChainPermissionsFeatureEnabled: true, | ||
})); | ||
|
||
const mockNetworkInfo = { | ||
chainName: 'Test Chain', | ||
chainId: '0xa', | ||
rpcUrl: 'http://test.com', | ||
ticker: 'TEST', | ||
blockExplorerUrl: 'http://explorer.test.com', | ||
alerts: [ | ||
{ | ||
alertError: strings('add_custom_network.unrecognized_chain_name'), | ||
alertSeverity: BannerAlertSeverity.Warning, | ||
alertOrigin: 'chain_name', | ||
}, | ||
], | ||
icon: 'test-icon', | ||
}; | ||
|
||
describe('NetworkVerificationInfo with Feature Flag ON', () => { | ||
// Setup and cleanup for PopularList mock | ||
const originalPopularList = [PopularList]; | ||
|
||
beforeEach(() => { | ||
(useSelector as jest.Mock).mockClear(); | ||
}); | ||
|
||
afterEach(() => { | ||
// Restore original PopularList after each test | ||
PopularList.length = 0; | ||
PopularList.push(...originalPopularList[0]); | ||
}); | ||
|
||
describe('RPC URL Mismatch Detection', () => { | ||
const createMockPopularNetwork = (rpcUrl: string) => ({ | ||
chainId: '0xa' as `0x${string}`, | ||
rpcUrl, | ||
rpcPrefs: { | ||
imageSource: 'test-image', | ||
blockExplorerUrl: 'https://test-explorer.com', | ||
imageUrl: 'https://test-image.com', | ||
}, | ||
nickname: 'Test Network', | ||
ticker: 'TEST', | ||
warning: false, | ||
}); | ||
|
||
const createNetworkWithPageMeta = (url: string) => ({ | ||
...mockNetworkInfo, | ||
pageMeta: { url }, | ||
}); | ||
|
||
it('hides RPC mismatch UI for non-dapp requests', () => { | ||
const { queryByTestId } = renderWithProvider( | ||
<NetworkVerificationInfo | ||
customNetworkInformation={mockNetworkInfo} | ||
onReject={() => undefined} | ||
onConfirm={() => undefined} | ||
isCustomNetwork={false} | ||
/>, | ||
); | ||
|
||
expect(queryByTestId(MISSMATCH_RPC_URL_TEST_ID)).toBeNull(); | ||
}); | ||
|
||
it('displays RPC mismatch UI when URLs differ', () => { | ||
const mockPopularNetwork = createMockPopularNetwork( | ||
'https://different.rpc.url', | ||
); | ||
PopularList.length = 0; | ||
PopularList.push(mockPopularNetwork); | ||
|
||
const networkInfoWithPageMeta = createNetworkWithPageMeta( | ||
'https://app.uniswap.org', | ||
); | ||
|
||
const { queryByTestId } = renderWithProvider( | ||
<NetworkVerificationInfo | ||
customNetworkInformation={networkInfoWithPageMeta} | ||
onReject={() => undefined} | ||
onConfirm={() => undefined} | ||
isCustomNetwork={false} | ||
/>, | ||
); | ||
|
||
expect(queryByTestId(MISSMATCH_RPC_URL_TEST_ID)).toBeDefined(); | ||
}); | ||
|
||
it('hides RPC mismatch UI when URLs match', () => { | ||
const mockPopularNetwork = createMockPopularNetwork('http://test.com'); | ||
PopularList.length = 0; | ||
PopularList.push(mockPopularNetwork); | ||
|
||
const networkInfoWithPageMeta = createNetworkWithPageMeta( | ||
'https://app.uniswap.org', | ||
); | ||
|
||
const { queryByTestId } = renderWithProvider( | ||
<NetworkVerificationInfo | ||
customNetworkInformation={networkInfoWithPageMeta} | ||
onReject={() => undefined} | ||
onConfirm={() => undefined} | ||
isCustomNetwork={false} | ||
/>, | ||
); | ||
|
||
expect(queryByTestId(MISSMATCH_RPC_URL_TEST_ID)).toBeNull(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/components/UI/Stake/Views/StakeEarningsHistoryView/StakeEarningsHistoryView.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { Theme } from '../../../../../util/theme/models'; | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const stylesSheet = (params: { theme: Theme }) => { | ||
const { theme } = params; | ||
const { colors } = theme; | ||
|
||
return StyleSheet.create({ | ||
mainContainer: { | ||
flexGrow: 1, | ||
paddingTop: 8, | ||
paddingHorizontal: 16, | ||
backgroundColor: colors.background.default, | ||
justifyContent: 'space-between', | ||
}, | ||
}); | ||
}; | ||
|
||
export default stylesSheet; |
Oops, something went wrong.