Skip to content

Commit

Permalink
Merge branch 'develop' into @matthew/remote-chain-selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Dec 23, 2024
2 parents 3a94dd2 + 7a2ade3 commit 88910de
Show file tree
Hide file tree
Showing 474 changed files with 6,240 additions and 5,007 deletions.
2 changes: 2 additions & 0 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module.exports = {
args: {
config: 'e2e/jest.e2e.config.js',
_: ['e2e'],
bail: true,
forceExit: true,
},
},
devices: {
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ module.exports = {
],
'jest/expect-expect': 'off',
'jest/no-disabled-tests': 'off',
'no-nested-ternary': 'off',
},
};
11 changes: 6 additions & 5 deletions .github/workflows/macstadium-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
run: |
rm -rf /Users/administrator/.cocoapods/repos/cocoapods/.git/index.lock
yarn install-bundle && yarn install-pods
- uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
Expand All @@ -164,11 +164,12 @@ jobs:
run: |
sed -i'' -e "s/IS_TESTING=false/IS_TESTING=true/" .env && rm -f .env-e
yarn detox build --configuration ios.sim.release
- name: Detox iOS e2e tests serial
run: |
./scripts/run-serial-e2e.sh 3
- name: Detox iOS e2e tests parallel
run: |
./scripts/run-parallel-e2e.sh 3
./scripts/run-parallel-e2e.sh
- name: Detox iOS e2e tests serial
run: |
./scripts/run-serial-e2e.sh 3
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

### Fixed

## [1.9.50] (https://github.com/rainbow-me/rainbow/releases/tag/v1.9.50)

### Fixed

