diff --git a/.changeset/olive-spoons-return.md b/.changeset/olive-spoons-return.md new file mode 100644 index 00000000..09c51b14 --- /dev/null +++ b/.changeset/olive-spoons-return.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/registry': patch +--- + +Fix misnamed warp routes diff --git a/deployments/warp_routes/TAURA/euphoriatesnet-holesky-addresses.yaml b/deployments/warp_routes/TAURA/euphoriatestnet-holesky-addresses.yaml similarity index 88% rename from deployments/warp_routes/TAURA/euphoriatesnet-holesky-addresses.yaml rename to deployments/warp_routes/TAURA/euphoriatestnet-holesky-addresses.yaml index d85393bf..434dd0a0 100644 --- a/deployments/warp_routes/TAURA/euphoriatesnet-holesky-addresses.yaml +++ b/deployments/warp_routes/TAURA/euphoriatestnet-holesky-addresses.yaml @@ -1,4 +1,4 @@ -euphoriatesnet: +euphoriatestnet: synthetic: "0x120f461C4d95412c4a1BC4e8BE6917C9da404510" holesky: collateral: "0x0bA0E052b993E8486AA8dab82c361404F7576573" diff --git a/deployments/warp_routes/TAURA/euphoriatesnet-holesky-config.yaml b/deployments/warp_routes/TAURA/euphoriatestnet-holesky-config.yaml similarity index 83% rename from deployments/warp_routes/TAURA/euphoriatesnet-holesky-config.yaml rename to deployments/warp_routes/TAURA/euphoriatestnet-holesky-config.yaml index b9b9b83c..0dac550d 100644 --- a/deployments/warp_routes/TAURA/euphoriatesnet-holesky-config.yaml +++ b/deployments/warp_routes/TAURA/euphoriatestnet-holesky-config.yaml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=../schema.json tokens: - addressOrDenom: "0x120f461C4d95412c4a1BC4e8BE6917C9da404510" - chainName: euphoriatesnet + chainName: euphoriatestnet connections: - token: ethereum|holesky|0x0bA0E052b993E8486AA8dab82c361404F7576573 decimals: 18 @@ -12,7 +12,7 @@ tokens: chainName: holesky collateralAddressOrDenom: "0x89C17409dc7222E378A433CE75DDd4dF8a1c4874" connections: - - token: ethereum|euphoriatesnet|0x120f461C4d95412c4a1BC4e8BE6917C9da404510 + - token: ethereum|euphoriatestnet|0x120f461C4d95412c4a1BC4e8BE6917C9da404510 decimals: 18 name: Aura Testing standard: EvmHypCollateral diff --git a/deployments/warp_routes/TIA/eclipse-stride-addresses.yaml b/deployments/warp_routes/TIA/eclipsemainnet-stride-addresses.yaml similarity index 100% rename from deployments/warp_routes/TIA/eclipse-stride-addresses.yaml rename to deployments/warp_routes/TIA/eclipsemainnet-stride-addresses.yaml diff --git a/deployments/warp_routes/TIA/eclipse-stride-config.yaml b/deployments/warp_routes/TIA/eclipsemainnet-stride-config.yaml similarity index 100% rename from deployments/warp_routes/TIA/eclipse-stride-config.yaml rename to deployments/warp_routes/TIA/eclipsemainnet-stride-config.yaml diff --git a/deployments/warp_routes/TIA/manta-osmosis-addresses.yaml b/deployments/warp_routes/TIA/mantapacific-osmosis-addresses.yaml similarity index 100% rename from deployments/warp_routes/TIA/manta-osmosis-addresses.yaml rename to deployments/warp_routes/TIA/mantapacific-osmosis-addresses.yaml diff --git a/deployments/warp_routes/TIA/manta-osmosis-config.yaml b/deployments/warp_routes/TIA/mantapacific-osmosis-config.yaml similarity index 100% rename from deployments/warp_routes/TIA/manta-osmosis-config.yaml rename to deployments/warp_routes/TIA/mantapacific-osmosis-config.yaml diff --git a/deployments/warp_routes/milkTIA/manta-osmosis-addresses.yaml b/deployments/warp_routes/milkTIA/mantapacific-osmosis-addresses.yaml similarity index 100% rename from deployments/warp_routes/milkTIA/manta-osmosis-addresses.yaml rename to deployments/warp_routes/milkTIA/mantapacific-osmosis-addresses.yaml diff --git a/deployments/warp_routes/milkTIA/manta-osmosis-config.yaml b/deployments/warp_routes/milkTIA/mantapacific-osmosis-config.yaml similarity index 100% rename from deployments/warp_routes/milkTIA/manta-osmosis-config.yaml rename to deployments/warp_routes/milkTIA/mantapacific-osmosis-config.yaml diff --git a/deployments/warp_routes/stTIA/eclipse-stride-addresses.yaml b/deployments/warp_routes/stTIA/eclipsemainnet-stride-addresses.yaml similarity index 100% rename from deployments/warp_routes/stTIA/eclipse-stride-addresses.yaml rename to deployments/warp_routes/stTIA/eclipsemainnet-stride-addresses.yaml diff --git a/deployments/warp_routes/stTIA/eclipse-stride-config.yaml b/deployments/warp_routes/stTIA/eclipsemainnet-stride-config.yaml similarity index 100% rename from deployments/warp_routes/stTIA/eclipse-stride-config.yaml rename to deployments/warp_routes/stTIA/eclipsemainnet-stride-config.yaml diff --git a/test/unit/warp-routes.test.ts b/test/unit/warp-routes.test.ts index cc77b6af..af44f36d 100644 --- a/test/unit/warp-routes.test.ts +++ b/test/unit/warp-routes.test.ts @@ -2,9 +2,13 @@ import { expect } from 'chai'; import { MultiProtocolProvider, WarpCore } from '@hyperlane-xyz/sdk'; import { FileSystemRegistry } from '../../src/registry/FileSystemRegistry.js'; +import { createWarpRouteConfigId, parseWarpRouteConfigId } from '../../src/registry/warp-utils.js'; +import path from 'path'; +import fs from 'fs'; describe('Warp Route Configs', () => { - const localRegistry = new FileSystemRegistry({ uri: './' }); + const BASE_URI = './'; + const localRegistry = new FileSystemRegistry({ uri: BASE_URI }); const chainMetadata = localRegistry.getMetadata(); const multiProvider = new MultiProtocolProvider(chainMetadata); const routes = localRegistry.getWarpRoutes(); @@ -17,5 +21,51 @@ describe('Warp Route Configs', () => { expect(warpCore).to.be.an.instanceOf(WarpCore); expect(warpCore.tokens.length).to.be.greaterThan(0); }); + + it(`Route ${id} has valid chain names`, () => { + const { chainNames } = parseWarpRouteConfigId(id); + + // Verify each chain exists in registry + for (const chain of chainNames) { + expect(localRegistry.getChainMetadata(chain), `Chain ${chain} not found in registry`).to.not.be.null; + } + }); + + it(`Route ${id} has chain names in alphabetical order`, () => { + const { chainNames } = parseWarpRouteConfigId(id); + + // Verify chains are in alphabetical order + const sortedChains = [...chainNames].sort(); + expect(chainNames).to.deep.equal(sortedChains, 'Chain names must be in alphabetical order'); + }); + + it(`Route ${id} has valid token logoURIs`, () => { + const config = routes[id]; + config.tokens.forEach((token) => { + if (token.logoURI) { + expect(fs.existsSync(path.join(BASE_URI, token.logoURI)), `Logo file ${token.logoURI} not found`).to.be.true; + } + }); + }); + + it(`Route ${id} matches derived id from config`, () => { + // Skip check on TIA/forma-stride to avoid breaking changes to forma + if (id === 'TIA/forma-stride') { + return; + } + + // Get the symbol and chain names from the config + const config = routes[id]; + const { chainNames } = parseWarpRouteConfigId(id); + + // Create the ID from the config + const symbol = config.tokens[0].symbol; + const tokenChains = [...new Set(config.tokens.map((token) => token.chainName))]; + const derivedId = createWarpRouteConfigId(symbol, tokenChains); + const { chainNames: derivedChainNames } = parseWarpRouteConfigId(derivedId); + + // Verify the chain names match + expect(chainNames).to.deep.equal(derivedChainNames, 'Chain names in ID must match derived chain names'); + }); } });