Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3311 from bandprotocol/add-laozi-chain-id
Browse files Browse the repository at this point in the history
Scan: add laozi chain id
  • Loading branch information
Kanisorn Thongprapaisaeng authored May 5, 2021
2 parents 49e2ae8 + ee032ff commit deefc4d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scan/src/components/ChainIDBadge.re
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ type chainID =
| GuanYuTestnet
| GuanYuPOA
| GuanYuMainnet
| LaoziTestnet
| LaoziMainnet
| Unknown;

let parseChainID =
Expand All @@ -82,9 +84,13 @@ let parseChainID =
| "bandchain" => GuanYuDevnet
| "band-guanyu-testnet1"
| "band-guanyu-testnet2"
| "band-guanyu-testnet3" => GuanYuTestnet
| "band-guanyu-testnet3"
| "band-guanyu-testnet4" => GuanYuTestnet
| "band-guanyu-poa" => GuanYuPOA
| "band-guanyu-mainnet" => GuanYuMainnet
| "band-laozi-testnet1"
| "band-laozi-testnet2" => LaoziTestnet
| "band-laozi-mainnet" => LaoziMainnet
| _ => Unknown;

let getLink =
Expand All @@ -93,8 +99,10 @@ let getLink =
| WenchangMainnet
| GuanYuMainnet => "https://cosmoscan.io/"
| GuanYuDevnet => "https://guanyu-devnet.cosmoscan.io/"
| GuanYuTestnet => "https://guanyu-testnet3.cosmoscan.io/"
| GuanYuTestnet => "https://guanyu-testnet4.cosmoscan.io/"
| GuanYuPOA => "https://guanyu-poa.cosmoscan.io/"
| LaoziTestnet => "https://laozi-testnet.cosmoscan.io/"
| LaoziMainnet
| Unknown => "";

let getName =
Expand All @@ -105,6 +113,8 @@ let getName =
| GuanYuTestnet => "guanyu-testnet"
| GuanYuPOA => "guanyu-poa"
| GuanYuMainnet => "guanyu-mainnet"
| LaoziTestnet => "laozi-testnet"
| LaoziMainnet => "laozi-mainnet"
| Unknown => "unknown";

[@react.component]
Expand Down Expand Up @@ -132,7 +142,7 @@ let make = () =>
<HSpacing size=Spacing.sm />
<img src=Images.triangleDown className={Styles.downIcon(show)} />
<div className={Styles.dropdown(show)}>
{[|GuanYuMainnet, GuanYuTestnet, GuanYuPOA|]
{[|GuanYuMainnet, GuanYuTestnet|]
->Belt.Array.keep(chainID => chainID != currentChainID)
->Belt.Array.map(chainID => {
let name = chainID->getName;
Expand Down

0 comments on commit deefc4d

Please sign in to comment.