- Fixed an issue with unlocking app icons (#6342, #6345)

## [1.9.49] (https://github.com/rainbow-me/rainbow/releases/tag/v1.9.49)

### Added
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ android {
applicationId "me.rainbow"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 243
versionName "1.9.50"
versionCode 244
versionName "1.9.51"
missingDimensionStrategy 'react-native-camera', 'general'
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const getOnchainBalance = async (address, tokenContractAddress) => {
};

beforeAll(async () => {
await Helpers.startHardhat();
await Helpers.startAnvil();
await Helpers.startIosSimulator();
});

describe.skip('Hardhat Transaction Flow', () => {
describe.skip('Anvil Transaction Flow', () => {
it('Should show the welcome screen', async () => {
await Helpers.checkIfVisible('welcome-screen');
});
Expand Down Expand Up @@ -85,9 +85,9 @@ describe.skip('Hardhat Transaction Flow', () => {
await Helpers.sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
await Helpers.waitAndTap('dev-button-hardhat');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
await Helpers.waitAndTap('dev-button-anvil');
await Helpers.checkIfVisible('testnet-toast-Anvil');
});

it('Should open send sheet after tapping send fab', async () => {
Expand Down Expand Up @@ -392,6 +392,6 @@ describe.skip('Hardhat Transaction Flow', () => {
await connector?.killSession();
connector = null;
await device.clearKeychain();
await Helpers.killHardhat();
await Helpers.killAnvil();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ios = device.getPlatform() === 'ios';
const android = device.getPlatform() === 'android';

beforeAll(async () => {
await Helpers.startHardhat();
await Helpers.startAnvil();
await Helpers.startIosSimulator();
});

Expand All @@ -29,11 +29,11 @@ const checkIfSwapCompleted = async (assetName, amount) => {
};

// FIXME: Mainnet DAI doesn't show up in the swap search results
// This might be related to @Jin's latest work on changes to hardhat as
// This might be related to @Jin's latest work on changes to anvil as
// part of the addy's REST API migration
//
// marking the test as SKIP for now
describe.skip('Hardhat Transaction Flow', () => {
describe.skip('Anvil Transaction Flow', () => {
it('Should show the welcome screen', async () => {
await Helpers.checkIfVisible('welcome-screen');
});
Expand Down Expand Up @@ -74,9 +74,9 @@ describe.skip('Hardhat Transaction Flow', () => {
await Helpers.sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
await Helpers.waitAndTap('dev-button-hardhat');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
await Helpers.waitAndTap('dev-button-anvil');
await Helpers.checkIfVisible('testnet-toast-Anvil');
});

it.skip('Should deposit DAI (via Compound)', async () => {
Expand Down Expand Up @@ -414,6 +414,6 @@ describe.skip('Hardhat Transaction Flow', () => {
await connector?.killSession();
connector = null;
await device.clearKeychain();
await Helpers.killHardhat();
await Helpers.killAnvil();
});
});
10 changes: 5 additions & 5 deletions e2e/Disabled/registerENSFlow.disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const validatePrimaryName = async name => {
};

beforeAll(async () => {
await Helpers.startHardhat();
await Helpers.startAnvil();
await Helpers.startIosSimulator();
});

Expand Down Expand Up @@ -155,9 +155,9 @@ describe.skip('Register ENS Flow', () => {
await Helpers.sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
await Helpers.waitAndTap('dev-button-hardhat');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
await Helpers.waitAndTap('dev-button-anvil');
await Helpers.checkIfVisible('testnet-toast-Anvil');
});

it('Should navigate to the Discover sheet screen after swiping left', async () => {
Expand Down Expand Up @@ -637,6 +637,6 @@ describe.skip('Register ENS Flow', () => {
afterAll(async () => {
// Reset the app state
await device.clearKeychain();
await Helpers.killHardhat();
await Helpers.killAnvil();
});
});
14 changes: 7 additions & 7 deletions e2e/Disabled/sendSheetFlow.disabled.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { device } from 'detox';
import {
startHardhat,
killHardhat,
startAnvil,
killAnvil,
importWalletFlow,
sendETHtoTestWallet,
waitAndTap,
Expand All @@ -16,11 +16,11 @@ import {
describe.skip('Send Sheet Interaction Flow', () => {
beforeAll(async () => {
await device.reloadReactNative();
await startHardhat();
await startAnvil();
});
afterAll(async () => {
await device.clearKeychain();
await killHardhat();
await killAnvil();
});

it('Import a wallet and go to welcome', async () => {
Expand All @@ -31,9 +31,9 @@ describe.skip('Send Sheet Interaction Flow', () => {
await sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
await waitAndTap('dev-button-hardhat');
await checkIfVisible('testnet-toast-Hardhat');
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
await waitAndTap('dev-button-anvil');
await checkIfVisible('testnet-toast-Anvil');
});

it('Should open send sheet after tapping send button', async () => {
Expand Down
12 changes: 6 additions & 6 deletions e2e/Disabled/swapSheetFlow1.disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const android = device.getPlatform() === 'android';

describe.skip('Swap Sheet Interaction Flow', () => {
beforeAll(async () => {
await Helpers.startHardhat();
await Helpers.startAnvil();
});
afterAll(async () => {
await device.clearKeychain();
await Helpers.killHardhat();
await Helpers.killAnvil();
});

it('Import a wallet and go to welcome', async () => {
Expand All @@ -24,14 +24,14 @@ describe.skip('Swap Sheet Interaction Flow', () => {
await Helpers.sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
await Helpers.delayTime('very-long');
await Helpers.waitAndTap('dev-button-hardhat');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
await Helpers.waitAndTap('dev-button-anvil');
await Helpers.checkIfVisible('testnet-toast-Anvil');
});

// FIXME: Mainnet DAI doesn't show up in the swap search results
// This might be related to @Jin's latest work on changes to hardhat as
// This might be related to @Jin's latest work on changes to anvil as
// part of the addy's REST API migration
//
// marking the test as SKIP for now
Expand Down
18 changes: 9 additions & 9 deletions e2e/Disabled/swapSheetFlow2.disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import * as Helpers from '../helpers';
import { device } from 'detox';

beforeAll(async () => {
await Helpers.startHardhat();
await Helpers.startAnvil();
});

const ios = device.getPlatform() === 'ios';
const android = device.getPlatform() === 'android';

// FIXME: Mainnet DAI doesn't show up in the swap search results
// This might be related to @Jin's latest work on changes to hardhat as
// This might be related to @Jin's latest work on changes to anvil as
// part of the addy's REST API migration
//
// marking the test as SKIP for now
Expand Down Expand Up @@ -54,23 +54,23 @@ describe.skip('Swap Sheet Interaction Flow', () => {
await Helpers.sendETHtoTestWallet();
});

it('Should show Hardhat Toast after pressing Connect To Hardhat', async () => {
it('Should show Anvil Toast after pressing Connect To Anvil', async () => {
// need to wait for balances to be fetched
await Helpers.delay(10000);
await Helpers.waitAndTap('dev-button-hardhat');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
await Helpers.waitAndTap('dev-button-anvil');
await Helpers.checkIfVisible('testnet-toast-Anvil');
});

it('Should connect to hardhat', async () => {
it('Should connect to anvil', async () => {
await Helpers.swipe('wallet-screen', 'right', 'slow');
await Helpers.checkIfVisible('profile-screen');
await Helpers.waitAndTap('settings-button');
await Helpers.checkIfVisible('settings-sheet');
await Helpers.scrollTo('settings-menu-container', 'bottom');
await Helpers.waitAndTap('developer-section');
await Helpers.swipeUntilVisible('alert-section', 'developer-settings-sheet', 'up');
await Helpers.waitAndTap('hardhat-section');
await Helpers.checkIfVisible('testnet-toast-Hardhat');
await Helpers.waitAndTap('anvil-section');
await Helpers.checkIfVisible('testnet-toast-Anvil');
await Helpers.swipe('profile-screen', 'left', 'slow');
});

Expand Down Expand Up @@ -474,6 +474,6 @@ describe.skip('Swap Sheet Interaction Flow', () => {
afterAll(async () => {
// Reset the app state
await device.clearKeychain();
await Helpers.killHardhat();
await Helpers.killAnvil();
});
});
25 changes: 16 additions & 9 deletions e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { exec } from 'child_process';
import { JsonRpcProvider } from '@ethersproject/providers';
import { Wallet } from '@ethersproject/wallet';
import { expect, device, element, by, waitFor } from 'detox';
import { parseEther } from '@ethersproject/units';
import { formatEther, parseEther } from '@ethersproject/units';
import { IosElementAttributes, AndroidElementAttributes } from 'detox/detox';

const TESTING_WALLET = '0x3637f053D542E6D00Eee42D656dD7C59Fa33a62F';
Expand All @@ -20,12 +20,12 @@ interface ProviderFunction {
_instance?: JsonRpcProvider;
}

export async function startHardhat() {
export async function startAnvil() {
await delayTime('short');
exec('yarn hardhat');
exec('yarn anvil');
}

export async function killHardhat() {
export async function killAnvil() {
await delayTime('short');
exec('kill $(lsof -t -i:8545)');
}
Expand Down Expand Up @@ -53,14 +53,14 @@ export async function importWalletFlow(customSeed?: string) {
await checkIfVisible('wallet-screen');
}

export async function beforeAllcleanApp({ hardhat }: { hardhat?: boolean }) {
export async function beforeAllcleanApp({ anvil }: { anvil?: boolean }) {
jest.resetAllMocks();
hardhat && (await startHardhat());
anvil && (await startAnvil());
}

export async function afterAllcleanApp({ hardhat }: { hardhat?: boolean }) {
export async function afterAllcleanApp({ anvil }: { anvil?: boolean }) {
await device.clearKeychain();
hardhat && (await killHardhat());
anvil && (await killAnvil());
}

export async function tap(elementId: string | RegExp) {
Expand Down Expand Up @@ -467,16 +467,23 @@ export const getProvider: ProviderFunction = () => {
};

export async function sendETHtoTestWallet() {
console.log('getting provider');
const provider = getProvider();
// Hardhat account 0 that has 10000 ETH
console.log('got provider', provider);
// anvil account 0 that has 10000 ETH
const wallet = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', provider);
console.log('got wallet', wallet);
// Sending 20 ETH so we have enough to pay the tx fees even when the gas is too high
console.log('sending eth');
await wallet.sendTransaction({
to: TESTING_WALLET,
value: parseEther('20'),
});
console.log('sent eth');
await delayTime('long');
console.log('checking balance');
const balance = await provider.getBalance(TESTING_WALLET);
console.log('got balance', formatEther(balance));
if (balance.lt(parseEther('20'))) {
throw Error('Error sending ETH to test wallet');
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ beforeAll(async () => {
if (device.getPlatform() === 'android') {
// connecting to metro
await device.reverseTcpPort(8081);
// connecting to hardhat
// connecting to anvil
await device.reverseTcpPort(8545); // TODO: WIP for android connecting in dev

// make sure we don't have gesture navigation what might cause collisions
Expand Down
4 changes: 2 additions & 2 deletions e2e/parallel/1_importAndWatchWalletsFlow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const android = device.getPlatform() === 'android';

describe('Import from private key flow', () => {
beforeAll(async () => {
await beforeAllcleanApp({ hardhat: false });
await beforeAllcleanApp({ anvil: false });
});
afterAll(async () => {
await afterAllcleanApp({ hardhat: false });
await afterAllcleanApp({ anvil: false });
});
it('with 0x - Should show the welcome screen', async () => {
await checkIfVisible('welcome-screen');
Expand Down
Loading

0 comments on commit 88910de

Please sign in to comment.