diff --git a/src/contexts/network/index.tsx b/src/contexts/network/index.tsx index 90e72f9f..24d9e2f7 100644 --- a/src/contexts/network/index.tsx +++ b/src/contexts/network/index.tsx @@ -32,13 +32,13 @@ const NetworkProvider = ({ children }: Props) => { if (network === 'rococo') setActiveNetwork(NetworkType.ROCOCO); else if (network === 'kusama') setActiveNetwork(NetworkType.KUSAMA); else { - // invalid network param. redirect to the default chain: rococo + // invalid network param. redirect to the default chain: kusama router.push( { pathname: router.pathname, query: { ...router.query, - network: 'rococo', + network: 'kusama', }, }, undefined, diff --git a/src/utils/functions.ts b/src/utils/functions.ts index 455c0fa9..b8bc13bc 100644 --- a/src/utils/functions.ts +++ b/src/utils/functions.ts @@ -88,7 +88,7 @@ export const formatBalance = (balance: string, regionXChain: boolean) => { // // https://github.com/paritytech/polkadot-sdk/pull/3485 export const leadinFactorAt = (network: any, when: number) => { - if (!network || network === 'rococo') return 2 - when; + if (network === 'rococo') return 2 - when; else { return 5 - 4 * when; } @@ -160,7 +160,7 @@ export const sendTx = ( export const getBlockTime = (network: any): number => { // Coretime on Rococo has async backing and due to this it has a block time of 6 seconds. - const blockTime = !network || network == 'rococo' ? 6000 : 12000; + const blockTime = !network || network == 'kusama' ? 12000 : 6000; return blockTime; }; @@ -169,7 +169,7 @@ export const rcBlockToParachainBlock = ( blockNumber: number ): number => { // Coretime on Rococo has async backing and due to this it has a block time of 6 seconds. - return !network || network == 'rococo' + return network == 'rococo' ? blockNumber : Math.floor(blockNumber / 2); };