chore: remove chainID request to wallet in e2e (#2370)

This commit is contained in:
Radosław Szpiech 2022-12-09 12:08:26 +01:00 committed by GitHub
parent 13c9dffc3d
commit 615748548b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,16 +29,16 @@ export const useJsonRpcConnect = (onConnect: () => void) => {
// Check if wallet is configured for the same chain as the app
setStatus(Status.GettingChainId);
const chainIdResult = await connector.getChainId();
// Dont throw in when cypress is running as trading app relies on
// mocks which result in a mismatch between chainId for app and
// chainId for wallet
const isTest = !('Cypress' in window);
if (chainIdResult.chainID !== appChainId && isTest) {
// Throw wallet error for consitent error handling
throw ClientErrors.WRONG_NETWORK;
if (!('Cypress' in window)) {
const chainIdResult = await connector.getChainId();
if (chainIdResult.chainID !== appChainId) {
// Throw wallet error for consitent error handling
throw ClientErrors.WRONG_NETWORK;
}
}
// Start connection flow. User will be prompted to select a wallet and enter