Skip to content

Commit

Permalink
Fix router app fork tests (#2676)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes authored Aug 29, 2023
1 parent 478826b commit 1f4ddfa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
10 changes: 0 additions & 10 deletions typescript/infra/config/environments/testnet3/helloworld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,3 @@ export const helloWorld = {
[Contexts.Hyperlane]: hyperlaneHelloworld,
[Contexts.ReleaseCandidate]: releaseCandidateHelloworld,
};

export const helloWorldConfig = (
environment: DeployEnvironment,
context: Contexts,
routerConfigMap: ChainMap<RouterConfig>,
): ChainMap<HelloWorldContractsConfig> =>
objMap(routerConfigMap, (chain, routerConfig) => ({
...routerConfig,
interchainSecurityModule: aggregationIsm(environment, chain, context),
}));
8 changes: 3 additions & 5 deletions typescript/infra/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import { objMap } from '@hyperlane-xyz/utils';

import { Contexts } from '../config/contexts';
import { helloWorldConfig } from '../config/environments/testnet3/helloworld';
import { deployEnvToSdkEnv } from '../src/config/environment';
import { deployWithArtifacts } from '../src/deployment/deploy';
import { TestQuerySenderDeployer } from '../src/deployment/testcontracts/testquerysender';
Expand Down Expand Up @@ -59,7 +58,7 @@ async function main() {
: '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba';

const signer = await impersonateAccount(deployerAddress);
multiProvider.setSigner(fork, signer);
multiProvider.setSharedSigner(signer);
}

let config: ChainMap<unknown> = {};
Expand Down Expand Up @@ -120,12 +119,11 @@ async function main() {
}));
deployer = new TestQuerySenderDeployer(multiProvider, igp);
} else if (module === Modules.HELLO_WORLD) {
const routerConfig = await getRouterConfig(
config = await getRouterConfig(
environment,
multiProvider,
true,
true, // use deployer as owner
);
config = helloWorldConfig(environment, context, routerConfig);
const ismFactory = HyperlaneIsmFactory.fromEnvironment(
deployEnvToSdkEnv[environment],
multiProvider,
Expand Down
10 changes: 8 additions & 2 deletions typescript/infra/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export async function assertCorrectKubeContext(coreConfig: EnvironmentConfig) {
export async function getRouterConfig(
environment: DeployEnvironment,
multiProvider: MultiProvider,
useMultiProviderOwners = true,
useMultiProviderOwners = false,
): Promise<ChainMap<RouterConfig>> {
const core = HyperlaneCore.fromEnvironment(
deployEnvToSdkEnv[environment],
Expand All @@ -265,6 +265,7 @@ export async function getRouterConfig(
const knownChains = multiProvider.intersect(
core.chains().concat(igp.chains()),
).intersection;

for (const chain of knownChains) {
config[chain] = {
owner: useMultiProviderOwners
Expand All @@ -281,8 +282,13 @@ export async function getRouterConfig(
export async function getProxiedRouterConfig(
environment: DeployEnvironment,
multiProvider: MultiProvider,
useMultiProviderOwners = false,
): Promise<ChainMap<ProxiedRouterConfig>> {
const config = await getRouterConfig(environment, multiProvider);
const config = await getRouterConfig(
environment,
multiProvider,
useMultiProviderOwners,
);
return objMap(config, (chain, routerConfig) => ({
timelock: environments[environment].core[chain].upgrade?.timelock,
...routerConfig,
Expand Down

0 comments on commit 1f4ddfa

Please sign in to comment.