|
|
@ -28,8 +28,11 @@ export type TestAbacusInstance = { |
|
|
|
upgradeBeaconController: UpgradeBeaconController; |
|
|
|
upgradeBeaconController: UpgradeBeaconController; |
|
|
|
inboxes: Record<types.Domain, TestInbox>; |
|
|
|
inboxes: Record<types.Domain, TestInbox>; |
|
|
|
interchainGasPaymaster: InterchainGasPaymaster; |
|
|
|
interchainGasPaymaster: InterchainGasPaymaster; |
|
|
|
outboxMultisigValidatorManager: OutboxMultisigValidatorManager, |
|
|
|
outboxMultisigValidatorManager: OutboxMultisigValidatorManager; |
|
|
|
inboxMultisigValidatorManagers: Record<types.Domain, InboxMultisigValidatorManager>, |
|
|
|
inboxMultisigValidatorManagers: Record< |
|
|
|
|
|
|
|
types.Domain, |
|
|
|
|
|
|
|
InboxMultisigValidatorManager |
|
|
|
|
|
|
|
>; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export class TestAbacusDeploy extends TestDeploy< |
|
|
|
export class TestAbacusDeploy extends TestDeploy< |
|
|
@ -54,23 +57,30 @@ export class TestAbacusDeploy extends TestDeploy< |
|
|
|
const signer = this.config.signer[domain]; |
|
|
|
const signer = this.config.signer[domain]; |
|
|
|
const signerAddress = await signer.getAddress(); |
|
|
|
const signerAddress = await signer.getAddress(); |
|
|
|
|
|
|
|
|
|
|
|
const outboxMultisigValidatorManagerFactory = new OutboxMultisigValidatorManager__factory(signer); |
|
|
|
const outboxMultisigValidatorManagerFactory = |
|
|
|
const outboxMultisigValidatorManager = await outboxMultisigValidatorManagerFactory.deploy( |
|
|
|
new OutboxMultisigValidatorManager__factory(signer); |
|
|
|
|
|
|
|
const outboxMultisigValidatorManager = |
|
|
|
|
|
|
|
await outboxMultisigValidatorManagerFactory.deploy( |
|
|
|
domain, |
|
|
|
domain, |
|
|
|
[signerAddress], |
|
|
|
[signerAddress], |
|
|
|
1, |
|
|
|
1 |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const inboxMultisigValidatorManagerFactory = new InboxMultisigValidatorManager__factory(signer); |
|
|
|
const inboxMultisigValidatorManagerFactory = |
|
|
|
const inboxMultisigValidatorManagers: Record<types.Domain, InboxMultisigValidatorManager> = {}; |
|
|
|
new InboxMultisigValidatorManager__factory(signer); |
|
|
|
|
|
|
|
const inboxMultisigValidatorManagers: Record< |
|
|
|
|
|
|
|
types.Domain, |
|
|
|
|
|
|
|
InboxMultisigValidatorManager |
|
|
|
|
|
|
|
> = {}; |
|
|
|
|
|
|
|
|
|
|
|
// this.remotes reads this.instances which has not yet been set.
|
|
|
|
// this.remotes reads this.instances which has not yet been set.
|
|
|
|
const remotes = Object.keys(this.config.signer).map((d) => parseInt(d)); |
|
|
|
const remotes = Object.keys(this.config.signer).map((d) => parseInt(d)); |
|
|
|
const inboxMultisigValidatorManagerDeploys = remotes.map(async (remote) => { |
|
|
|
const inboxMultisigValidatorManagerDeploys = remotes.map(async (remote) => { |
|
|
|
const inboxMultisigValidatorManager = await inboxMultisigValidatorManagerFactory.deploy( |
|
|
|
const inboxMultisigValidatorManager = |
|
|
|
|
|
|
|
await inboxMultisigValidatorManagerFactory.deploy( |
|
|
|
remote, |
|
|
|
remote, |
|
|
|
[signerAddress], |
|
|
|
[signerAddress], |
|
|
|
1, |
|
|
|
1 |
|
|
|
); |
|
|
|
); |
|
|
|
inboxMultisigValidatorManagers[remote] = inboxMultisigValidatorManager; |
|
|
|
inboxMultisigValidatorManagers[remote] = inboxMultisigValidatorManager; |
|
|
|
}); |
|
|
|
}); |
|
|
@ -105,7 +115,8 @@ export class TestAbacusDeploy extends TestDeploy< |
|
|
|
// this.remotes reads this.instances which has not yet been set.
|
|
|
|
// this.remotes reads this.instances which has not yet been set.
|
|
|
|
// const remotes = Object.keys(this.config.signer).map((d) => parseInt(d));
|
|
|
|
// const remotes = Object.keys(this.config.signer).map((d) => parseInt(d));
|
|
|
|
const inboxDeploys = remotes.map(async (remote) => { |
|
|
|
const inboxDeploys = remotes.map(async (remote) => { |
|
|
|
const inboxMultisigValidatorManager = inboxMultisigValidatorManagers[remote]; |
|
|
|
const inboxMultisigValidatorManager = |
|
|
|
|
|
|
|
inboxMultisigValidatorManagers[remote]; |
|
|
|
const inbox = await inboxFactory.deploy(domain); |
|
|
|
const inbox = await inboxFactory.deploy(domain); |
|
|
|
await inbox.initialize( |
|
|
|
await inbox.initialize( |
|
|
|
remote, |
|
|
|
remote, |
|
|
@ -132,9 +143,14 @@ export class TestAbacusDeploy extends TestDeploy< |
|
|
|
await this.outbox(domain).transferOwnership(address); |
|
|
|
await this.outbox(domain).transferOwnership(address); |
|
|
|
await this.upgradeBeaconController(domain).transferOwnership(address); |
|
|
|
await this.upgradeBeaconController(domain).transferOwnership(address); |
|
|
|
await this.xAppConnectionManager(domain).transferOwnership(address); |
|
|
|
await this.xAppConnectionManager(domain).transferOwnership(address); |
|
|
|
await this.outboxMultisigValidatorManager(domain).transferOwnership(address); |
|
|
|
await this.outboxMultisigValidatorManager(domain).transferOwnership( |
|
|
|
|
|
|
|
address |
|
|
|
|
|
|
|
); |
|
|
|
for (const remote of this.remotes(domain)) { |
|
|
|
for (const remote of this.remotes(domain)) { |
|
|
|
await this.inboxMultisigValidatorManager(domain, remote).transferOwnership(address); |
|
|
|
await this.inboxMultisigValidatorManager( |
|
|
|
|
|
|
|
domain, |
|
|
|
|
|
|
|
remote |
|
|
|
|
|
|
|
).transferOwnership(address); |
|
|
|
await this.inbox(domain, remote).transferOwnership(address); |
|
|
|
await this.inbox(domain, remote).transferOwnership(address); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -159,11 +175,16 @@ export class TestAbacusDeploy extends TestDeploy< |
|
|
|
return this.instances[domain].xAppConnectionManager; |
|
|
|
return this.instances[domain].xAppConnectionManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
outboxMultisigValidatorManager(domain: types.Domain): OutboxMultisigValidatorManager { |
|
|
|
outboxMultisigValidatorManager( |
|
|
|
|
|
|
|
domain: types.Domain |
|
|
|
|
|
|
|
): OutboxMultisigValidatorManager { |
|
|
|
return this.instances[domain].outboxMultisigValidatorManager; |
|
|
|
return this.instances[domain].outboxMultisigValidatorManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inboxMultisigValidatorManager(local: types.Domain, remote: types.Domain): InboxMultisigValidatorManager { |
|
|
|
inboxMultisigValidatorManager( |
|
|
|
|
|
|
|
local: types.Domain, |
|
|
|
|
|
|
|
remote: types.Domain |
|
|
|
|
|
|
|
): InboxMultisigValidatorManager { |
|
|
|
return this.instances[local].inboxMultisigValidatorManagers[remote]; |
|
|
|
return this.instances[local].inboxMultisigValidatorManagers[remote]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|