Skip to content

Commit

Permalink
Bytes.empty() is really just null, persist distributionPeriod mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Jul 14, 2023
1 parent a8c7723 commit 0ccdddd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ type DistributionPeriod @entity {
id: Bytes! # distribution period id converted to Bytes from uint
startBlock: BigInt! # block number the distribution period starts
endBlock: BigInt! # block number the distribution period ends
topSlate: FundedSlate! # The current top FundedSlate
topSlate: FundedSlate # The current top FundedSlate
slatesSubmitted: [FundedSlate!]! # FundedSlate[] slates submitted in the distribution period
delegationRewardsClaimed: BigDecimal! # Total delegation rewards claimed in the distribution period
fundingVotesCast: BigDecimal! # number of funding votes cast
Expand Down
3 changes: 2 additions & 1 deletion src/grant-fund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export function handleProposalCreated(event: ProposalCreatedEvent): void {

// save entities to the store
grantFund.save()
distributionPeriod.save()
proposal.save()
proposalCreated.save()
}
Expand Down Expand Up @@ -256,7 +257,7 @@ export function handleDistributionPeriodStarted(

distributionPeriod.startBlock = distributionStarted.startBlock
distributionPeriod.endBlock = distributionStarted.endBlock
distributionPeriod.topSlate = Bytes.empty()
distributionPeriod.topSlate = null
distributionPeriod.delegationRewardsClaimed = ZERO_BD
distributionPeriod.totalTokensRequested = ZERO_BD
distributionPeriod.fundingVotesCast = ZERO_BD
Expand Down
2 changes: 1 addition & 1 deletion src/utils/grants/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function loadOrCreateDistributionPeriod(distributionId: Bytes): Distribut
distributionPeriod = new DistributionPeriod(distributionId) as DistributionPeriod
distributionPeriod.startBlock = ZERO_BI
distributionPeriod.endBlock = ZERO_BI
distributionPeriod.topSlate = Bytes.empty()
distributionPeriod.topSlate = null
distributionPeriod.slatesSubmitted = []
distributionPeriod.delegationRewardsClaimed = ZERO_BD
distributionPeriod.fundingVotesCast = ZERO_BD
Expand Down

0 comments on commit 0ccdddd

Please sign in to comment.