@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
34 lines • 1.37 kB
JavaScript
import { HyperlaneRouterChecker } from './HyperlaneRouterChecker.js';
export class ProxiedRouterChecker extends HyperlaneRouterChecker {
getOwnableOverrides(chain) {
const config = this.configMap[chain];
let ownableOverrides = config?.ownerOverrides;
// timelock and proxyAdmin are mutally exclusive
if (config?.timelock) {
ownableOverrides = {
...ownableOverrides,
proxyAdmin: this.app.getAddresses(chain).timelockController,
};
}
else if (config?.proxyAdmin) {
ownableOverrides = {
...ownableOverrides,
proxyAdmin: config.proxyAdmin.owner,
};
}
return ownableOverrides;
}
async checkOwnership(chain) {
return super.checkOwnership(chain, this.configMap[chain].owner, this.getOwnableOverrides(chain));
}
async checkProxiedContracts(chain) {
return super.checkProxiedContracts(chain, this.configMap[chain].owner, this.getOwnableOverrides(chain));
}
async checkChain(chain, expectedChains) {
await super.checkMailboxClient(chain);
await super.checkEnrolledRouters(chain, expectedChains);
await this.checkProxiedContracts(chain);
await this.checkOwnership(chain);
}
}
//# sourceMappingURL=ProxiedRouterChecker.js.map