From 7bd0d7ca36686501a2eeeee88fc4d518452f33f5 Mon Sep 17 00:00:00 2001 From: "jrab227@gmail.com" Date: Thu, 7 Nov 2024 18:30:31 -0500 Subject: [PATCH] Minor syntax update. --- src/EventHandlers/Voter.ts | 13 ++++++------- src/EventHandlers/VotingReward.ts | 7 ++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/EventHandlers/Voter.ts b/src/EventHandlers/Voter.ts index 773256a..b0139a3 100644 --- a/src/EventHandlers/Voter.ts +++ b/src/EventHandlers/Voter.ts @@ -79,6 +79,12 @@ Voter.DistributeReward.handlerWithLoader({ ? context.LiquidityPoolAggregator.get(poolAddress) : null; + if (!poolAddress) { + context.log.warn( + `No pool address found for the gauge address ${event.params.gauge.toString()}` + ); + } + const [currentLiquidityPool, rewardToken] = await Promise.all([ promisePool, context.Token.get( @@ -89,13 +95,6 @@ Voter.DistributeReward.handlerWithLoader({ ), ]); - // If there is no pool address with the particular gauge address, log the error - if (!poolAddress) { - context.log.warn( - `No pool address found for the gauge address ${event.params.gauge.toString()}` - ); - } - return { currentLiquidityPool, rewardToken }; }, handler: async ({ event, context, loaderReturn }) => { diff --git a/src/EventHandlers/VotingReward.ts b/src/EventHandlers/VotingReward.ts index f5fc21a..ef20f29 100644 --- a/src/EventHandlers/VotingReward.ts +++ b/src/EventHandlers/VotingReward.ts @@ -83,7 +83,12 @@ VotingReward.NotifyReward.handlerWithLoader({ }; // Update the LiquidityPoolEntity in the DB - updateLiquidityPoolAggregator(lpDiff, currentLiquidityPool, new Date(event.block.timestamp * 1000), context); + updateLiquidityPoolAggregator( + lpDiff, + currentLiquidityPool, + new Date(event.block.timestamp * 1000), + context + ); } } },