Skip to content

fix: tests removing ROCOCO contracts #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.1.1.cjs

yarnPath: .yarn/releases/yarn-4.6.0.cjs
11 changes: 8 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
// SPDX-License-Identifier: GPL-3.0-only

import { defineConfig } from 'cypress';
import task from '@cypress/code-coverage/task';

export default defineConfig({
projectId: 'eup7bh',
e2e: {
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
baseUrl: 'http://127.0.0.1:8081/',
testIsolation: false,
setupNodeEvents(on, config) {
task(on, config);
async setupNodeEvents(on, config) {
try {
const task = await import('@cypress/code-coverage/task');
task.default(on, config);
} catch (err) {
console.warn('[WARN] Code coverage task not loaded:', err?.message ?? err);
}

return config;
},
},
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ interface Window {

describe('Signer extension flow on live networks', () => {
before(() => {
cy.visit(`/instantiate/?rpc=wss://rococo-contracts-rpc.polkadot.io`);
cy.visit(`/instantiate/?rpc=wss://rpc2.paseo.popnetwork.xyz`);
});

it('connects to Rococo', () => {
cy.contains('Connecting to wss://rococo-contracts-rpc.polkadot.io').should('not.exist', {
cy.contains('Connecting to wss://rpc2.paseo.popnetwork.xyz').should('not.exist', {
timeout: 25000,
});
});

it('Rococo is selected in the network connection dropdown', () => {
cy.get('.dropdown.chain')
.find('.dropdown__single-value')
.should('contain', 'Contracts (Rococo)');
.should('contain', 'Pop Network Testnet');
});

it('Displays help text for no extension installed', () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"yup": "^1.4.0"
},
"devDependencies": {
"@cypress/code-coverage": "^3.12.20",
"@cypress/code-coverage": "^3.14.4",
"@cypress/snapshot": "^2.1.7",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
Expand Down Expand Up @@ -109,5 +109,5 @@
"minimist": "npm:minimist@^1.2.6",
"node-forge": "npm:node-forge@^1.3.0"
},
"packageManager": "yarn@3.1.1"
"packageManager": "yarn@4.6.0"
}
9 changes: 1 addition & 8 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export const LOCAL_STORAGE_KEY = {

export type LocalStorageKey = (typeof LOCAL_STORAGE_KEY)[keyof typeof LOCAL_STORAGE_KEY];

export const ROCOCO_CONTRACTS = {
relay: 'Rococo',
name: 'Contracts (Rococo)',
rpc: 'wss://rococo-contracts-rpc.polkadot.io',
};

const CUSTOM_ENDPOINT = localStorage.getItem(LOCAL_STORAGE_KEY.CUSTOM_ENDPOINT);
export const LOCAL = {
relay: undefined,
Expand All @@ -32,7 +26,7 @@ export const LOCAL = {
// rpc: 'wss://wss.agung.peaq.network',
// };

const POP_NETWORK_TESTNET = {
export const POP_NETWORK_TESTNET = {
relay: 'Paseo',
name: 'Pop Network Testnet',
rpc: 'wss://rpc2.paseo.popnetwork.xyz',
Expand Down Expand Up @@ -104,7 +98,6 @@ const ZEITGEIST_BATTERY_STATION = {

export const TESTNETS = [
...[
ROCOCO_CONTRACTS,
// PEAQ_AGUNG,
PHALA_TESTNET,
ASTAR_SHIBUYA,
Expand Down
16 changes: 1 addition & 15 deletions src/ui/components/common/ConnectionError.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Copyright 2022-2024 use-ink/contracts-ui authors & contributors
// SPDX-License-Identifier: GPL-3.0-only

import { useNavigate } from 'react-router-dom';
import { Error } from './Error';
import { useApi } from 'ui/contexts';
import { ROCOCO_CONTRACTS, LOCAL } from 'src/constants';
import { LOCAL } from 'src/constants';

function ContractsNodeHelp() {
const navigate = useNavigate();
return (
<>
<div className="flex flex-col items-center">
Expand All @@ -27,18 +25,6 @@ function ContractsNodeHelp() {
substrate-contracts-node --dev
</div>
</div>
<div>
Alternatively, connect to{' '}
<a
className="whitespace-nowrap"
href="#"
onClick={() => {
navigate(`/?rpc=${ROCOCO_CONTRACTS.rpc}`);
}}
>
Contracts parachain on Rococo.
</a>
</div>
</>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/contexts/ApiContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSearchParams } from 'react-router-dom';
import { web3Accounts, web3Enable, web3EnablePromise } from '@polkadot/extension-dapp';
import { WsProvider } from '@polkadot/api';
import { keyring } from '@polkadot/ui-keyring';
import { LOCAL_STORAGE_KEY, ROCOCO_CONTRACTS } from '../../constants';
import { LOCAL_STORAGE_KEY, POP_NETWORK_TESTNET } from '../../constants';
import { ApiPromise, ApiState, ChainProperties, Account, Status, WeightV2 } from 'types';
import { isValidWsUrl, isKeyringLoaded } from 'lib/util';
import { useLocalStorage } from 'ui/hooks/useLocalStorage';
Expand All @@ -30,7 +30,7 @@ export const ApiContextProvider = ({ children }: React.PropsWithChildren<Partial
const rpcUrl = searchParams.get('rpc');
const [preferredEndpoint, setPreferredEndpoint] = useLocalStorage<string>(
LOCAL_STORAGE_KEY.PREFERRED_ENDPOINT,
ROCOCO_CONTRACTS.rpc,
POP_NETWORK_TESTNET.rpc,
);
const [api, setApi] = useState({} as ApiPromise);
const [endpoint, setEndpoint] = useState(preferredEndpoint);
Expand Down
Loading