diff --git a/modules/pool/lib/pool-onchain-data.ts b/modules/pool/lib/pool-onchain-data.ts index ca333d132..7a799a481 100644 --- a/modules/pool/lib/pool-onchain-data.ts +++ b/modules/pool/lib/pool-onchain-data.ts @@ -83,7 +83,6 @@ const getTotalSupplyFn = (type: PoolInput['type'], version: number) => { } else if ( type === 'COMPOSABLE_STABLE' || (type === 'WEIGHTED' && version > 1) || - (type === 'GYROE' && version > 1) || (type === 'UNKNOWN' && version > 1) ) { return 'getActualSupply'; diff --git a/modules/pool/pool.prisma b/modules/pool/pool.prisma index 16767b4df..9244c46b5 100644 --- a/modules/pool/pool.prisma +++ b/modules/pool/pool.prisma @@ -423,7 +423,7 @@ model PrismaPoolStakingGauge { chain Chain gaugeAddress String - votingGauge PrismaVotingGauge? + votingGauge PrismaVotingGauge[] rewards PrismaPoolStakingGaugeReward[] status PrismaPoolStakingGaugeStatus @default(ACTIVE) version Int @default(1) diff --git a/modules/pool/pool.service.ts b/modules/pool/pool.service.ts index ae54c3e2b..468a8f201 100644 --- a/modules/pool/pool.service.ts +++ b/modules/pool/pool.service.ts @@ -494,7 +494,7 @@ export class PoolService { if (gauge && gauge.votingGauge) await prisma.prismaVotingGauge.deleteMany({ - where: { chain: this.chain, id: gauge.votingGauge.id }, + where: { chain: this.chain, id: { in: gauge.votingGauge.map((gauge) => gauge.id) } }, }); await prisma.prismaPoolStakingGauge.deleteMany({ diff --git a/modules/vebal/vebal.prisma b/modules/vebal/vebal.prisma index c4b1b3a0f..df28431b5 100644 --- a/modules/vebal/vebal.prisma +++ b/modules/vebal/vebal.prisma @@ -27,7 +27,6 @@ enum PrismaVotingGaugeStatus { model PrismaVotingGauge { @@id([id, chain]) - @@unique([stakingGaugeId, chain]) id String chain Chain diff --git a/modules/vebal/voting-gauges.repository.ts b/modules/vebal/voting-gauges.repository.ts index cd252b8f9..347932c17 100644 --- a/modules/vebal/voting-gauges.repository.ts +++ b/modules/vebal/voting-gauges.repository.ts @@ -128,7 +128,7 @@ export class VotingGaugesRepository { await this.saveVotingGauge(gauge); return gauge; } catch (error) { - saveErrors.push(error as Error); + saveErrors.push(new Error(`Failed to save voting gauge ${gauge.gaugeAddress} with error ${error}`)); return gauge; } }), diff --git a/prisma/migrations/20231204142011_remove_constraint_votinggauge/migration.sql b/prisma/migrations/20231204142011_remove_constraint_votinggauge/migration.sql new file mode 100644 index 000000000..4b0b35734 --- /dev/null +++ b/prisma/migrations/20231204142011_remove_constraint_votinggauge/migration.sql @@ -0,0 +1,2 @@ +-- DropIndex +DROP INDEX "PrismaVotingGauge_stakingGaugeId_chain_key"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index dd7174384..e3de046e7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -469,7 +469,7 @@ model PrismaPoolStakingGauge { chain Chain gaugeAddress String - votingGauge PrismaVotingGauge? + votingGauge PrismaVotingGauge[] rewards PrismaPoolStakingGaugeReward[] status PrismaPoolStakingGaugeStatus @default(ACTIVE) version Int @default(1) @@ -846,7 +846,6 @@ enum PrismaVotingGaugeStatus { model PrismaVotingGauge { @@id([id, chain]) - @@unique([stakingGaugeId, chain]) id String chain Chain