-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from hyperlane-xyz/metadata-parsing-fix
Fix chain metadata parsing
- Loading branch information
Showing
3 changed files
with
36 additions
and
8 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
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,29 @@ | ||
import { tryParseChainConfig } from './chainConfig'; | ||
|
||
const validConfig = { | ||
chainId: 12345, | ||
name: 'mytestnet', | ||
protocol: 'ethereum', | ||
rpcUrls: [{ http: 'https://fakerpc.com' }], | ||
blockExplorers: [ | ||
{ | ||
name: 'FakeScan', | ||
family: 'other', | ||
url: 'https://fakeexplorer.com', | ||
apiUrl: 'https://fakeexplorer.com', | ||
}, | ||
], | ||
blocks: { confirmations: 1, estimateBlockTime: 10 }, | ||
mailbox: '0x14999bccB37118713891DAAA1D5959a02E206C1f', | ||
}; | ||
|
||
describe('chain configs', () => { | ||
it('parses valid config', async () => { | ||
const result = tryParseChainConfig(JSON.stringify(validConfig)); | ||
expect(result.success).toBe(true); | ||
}); | ||
it('rejects invalid config', async () => { | ||
const result = tryParseChainConfig(JSON.stringify({ ...validConfig, chainId: undefined })); | ||
expect(result.success).toBe(false); | ||
}); | ||
}); |
ba44dc7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hyperlane-explorer – ./
hyperlane-explorer-git-main-abacus-works.vercel.app
hyperlane-explorer.vercel.app
hyperlane-explorer-abacus-works.vercel.app
explorer.hyperlane.xyz