Skip to content

Commit 934edbe

Browse files
authored
Merge branch 'main' into fix/account-connect-origin-spoof
2 parents 9743e13 + efdc35f commit 934edbe

File tree

49 files changed

+3347
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3347
-323
lines changed

CHANGELOG.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- fix(swaps): set default slippage when source or destination token is not stablecoin ([#14730](https://github.com/MetaMask/metamask-mobile/pull/14730))
13+
14+
### Changed
15+
16+
- fix(multi-srp): display errors only after all the words are have been entered ([#14607](https://github.com/MetaMask/metamask-mobile/pull/14607))
17+
1018
### Added
1119

1220
- fix(browser): fix browser PermissionsSummary origin spoofing when browser redirects issue ([#13394](https://github.com/MetaMask/metamask-mobile/pull/13394))
21+
- feat(bridge): add solana chain support and improve bridge state management ([#14713](https://github.com/MetaMask/metamask-mobile/pull/14713))
1322
- feat(bridge): add error handling and input management for bridge quotes ([#14693](https://github.com/MetaMask/metamask-mobile/pull/14693))
1423
- feat(multi-srp): enable multi-srp in main and beta ([#14558](https://github.com/MetaMask/metamask-mobile/pull/14558))
1524
- feat(ramp): Update ramp data flow to fetch cryptos before payment methods ([#14437](https://github.com/MetaMask/metamask-mobile/pull/14437))
1625
- feat(bridge): add destination account picker ([#14656](https://github.com/MetaMask/metamask-mobile/pull/14656))
1726
- feat(bridge): add Solana assets to bridge token pickers ([#14365](https://github.com/MetaMask/metamask-mobile/pull/14365))
1827
- feat: add AppMetadataController controller ([#14513](https://github.com/MetaMask/metamask-mobile/pull/14513))
1928
- feat(bridge): implement bridge quote fetching ([#14413](https://github.com/MetaMask/metamask-mobile/pull/14413))
20-
29+
- feat(multi-srp): add e2e tests ([#14583](https://github.com/MetaMask/metamask-mobile/pull/14583))
30+
- feat(bridge): fetch token metadata for Bridge token pickers if not already available ([#14699](https://github.com/MetaMask/metamask-mobile/pull/14699))
2131

2232
### Changed
2333

2434
- feat(bridge): Handle Solana vs EVM swap and bridge routing ([#14614](https://github.com/MetaMask/metamask-mobile/pull/14614))
2535

36+
### Fixed
37+
38+
- fix(bridge): fix not switching networks when selecting source token ([#14712](https://github.com/MetaMask/metamask-mobile/pull/14712))
39+
2640
## [7.44.0]
2741

2842
### Added
@@ -95,11 +109,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
95109
- fix: inherit icon size from text component parent ([#14024](https://github.com/MetaMask/metamask-mobile/pull/14024))
96110
- fix: animation added for loading state on SnapUILink button ([#13973](https://github.com/MetaMask/metamask-mobile/pull/13973))
97111
- fix: Revert "chore: upgrade Xcode 16 on bitrise.yml" ([#14012](https://github.com/MetaMask/metamask-mobile/pull/14012))
98-
99-
### Fixed
100-
101112
- fix(bridge): hide staked native assets from token selectors ([#14457](https://github.com/MetaMask/metamask-mobile/pull/14457))
102113

114+
103115
## [7.43.0]
104116

105117
### Added

app/components/UI/Bridge/Views/BridgeView/BridgeView.styles.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const createStyles = (params: { theme: Theme }) => {
1818
width: '100%',
1919
paddingHorizontal: 16,
2020
paddingBottom: 24,
21-
2221
gap: 12,
2322
alignItems: 'center',
2423
justifyContent: 'center',
@@ -59,7 +58,6 @@ export const createStyles = (params: { theme: Theme }) => {
5958
},
6059
quoteContainer: {
6160
paddingHorizontal: 24,
62-
paddingVertical: 24,
6361
},
6462
keypadContainer: {
6563
flex: 1,
@@ -77,16 +75,18 @@ export const createStyles = (params: { theme: Theme }) => {
7775
},
7876
dynamicContent: {
7977
flex: 1,
80-
},
81-
dynamicContentWithKeypad: {
82-
justifyContent: 'flex-start',
83-
},
84-
dynamicContentWithoutKeypad: {
78+
paddingBottom: 12,
8579
justifyContent: 'flex-start',
8680
},
8781
keypadContainerWithDestinationPicker: {
8882
justifyContent: 'center',
8983
paddingVertical: 12,
9084
},
85+
dynamicContentWithDestinationPickerAndQuoteCard: {
86+
justifyContent: 'flex-start',
87+
},
88+
dynamicContentWithOnlyQuoteCard: {
89+
justifyContent: 'space-around',
90+
},
9191
});
9292
};

app/components/UI/Bridge/Views/BridgeView/BridgeView.test.tsx

+25-21
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { Hex } from '@metamask/utils';
99
import BridgeView from '.';
1010
import { createBridgeTestState } from '../../testUtils';
1111
import { initialState } from '../../_mocks_/initialState';
12+
import { RequestStatus, type QuoteResponse } from '@metamask/bridge-controller';
13+
import mockQuotes from '../../_mocks_/mock-quotes-sol-sol.json';
1214

1315
// TODO remove this mock once we have a real implementation
1416
jest.mock('../../../../../selectors/confirmTransaction');
@@ -72,23 +74,21 @@ jest.mock('../../hooks/useLatestBalance', () => ({
7274
}));
7375

7476
describe('BridgeView', () => {
75-
const mockChainId = '0x1' as Hex;
76-
const optimismChainId = '0xa' as Hex;
7777
const token2Address = '0x0000000000000000000000000000000000000002' as Hex;
7878

7979
beforeEach(() => {
8080
jest.clearAllMocks();
8181
});
8282

8383
it('renders', async () => {
84-
const { getByText } = renderScreen(
84+
const { toJSON } = renderScreen(
8585
BridgeView,
8686
{
8787
name: Routes.BRIDGE.ROOT,
8888
},
8989
{ state: initialState },
9090
);
91-
expect(getByText('Select amount')).toBeDefined();
91+
expect(toJSON()).toMatchSnapshot();
9292
});
9393

9494
it('should open BridgeTokenSelector when clicking source token', async () => {
@@ -275,6 +275,8 @@ describe('BridgeView', () => {
275275
quoteRequest: {
276276
insufficientBal: true,
277277
},
278+
quotesLoadingStatus: RequestStatus.FETCHED,
279+
quotes: [mockQuotes[0] as unknown as QuoteResponse],
278280
},
279281
});
280282

@@ -295,6 +297,8 @@ describe('BridgeView', () => {
295297
quoteRequest: {
296298
insufficientBal: false,
297299
},
300+
quotesLoadingStatus: RequestStatus.FETCHED,
301+
quotes: [mockQuotes[0] as unknown as QuoteResponse],
298302
},
299303
bridgeReducerOverrides: {
300304
sourceAmount: '1.0', // Less than balance of 2.0 ETH
@@ -314,28 +318,26 @@ describe('BridgeView', () => {
314318
});
315319

316320
it('should handle Continue button press', async () => {
321+
const testState = createBridgeTestState({
322+
bridgeControllerOverrides: {
323+
quoteRequest: {
324+
insufficientBal: false,
325+
},
326+
quotesLoadingStatus: RequestStatus.FETCHED,
327+
quotes: [mockQuotes[0] as unknown as QuoteResponse],
328+
},
329+
bridgeReducerOverrides: {
330+
sourceAmount: '1.0', // Less than balance of 2.0 ETH
331+
},
332+
});
333+
317334
const { getByText } = renderScreen(
318335
BridgeView,
319336
{
320337
name: Routes.BRIDGE.ROOT,
321338
},
322339
{
323-
state: {
324-
...initialState,
325-
bridge: {
326-
...initialState.bridge,
327-
sourceAmount: '1.0',
328-
destToken: {
329-
address: token2Address,
330-
symbol: 'TOKEN2',
331-
decimals: 18,
332-
image: 'https://token2.com/logo.png',
333-
chainId: optimismChainId,
334-
},
335-
selectedDestChainId: optimismChainId,
336-
selectedSourceChainIds: [mockChainId, optimismChainId],
337-
},
338-
},
340+
state: testState,
339341
},
340342
);
341343

@@ -352,6 +354,8 @@ describe('BridgeView', () => {
352354
quoteRequest: {
353355
insufficientBal: false,
354356
},
357+
quotesLoadingStatus: RequestStatus.FETCHED,
358+
quotes: [mockQuotes[0] as unknown as QuoteResponse],
355359
},
356360
bridgeReducerOverrides: {
357361
sourceAmount: '1.0', // Less than balance of 2.0 ETH
@@ -372,4 +376,4 @@ describe('BridgeView', () => {
372376
// TODO: Add expectations once Terms navigation is implemented
373377
});
374378
});
375-
});
379+
});

0 commit comments

Comments
 (0)