Check Mailbox, IGP, and ISM in HyperlaneRouterChecker (#1490)

pull/1511/head
Asa Oines 2 years ago committed by GitHub
parent a79cb50bcd
commit 5bf7d0d6ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      typescript/sdk/src/deploy/router/HyperlaneRouterChecker.ts

@ -1,3 +1,5 @@
import { ethers } from 'ethers';
import { Ownable } from '@hyperlane-xyz/core';
import { utils } from '@hyperlane-xyz/utils';
@ -22,10 +24,25 @@ export class HyperlaneRouterChecker<
}
async checkChain(chain: Chain): Promise<void> {
await this.checkHyperlaneConnectionClient(chain);
await this.checkEnrolledRouters(chain);
await this.checkOwnership(chain);
}
async checkHyperlaneConnectionClient(chain: Chain): Promise<void> {
const router = this.app.getContracts(chain).router;
const mailbox = await router.mailbox();
const igp = await router.interchainGasPaymaster();
const ism = await router.interchainSecurityModule();
utils.assert(mailbox, this.configMap[chain].mailbox);
utils.assert(igp, this.configMap[chain].interchainGasPaymaster);
utils.assert(
ism,
this.configMap[chain].interchainSecurityModule ||
ethers.constants.AddressZero,
);
}
async checkEnrolledRouters(chain: Chain): Promise<void> {
const router = this.app.getContracts(chain).router;

Loading…
Cancel
Save