Skip to content
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

CSUB-711 #92

Merged
merged 1 commit into from
Sep 1, 2023
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
Change network selection to refresh the page
  • Loading branch information
Ada Anderson committed Sep 1, 2023
commit bd3b342a72aaeaf4bb2a522a95a1e8ffb7d30d29
14 changes: 7 additions & 7 deletions src/config/validators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

export const ValidatorCommunity = [
{
name: 'Gluwa Creditcoin Test Validators',
name: 'Gluwa Creditcoin Validators',
thumbnail: 'Creditcoin',
bio: "Gluwa's Testnet validators",
bio: "Gluwa's Validators",
email: 'support@gluwa.com',
twitter: '@gluwa',
website: 'https://www.gluwa.com/',
validators: {
creditcoin: [
'5CULfDi42UBMjMeqtjacqBZipJnhe2SGrwpd6ESiLmbyEmKg',
'5D7awaYe3Yiu5DgA1ruoa3fyj7UNUckaNAaQU5g8cdjAqv7Q',
'5D8CruiQXVRQR7fozWMn831R2xhNwD1uebBGj2dDKTJtBxFW',
'5EWzXL6QnUKP5mpwGCq3P9gZ5BsrPdhRa8KUc2zZNYNYCqHw',
'5GYm8tjVuqJdNMbXxydrHEHjU7pL3cbj1xAmajTeLq5jrDEL',
'5HKXYLemHQxX3tt1uiFieVZtPyxw21KXZYcHe8Ewh6TLH8RG',
'5GEAkopZHtHfuShTjkRNTzZZSocTGSxMdehgqpkNybhFBH9Q',
'5GmuAjuXE2hQ3ug9erMn6d1QD4RCwR6DQtfBAQNotYGwNZyx',
'5D7CvR47XP2PWufhDH7r5WMchCwc6cN6CmhCvPao3gTDpnb7',
'5GjH25E5v9AhumLsEq2aGPS5hHz3t1R3YkupAueNc9Umjs1A',
],
creditcoinTest: [
'5CULfDi42UBMjMeqtjacqBZipJnhe2SGrwpd6ESiLmbyEmKg',
Expand Down
32 changes: 2 additions & 30 deletions src/contexts/Api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
extractUrlValue,
makeCancelable,
rmCommas,
varToUrlHash,
} from '@polkadotcloud/utils';
import BigNumber from 'bignumber.js';
import { NetworkList } from 'config/networks';
Expand Down Expand Up @@ -59,36 +58,9 @@
};

// handle network switching
const switchNetwork = async (name: NetworkName, lightClient: boolean) => {

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'lightClient' is defined but never used

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'lightClient' is defined but never used

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'lightClient' is defined but never used

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'lightClient' is defined but never used

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'lightClient' is defined but never used

Check warning on line 61 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'lightClient' is defined but never used
// disconnect api if there is an existing connection.
if (api) {
await api.disconnect();
setApi(null);
}
// handle local light client flag.
if (lightClient) {
localStorage.setItem('light_client', lightClient ? 'true' : '');
} else {
localStorage.removeItem('light_client');
}

setNetwork({
name,
meta: NetworkList[name],
});

// handle light client state, which will trigger dynamic Sc import.
setIsLightClient(lightClient);

// update url `n` if needed.
varToUrlHash('n', name, false);

// if not light client, directly connect. Otherwise, `connect` is called after dynamic import of
// Sc.
if (!lightClient) {
setApiStatus('connecting');
connectProvider(name);
}
localStorage.setItem('network', name);
window.location.reload();
};

// Store povider instance.
Expand All @@ -97,7 +69,7 @@
);

// Store whether in light client mode.
const [isLightClient, setIsLightClient] = useState<boolean>(

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'setIsLightClient' is assigned a value but never used

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'setIsLightClient' is assigned a value but never used

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'setIsLightClient' is assigned a value but never used

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'setIsLightClient' is assigned a value but never used

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'setIsLightClient' is assigned a value but never used

Check warning on line 72 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'setIsLightClient' is assigned a value but never used
!!localStorage.getItem('light_client')
);

Expand All @@ -106,7 +78,7 @@

// Store the initial active network.
const initialNetwork = getInitialNetwork();
const [network, setNetwork] = useState<NetworkState>({

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'setNetwork' is assigned a value but never used

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'setNetwork' is assigned a value but never used

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'setNetwork' is assigned a value but never used

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'setNetwork' is assigned a value but never used

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'setNetwork' is assigned a value but never used

Check warning on line 81 in src/contexts/Api/index.tsx

View workflow job for this annotation

GitHub Actions / build (19.x)

'setNetwork' is assigned a value but never used
name: initialNetwork,
meta: NetworkList[initialNetwork],
});
Expand Down