Skip to content

Commit

Permalink
removed revardedUSD, totalRewardUSD fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kevandee committed Sep 15, 2023
1 parent 4ca28e7 commit ab30d7d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions DaoPools/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ type Voter @entity {
totalProposalsCreated: BigInt!
totalMicropoolRewardUSD: BigInt!
totalClaimedUSD: BigInt!
totalRewardedUSD: BigInt!
totalDelegatedUSD: BigInt!
totalLockedFundsUSD: BigInt!
totalVotedProposals: BigInt!
Expand Down Expand Up @@ -216,7 +215,6 @@ type VoterInPool @entity {

totalLockedUSD: BigInt!
totalClaimedUSD: BigInt!
rewardedUSD: BigInt!

totalPersonalVotingRewardUSD: BigInt!
totalMicropoolVotingRewardUSD: BigInt!
Expand Down
1 change: 0 additions & 1 deletion DaoPools/src/entities/Voters/Voter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion DaoPools/src/entities/Voters/VoterInPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 0 additions & 5 deletions DaoPools/src/mappings/DaoPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]);
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion DaoPools/tests/DaoPool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ab30d7d

Please sign in to comment.