Skip to content

Commit

Permalink
chore: Add new network type (#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev authored May 13, 2024
1 parent 50a1f9d commit 9389db4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/src/models/db/networkType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const SHIMMER = "shimmer";
const TESTNET = "testnet";
const IOTA_TESTNET = "iota-testnet";
const SHIMMER_TESTNET = "shimmer-testnet";
const IOTA2_TESTNET = "iota2-testnet";
const ALPHANET = "alphanet";
const CUSTOM = "custom";

Expand All @@ -19,6 +20,7 @@ const networkTypes = [
TESTNET,
IOTA_TESTNET,
SHIMMER_TESTNET,
IOTA2_TESTNET,
ALPHANET,
CUSTOM,
] as const;
Expand Down
15 changes: 13 additions & 2 deletions client/src/app/AppUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ import React, { ReactNode } from "react";
import { Helmet } from "react-helmet";
import NetworkContext from "./context/NetworkContext";
import { INetwork } from "~models/config/INetwork";
import { ALPHANET, CHRYSALIS_MAINNET, DEVNET, LEGACY_MAINNET, MAINNET, NetworkType, SHIMMER, TESTNET } from "~models/config/networkType";
import {
ALPHANET,
CHRYSALIS_MAINNET,
DEVNET,
IOTA2_TESTNET,
LEGACY_MAINNET,
MAINNET,
NetworkType,
SHIMMER,
TESTNET,
} from "~models/config/networkType";
import { IOTA_UI, Theme } from "~models/config/uiTheme";
import { IStardustNodeInfo } from "~services/stardust/nodeInfoService";
import { ServiceFactory } from "~/factories/serviceFactory";
Expand Down Expand Up @@ -132,7 +142,8 @@ export const buildMetaLabel = (network: NetworkType | undefined): string => {
metaLabel = "Shimmer Explorer";
break;
}
case TESTNET: {
case TESTNET:
case IOTA2_TESTNET: {
metaLabel = "Testnet Explorer";
break;
}
Expand Down
4 changes: 3 additions & 1 deletion client/src/helpers/networkHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CHRYSALIS_MAINNET,
CUSTOM,
DEVNET,
IOTA2_TESTNET,
IOTA_TESTNET,
LEGACY_MAINNET,
MAINNET,
Expand All @@ -26,7 +27,8 @@ export const getNetworkOrder = (networkType: NetworkType) => {
case SHIMMER: {
return 1;
}
case IOTA_TESTNET: {
case IOTA_TESTNET:
case IOTA2_TESTNET: {
return 2;
}
case SHIMMER_TESTNET: {
Expand Down
2 changes: 2 additions & 0 deletions client/src/models/config/networkType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const SHIMMER = "shimmer";
export const TESTNET = "testnet";
export const IOTA_TESTNET = "iota-testnet";
export const SHIMMER_TESTNET = "shimmer-testnet";
export const IOTA2_TESTNET = "iota2-testnet";
export const ALPHANET = "alphanet";
export const CUSTOM = "custom";

Expand All @@ -20,6 +21,7 @@ export type NetworkType =
| typeof SHIMMER
| typeof TESTNET
| typeof IOTA_TESTNET
| typeof IOTA2_TESTNET
| typeof SHIMMER_TESTNET
| typeof ALPHANET
| typeof CUSTOM;

0 comments on commit 9389db4

Please sign in to comment.