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 + ); } } },