From f8392787880c3d06c034ef4e8cd30045a301b16d Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Fri, 22 Mar 2024 18:59:37 -0400 Subject: [PATCH] add same structure for root cache Signed-off-by: Matt Rice --- src/dataworker/Dataworker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dataworker/Dataworker.ts b/src/dataworker/Dataworker.ts index 82473c4c6..7d53c8c31 100644 --- a/src/dataworker/Dataworker.ts +++ b/src/dataworker/Dataworker.ts @@ -97,7 +97,7 @@ export type PoolRebalanceRoot = { tree: MerkleTree; }; -type PoolRebalanceRootCache = Record; +type PoolRebalanceRootCache = Record>; // @notice Constructs roots to submit to HubPool on L1. Fetches all data synchronously from SpokePool/HubPool clients // so this class assumes that those upstream clients are already updated and have fetched on-chain data from RPC's. @@ -2275,7 +2275,7 @@ export class Dataworker { // executor running for tonight (2023-08-28) until we can fix the // root cache rebalancing bug. if (!this.rootCache[key] || process.env.DATAWORKER_DISABLE_REBALANCE_ROOT_CACHE === "true") { - this.rootCache[key] = await _buildPoolRebalanceRoot( + this.rootCache[key] = _buildPoolRebalanceRoot( latestMainnetBlock, mainnetBundleEndBlock, fillsToRefund, @@ -2296,7 +2296,7 @@ export class Dataworker { ); } - return _.cloneDeep(this.rootCache[key]); + return _.cloneDeep(await this.rootCache[key]); } _getRequiredEthForArbitrumPoolRebalanceLeaf(leaf: PoolRebalanceLeaf): BigNumber {