From ab30d7d62b54148bd5bf634dc6a286115f5fb851 Mon Sep 17 00:00:00 2001 From: Anton Chaika Date: Fri, 15 Sep 2023 19:21:39 +0300 Subject: [PATCH] removed revardedUSD, totalRewardUSD fields --- DaoPools/schema.graphql | 2 -- DaoPools/src/entities/Voters/Voter.ts | 1 - DaoPools/src/entities/Voters/VoterInPool.ts | 1 - DaoPools/src/mappings/DaoPool.ts | 5 ----- DaoPools/tests/DaoPool.test.ts | 1 - 5 files changed, 10 deletions(-) diff --git a/DaoPools/schema.graphql b/DaoPools/schema.graphql index 4b8aaa0..20fb4a9 100644 --- a/DaoPools/schema.graphql +++ b/DaoPools/schema.graphql @@ -126,7 +126,6 @@ type Voter @entity { totalProposalsCreated: BigInt! totalMicropoolRewardUSD: BigInt! totalClaimedUSD: BigInt! - totalRewardedUSD: BigInt! totalDelegatedUSD: BigInt! totalLockedFundsUSD: BigInt! totalVotedProposals: BigInt! @@ -216,7 +215,6 @@ type VoterInPool @entity { totalLockedUSD: BigInt! totalClaimedUSD: BigInt! - rewardedUSD: BigInt! totalPersonalVotingRewardUSD: BigInt! totalMicropoolVotingRewardUSD: BigInt! diff --git a/DaoPools/src/entities/Voters/Voter.ts b/DaoPools/src/entities/Voters/Voter.ts index 4e6abd6..a69debb 100644 --- a/DaoPools/src/entities/Voters/Voter.ts +++ b/DaoPools/src/entities/Voters/Voter.ts @@ -12,7 +12,6 @@ export function getVoter(voterAddress: Address): Voter { voter.totalProposalsCreated = BigInt.zero(); voter.totalMicropoolRewardUSD = BigInt.zero(); voter.totalClaimedUSD = BigInt.zero(); - voter.totalRewardedUSD = BigInt.zero(); voter.totalDelegatedUSD = BigInt.zero(); voter.totalLockedFundsUSD = BigInt.zero(); voter.totalVotedProposals = BigInt.zero(); diff --git a/DaoPools/src/entities/Voters/VoterInPool.ts b/DaoPools/src/entities/Voters/VoterInPool.ts index 71fb47a..03e9eb0 100644 --- a/DaoPools/src/entities/Voters/VoterInPool.ts +++ b/DaoPools/src/entities/Voters/VoterInPool.ts @@ -22,7 +22,6 @@ export function getVoterInPool(pool: DaoPool, voter: Voter, timestamp: BigInt): voterInPool.totalLockedUSD = BigInt.zero(); voterInPool.totalClaimedUSD = BigInt.zero(); - voterInPool.rewardedUSD = BigInt.zero(); voterInPool.totalPersonalVotingRewardUSD = BigInt.zero(); voterInPool.totalMicropoolVotingRewardUSD = BigInt.zero(); diff --git a/DaoPools/src/mappings/DaoPool.ts b/DaoPools/src/mappings/DaoPool.ts index ab5a9ee..141eedd 100644 --- a/DaoPools/src/mappings/DaoPool.ts +++ b/DaoPools/src/mappings/DaoPool.ts @@ -362,9 +362,7 @@ export function onRewardClaimed(event: RewardClaimed): void { proposal.save(); } - voterInPool.rewardedUSD = voterInPool.rewardedUSD.plus(usdAmount); voterInPool.totalClaimedUSD = voterInPool.totalClaimedUSD.plus(usdAmount); - voter.totalRewardedUSD = voter.totalRewardedUSD.plus(usdAmount); voter.totalClaimedUSD = voter.totalClaimedUSD.plus(usdAmount); recalculateAPR(voterInPool, usdAmount, event.block.timestamp); @@ -396,9 +394,7 @@ export function onVotingRewardClaimed(event: VotingRewardClaimed): void { voterInPool.totalMicropoolVotingRewardUSD = voterInPool.totalMicropoolVotingRewardUSD.plus(micropoolUsdAmount); voterInPool.totalTreasuryVotingRewardUSD = voterInPool.totalTreasuryVotingRewardUSD.plus(treasuryUsdAmount); - voterInPool.rewardedUSD = voterInPool.rewardedUSD.plus(totalUsdAmount); voterInPool.totalClaimedUSD = voterInPool.totalClaimedUSD.plus(totalUsdAmount); - voter.totalRewardedUSD = voter.totalRewardedUSD.plus(totalUsdAmount); voter.totalClaimedUSD = voter.totalClaimedUSD.plus(totalUsdAmount); voterInPool.proposals = pushUnique(voterInPool.proposals, [voterInProposal.id]); @@ -423,7 +419,6 @@ export function onDelegatorRewardsClaimed(event: DelegatorRewardsClaimed): void delegator.totalMicropoolRewardUSD = delegator.totalMicropoolRewardUSD.plus(usdAmount); delegator.totalClaimedUSD = delegator.totalClaimedUSD.plus(usdAmount); - delegator.totalRewardedUSD = delegator.totalRewardedUSD.plus(usdAmount); voterInProposal.micropoolRewardUSD = voterInProposal.micropoolRewardUSD.plus(usdAmount); voterInProposal.claimedRewardUSD = voterInProposal.claimedRewardUSD.plus(usdAmount); diff --git a/DaoPools/tests/DaoPool.test.ts b/DaoPools/tests/DaoPool.test.ts index 42860ee..6680c61 100644 --- a/DaoPools/tests/DaoPool.test.ts +++ b/DaoPools/tests/DaoPool.test.ts @@ -1249,7 +1249,6 @@ describe("DaoPool", () => { assert.fieldEquals("Voter", delegator.toHexString(), "totalMicropoolRewardUSD", "200"); assert.fieldEquals("Voter", delegator.toHexString(), "totalClaimedUSD", "200"); - assert.fieldEquals("Voter", delegator.toHexString(), "totalRewardedUSD", "200"); assert.fieldEquals( "VoterInProposal",