-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: instantiate router config in warp generators (#4807)
### Description Uncomments generator code to actually instantiate a `routerConfig`, as recommended in #4799 (comment) ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests --> --------- Co-authored-by: Trevor Porter <tkporter4@gmail.com>
- Loading branch information
1 parent
3660ebe
commit ffbc13c
Showing
3 changed files
with
40 additions
and
6 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,30 @@ | ||
import { Contexts } from '../../config/contexts.js'; | ||
import { Role } from '../../src/roles.js'; | ||
import { | ||
getArgs, | ||
withBuildArtifactPath, | ||
withChains, | ||
withConcurrentDeploy, | ||
withContext, | ||
} from '../agent-utils.js'; | ||
import { getEnvironmentConfig, getHyperlaneCore } from '../core-utils.js'; | ||
|
||
export async function getRouterConfig() { | ||
const { | ||
context = Contexts.Hyperlane, | ||
environment, | ||
chains, | ||
} = await withContext( | ||
withConcurrentDeploy(withChains(withBuildArtifactPath(getArgs()))), | ||
).argv; | ||
const envConfig = getEnvironmentConfig(environment); | ||
|
||
let multiProvider = await envConfig.getMultiProvider( | ||
context, | ||
Role.Deployer, | ||
true, | ||
chains, | ||
); | ||
const { core } = await getHyperlaneCore(environment, multiProvider); | ||
return core.getRouterConfig(envConfig.owners); | ||
} |