From 74cc8e8dd743e49713c017fb1aa11a1003c8ffb3 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 12 Apr 2022 13:44:25 +0100 Subject: [PATCH] Add inbox / outbox multisig validator managers to core contracts --- typescript/sdk/src/core/contracts.ts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/typescript/sdk/src/core/contracts.ts b/typescript/sdk/src/core/contracts.ts index ddb095ae8..80a6f15e1 100644 --- a/typescript/sdk/src/core/contracts.ts +++ b/typescript/sdk/src/core/contracts.ts @@ -3,8 +3,10 @@ import { XAppConnectionManager__factory, UpgradeBeaconController, UpgradeBeaconController__factory, - ValidatorManager, - ValidatorManager__factory, + OutboxMultisigValidatorManager, + OutboxMultisigValidatorManager__factory, + InboxMultisigValidatorManager, + InboxMultisigValidatorManager__factory, Outbox, Outbox__factory, Inbox, @@ -18,9 +20,10 @@ import { ChainName, ProxiedAddress } from '../types'; export type CoreContractAddresses = { upgradeBeaconController: types.Address; xAppConnectionManager: types.Address; - validatorManager: types.Address; outbox: ProxiedAddress; inboxes: Partial>; + outboxMultisigValidatorManager: types.Address; + inboxMultisigValidatorManagers: Partial>; }; export class CoreContracts extends AbacusAppContracts { @@ -32,6 +35,17 @@ export class CoreContracts extends AbacusAppContracts { return Inbox__factory.connect(inbox.proxy, this.connection); } + inboxMultisigValidatorManager(chain: ChainName): InboxMultisigValidatorManager { + const inboxMultisigValidatorManager = this.addresses.inboxMultisigValidatorManagers[chain]; + if (!inboxMultisigValidatorManager) { + throw new Error(`No inboxMultisigValidatorManager for ${chain}`); + } + return InboxMultisigValidatorManager__factory.connect( + inboxMultisigValidatorManager, + this.connection, + ); + } + get outbox(): Outbox { return Outbox__factory.connect( this.addresses.outbox.proxy, @@ -39,9 +53,9 @@ export class CoreContracts extends AbacusAppContracts { ); } - get validatorManager(): ValidatorManager { - return ValidatorManager__factory.connect( - this.addresses.validatorManager, + get outboxMultisigValidatorManager(): OutboxMultisigValidatorManager { + return OutboxMultisigValidatorManager__factory.connect( + this.addresses.outboxMultisigValidatorManager, this.connection, ); }