Skip to content

Commit

Permalink
fix: deprecate goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Apr 1, 2024
1 parent a5d6089 commit 15df249
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
required: true
network:
type: string
default: 'Goerli'
default: 'Sepolia'
required: true
publish_to_allure: #Here we define the variable that can be overwritten by caller workflow
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
secrets: inherit
with:
targetUrl: ${{ needs.deploy.outputs.dappUrl }}
network: Goerli
network: Sepolia
publish_to_allure: true
environmentTags: ""
21 changes: 2 additions & 19 deletions data/networks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { goerli, mainnet, sepolia } from "@wagmi/core/chains";
import { mainnet, sepolia } from "@wagmi/core/chains";

import Hyperchains from "@/hyperchains/config.json";

Expand All @@ -11,10 +11,6 @@ export const l1Networks = {
name: "Ethereum",
network: "mainnet",
},
goerli: {
...goerli,
name: "Ethereum Goerli Testnet",
},
sepolia: {
...sepolia,
name: "Ethereum Sepolia Testnet",
Expand Down Expand Up @@ -91,25 +87,12 @@ const publicChains: ZkSyncNetwork[] = [
},
l1Network: l1Networks.sepolia,
},
{
id: 280,
key: "goerli",
name: "zkSync Goerli Testnet",
rpcUrl: "https://testnet.era.zksync.dev",
blockExplorerUrl: "https://goerli.explorer.zksync.io",
blockExplorerApi: "https://block-explorer-api.testnets.zksync.dev",
deprecated: true,
displaySettings: {
showPartnerLinks: true,
},
l1Network: l1Networks.goerli,
},
{
id: 270,
key: "stage",
name: "zkSync Stage",
rpcUrl: "https://z2-dev-api.zksync.dev",
blockExplorerUrl: "https://goerli-beta.staging-scan-v2.zksync.dev",
blockExplorerUrl: "https://sepolia-beta.staging-scan-v2.zksync.dev",
blockExplorerApi: "https://block-explorer-api.stage.zksync.dev",
l1Network: l1Networks.sepolia,
hidden: true,
Expand Down
4 changes: 2 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
},
{
"source": "https://goerli.staging-portal.zksync.dev/*",
"destination": "https://staging-portal.zksync.dev/?network=goerli",
"destination": "https://staging-portal.zksync.dev/?network=sepolia",
"type": 301
},
{
"source": "https://goerli.portal.zksync.io/*",
"destination": "https://portal.zksync.io/?network=goerli",
"destination": "https://portal.zksync.io/?network=sepolia",
"type": 301
}
]
Expand Down
10 changes: 9 additions & 1 deletion plugins/redirects.client.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
export default defineNuxtPlugin(() => {
const currentUrl = new URL(window.location.href);
const redirectNetworkKeys = ["goerli", "sepolia"];
const deprecatedNetworkKeys = ["goerli"];
for (const network of redirectNetworkKeys) {
if (currentUrl.origin === `https://${network}.portal.zksync.io`) {
const newUrl = new URL(currentUrl.href);
newUrl.hostname = "portal.zksync.io";
newUrl.searchParams.set("network", network);
if (deprecatedNetworkKeys.includes(network)) {
newUrl.searchParams.set(
"network",
redirectNetworkKeys.filter((key) => !deprecatedNetworkKeys.includes(key))[0]
);
} else {
newUrl.searchParams.set("network", network);
}
navigateTo(newUrl.href, {
external: true,
});
Expand Down
5 changes: 1 addition & 4 deletions store/ethereumBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ export const useEthereumBalanceStore = defineStore("ethereumBalance", () => {
if (!runtimeConfig.public.ankrToken) throw new Error("Ankr token is not available");

const ankrProvider = new AnkrProvider(`https://rpc.ankr.com/multichain/${runtimeConfig.public.ankrToken}`);
const networkIdToAnkr = new Map<number, AnkrSupportedChains>([
[l1Networks.mainnet.id, "eth"],
[l1Networks.goerli.id, "eth_goerli"],
]);
const networkIdToAnkr = new Map<number, AnkrSupportedChains>([[l1Networks.mainnet.id, "eth"]]);
if (!networkIdToAnkr.has(eraNetwork.value.l1Network.id)) {
throw new Error(`Ankr does not support ${eraNetwork.value.l1Network.name}`);
}
Expand Down
5 changes: 1 addition & 4 deletions store/zksync/ethereumBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ export const useZkSyncEthereumBalanceStore = defineStore("zkSyncEthereumBalances
async () => {
if (!l1Network.value) throw new Error(`L1 network is not available on ${selectedNetwork.value.name}`);

if (
([l1Networks.mainnet.id, l1Networks.goerli.id] as number[]).includes(l1Network.value?.id) &&
runtimeConfig.public.ankrToken
) {
if (([l1Networks.mainnet.id] as number[]).includes(l1Network.value?.id) && runtimeConfig.public.ankrToken) {
return await getBalancesFromApi();
} else {
return await getBalancesFromRPC();
Expand Down

0 comments on commit 15df249

Please sign in to comment.