From ea822610308d044886a14a12c1f6dc209b5e3261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mendes?= Date: Tue, 5 Sep 2023 14:05:47 -0300 Subject: [PATCH] fix rewards only preferential gauges --- src/gaugeFactory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gaugeFactory.ts b/src/gaugeFactory.ts index 3f0ddbf..4a79462 100644 --- a/src/gaugeFactory.ts +++ b/src/gaugeFactory.ts @@ -109,16 +109,18 @@ export function handleRewardsOnlyGaugeCreated( gauge.pool = poolRegistered ? poolAddress.toHexString() : null; gauge.poolId = poolRegistered ? getPoolId(poolAddress) : null; gauge.factory = factory.id; - gauge.save(); if (poolRegistered) { let pool = getPoolEntity(poolAddress, event.params.gauge); pool.address = poolAddress; pool.poolId = getPoolId(poolAddress); pool.preferentialGauge = gauge.id; + gauge.isPreferentialGauge = true; pool.save(); } + gauge.save(); + RewardsOnlyGaugeTemplate.create(event.params.gauge); ChildChainStreamerTemplate.create(event.params.streamer); }