From 56d4dc3318b1bcddd9eeb4343394227f54817912 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Thu, 16 Jun 2022 18:30:56 -0400 Subject: [PATCH] Pass through overrides to deployRouter (and log) (#621) * Pass through overrides to deployRouter * Adjust generic in deployRouter * Add more overrides and logs * Wait for confirmations * Log before waiting --- typescript/deploy/src/router/deploy.ts | 28 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/typescript/deploy/src/router/deploy.ts b/typescript/deploy/src/router/deploy.ts index 98f748189..ac920c987 100644 --- a/typescript/deploy/src/router/deploy.ts +++ b/typescript/deploy/src/router/deploy.ts @@ -4,7 +4,6 @@ import { ChainMap, ChainName, MultiProvider, - Router, RouterContracts, RouterFactories, chainMetadata, @@ -36,15 +35,20 @@ export abstract class AbacusRouterDeployer< } // for use in implementations of deployContracts - async deployRouter( + async deployRouter( chain: Chain, deployParams: Parameters, - initParams: Parameters, + initParams: Parameters, ): Promise { + const chainConnection = this.multiProvider.getChainConnection(chain); const router = await this.deployContract(chain, 'router', deployParams); this.logger(`Initializing ${chain}'s router with ${initParams}`); - // @ts-ignore spread operator - await router.initialize(...initParams); + const response = await router.initialize( + // @ts-ignore spread operator + ...initParams, + chainConnection.overrides, + ); + this.logger(`Pending init ${chainConnection.getTxUrl(response)}`); return router; } @@ -53,12 +57,16 @@ export abstract class AbacusRouterDeployer< // Make all routers aware of eachother. await promiseObjAll( objMap(contractsMap, async (local, contracts) => { + const chainConnection = this.multiProvider.getChainConnection(local); for (const remote of this.multiProvider.remoteChains(local)) { this.logger(`Enroll ${remote}'s router on ${local}`); - await contracts.router.enrollRemoteRouter( + const response = await contracts.router.enrollRemoteRouter( chainMetadata[remote].id, utils.addressToBytes32(contractsMap[remote].router.address), + chainConnection.overrides, ); + this.logger(`Pending enroll ${chainConnection.getTxUrl(response)}`); + await response.wait(chainConnection.confirmations); } }), ); @@ -69,9 +77,15 @@ export abstract class AbacusRouterDeployer< this.logger(`Transferring ownership of routers...`); await promiseObjAll( objMap(contractsMap, async (chain, contracts) => { + const chainConnection = this.multiProvider.getChainConnection(chain); const owner = this.configMap[chain].owner; this.logger(`Transfer ownership of ${chain}'s router to ${owner}`); - await contracts.router.transferOwnership(owner); + const response = await contracts.router.transferOwnership( + owner, + chainConnection.overrides, + ); + this.logger(`Pending transfer ${chainConnection.getTxUrl(response)}`); + await response.wait(chainConnection.confirmations); }), ); }