Skip to content

Commit

Permalink
fix rewards only preferential gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
mendesfabio committed Sep 5, 2023
1 parent 91892e4 commit ea82261
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gaugeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ea82261

Please sign in to comment.