Skip to content

Commit

Permalink
get mailboxes from registry instead of router config
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalaji committed Jan 22, 2025
1 parent f3ee01a commit 76b1c29
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
EvmHypXERC20LockboxAdapter,
IHypXERC20Adapter,
MultiProtocolProvider,
RouterConfig,
SealevelHypTokenAdapter,
Token,
TokenStandard,
Expand All @@ -18,10 +17,7 @@ import {
import { ProtocolType, objMap, objMerge, sleep } from '@hyperlane-xyz/utils';

import { getWarpCoreConfig } from '../../../config/registry.js';
import {
DeployEnvironment,
getRouterConfigsForAllVms,
} from '../../../src/config/environment.js';
import { DeployEnvironment } from '../../../src/config/environment.js';
import { fetchGCPSecret } from '../../../src/utils/gcloud.js';
import { startMetricsServer } from '../../../src/utils/metrics.js';
import {
Expand Down Expand Up @@ -59,17 +55,15 @@ async function main() {
const envConfig = getEnvironmentConfig(environment);
const registry = await envConfig.getRegistry();
const chainMetadata = await registry.getMetadata();
const chainAddresses = await registry.getAddresses();

// The Sealevel warp adapters require the Mailbox address, so we
// get router configs (that include the Mailbox address) for all chains
// and merge them with the chain metadata.
const routerConfig = await getRouterConfigsForAllVms(
envConfig,
await envConfig.getMultiProvider(),
);
const mailboxes = objMap(routerConfig, (_chain, config: RouterConfig) => ({
mailbox: config.mailbox,
}));
// get mailboxes for all chains and merge them with the chain metadata.
const mailboxes = objMap(chainAddresses, (_, { mailbox }) => {
return {
mailbox,
};
});
const multiProtocolProvider = new MultiProtocolProvider(
objMerge(chainMetadata, mailboxes),
);
Expand Down

0 comments on commit 76b1c29

Please sign in to comment.