-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
183 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@helixbridge/chains": minor | ||
--- | ||
|
||
Synchronize helixconf updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...es/chains/src/chains/berachain-testnet.ts → packages/chains/src/chains/bera.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { berachainTestnet as berachainTestnetViem } from "viem/chains"; | ||
import { Chain } from "../types"; | ||
import { berachainTestnetbArtio as beraViem } from "viem/chains"; | ||
|
||
export const berachainTestnet: Chain = { | ||
...berachainTestnetViem, | ||
export const bera: Chain = { | ||
...beraViem, | ||
network: "bera", | ||
logo: "https://raw.githubusercontent.com/helix-bridge/helix-ui/main/packages/assets/images/chains/bera.png", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { morphHolesky } from "viem/chains"; | ||
import { Chain } from "../types"; | ||
|
||
export const morphTestnet: Chain = { | ||
...morphHolesky, | ||
network: "morph-testnet", | ||
logo: "https://raw.githubusercontent.com/helix-bridge/helix-ui/main/packages/assets/images/chains/morph.png", | ||
}; |
6 changes: 3 additions & 3 deletions
6
packages/chains/src/chains/morph-sepolia.ts → packages/chains/src/chains/morph.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { morphSepolia as morphSepoliaViem } from "viem/chains"; | ||
import { Chain } from "../types"; | ||
import { morph as morphViem } from "viem/chains"; | ||
|
||
export const morphSepolia: Chain = { | ||
...morphSepoliaViem, | ||
export const morph: Chain = { | ||
...morphViem, | ||
network: "morph", | ||
logo: "https://raw.githubusercontent.com/helix-bridge/helix-ui/main/packages/assets/images/chains/morph.png", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Chain } from "../types"; | ||
|
||
import { zircuitTestnet } from "viem/chains"; | ||
|
||
export const zircuitSepolia: Chain = { | ||
...zircuitTestnet, | ||
network: "zircuit-sepolia", | ||
logo: "https://raw.githubusercontent.com/helix-bridge/helix-ui/main/packages/assets/images/chains/zircuit.png", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Chain } from "../types"; | ||
|
||
import { zircuit as zircuitViem } from "viem/chains"; | ||
|
||
export const zircuit: Chain = { | ||
...zircuitViem, | ||
network: "zircuit", | ||
logo: "https://raw.githubusercontent.com/helix-bridge/helix-ui/main/packages/assets/images/chains/zircuit.png", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
import { HelixChain } from "@helixbridge/helixconf"; | ||
import { getChainByIdOrNetwork, getChains } from "."; | ||
import { ChainID } from "../types"; | ||
import { Network } from "../types"; | ||
|
||
const numberOfChains = Object.keys(ChainID).length / 2; | ||
const chains = getChains(); | ||
|
||
test(`The number of chains should be equal to ${numberOfChains}`, () => { | ||
expect(chains.length).toBe(numberOfChains); | ||
test("An equal number of chains should be configured", () => { | ||
expect(getChains().length).toBe(HelixChain.chains().length); | ||
}); | ||
|
||
describe.each(getChains())("$name", ({ id, network }) => { | ||
test(`The 'network' should be configured correctly`, () => { | ||
expect(network).toBe(HelixChain.get(id)?.code); | ||
}); | ||
|
||
describe.each(HelixChain.chains().map(({ id, code, name }) => ({ id, code, name })))("$name", ({ id, code }) => { | ||
test(`getChainByIdOrNetwork(${id}) should return the correct chain`, () => { | ||
expect(getChainByIdOrNetwork(id)?.network).toBe(network); | ||
expect(getChainByIdOrNetwork(Number(id))?.network).toBe(code); | ||
}); | ||
test(`getChainByIdOrNetwork('${network}') should return the correct chain`, () => { | ||
expect(getChainByIdOrNetwork(network)?.id).toBe(id); | ||
test(`getChainByIdOrNetwork('${code}') should return the correct chain`, () => { | ||
expect(getChainByIdOrNetwork(code as Network)?.id).toBe(Number(id)); | ||
}); | ||
|
||
const logo = getChainByIdOrNetwork(Number(id))?.logo; | ||
if (logo) { | ||
test(`${logo} should be available`, async () => { | ||
const res = await fetch(logo); | ||
expect(res.status).not.toBe(404); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.