File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,22 @@ export function handleAllocationResized(event: AllocationResized): void {
206206 let allocation = Allocation . load ( allocationID ) !
207207 allocation . allocatedTokens = event . params . newTokens
208208 allocation . save ( )
209+
210+ // update data service
211+ let dataService = createOrLoadDataService ( event . address )
212+ dataService . totalTokensAllocated = dataService . totalTokensAllocated . plus ( diffTokens )
213+ dataService . save ( )
214+
215+ // update subgraph deployment
216+ let subgraphDeploymentID = allocation . subgraphDeployment
217+ let deployment = createOrLoadSubgraphDeployment ( subgraphDeploymentID , event . block . timestamp )
218+ deployment . stakedTokens = deployment . stakedTokens . plus ( diffTokens )
219+ deployment . save ( )
220+
221+ // update graph network
222+ let graphNetwork = createOrLoadGraphNetwork ( event . block . number , event . address )
223+ graphNetwork . totalTokensAllocated = graphNetwork . totalTokensAllocated . plus ( diffTokens )
224+ graphNetwork . save ( )
209225}
210226
211227export function handleIndexingRewardsCollected ( event : IndexingRewardsCollected ) : void {
You can’t perform that action at this time.
0 commit comments