-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description This PR adds warp config unit tests to compares the Registry's configs to the configs generated by the Checkers. The goal of this test is to ensure syncing between the programatic configs (e.g. Renzo) to whats checked into the Registry. ### Backward compatibility Yes ### Testing Manual
- Loading branch information
Showing
7 changed files
with
74 additions
and
12 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
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,52 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { MultiProvider } from '@hyperlane-xyz/sdk'; | ||
import { diffObjMerge } from '@hyperlane-xyz/utils'; | ||
|
||
import { getGithubRegistry } from '../config/registry.js'; | ||
import { getWarpConfig, warpConfigGetterMap } from '../config/warp.js'; | ||
import { | ||
getEnvironmentConfig, | ||
getHyperlaneCore, | ||
} from '../scripts/core-utils.js'; | ||
|
||
const DEFAULT_TIMEOUT = 20000; | ||
describe('Warp Configs', async function () { | ||
this.timeout(DEFAULT_TIMEOUT); | ||
const ENV = 'mainnet3'; | ||
const warpIdsToCheck = Object.keys(warpConfigGetterMap); | ||
let multiProvider: MultiProvider; | ||
|
||
before(async () => { | ||
multiProvider = (await getHyperlaneCore(ENV)).multiProvider; | ||
}); | ||
|
||
const envConfig = getEnvironmentConfig(ENV); | ||
|
||
for (const warpRouteId of warpIdsToCheck) { | ||
it(`should match Github Registry configs for ${warpRouteId}`, async () => { | ||
const warpConfig = await getWarpConfig( | ||
multiProvider, | ||
envConfig, | ||
warpRouteId, | ||
); | ||
const githubRegistry = getGithubRegistry(); | ||
const configsFromGithub = await githubRegistry.getWarpDeployConfig( | ||
warpRouteId, | ||
); | ||
const { mergedObject, isInvalid } = diffObjMerge( | ||
warpConfig, | ||
configsFromGithub!, | ||
); | ||
|
||
if (isInvalid) { | ||
console.log('Differences', JSON.stringify(mergedObject, null, 2)); | ||
} | ||
|
||
expect( | ||
isInvalid, | ||
`Registry config does not match Getter for ${warpRouteId}`, | ||
).to.be.false; | ||
}); | ||
} | ||
}); |
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