Skip to content

Commit 631e966

Browse files
committed
feat: more missing governance events
Signed-off-by: Tomás Migone <[email protected]>
1 parent 514970f commit 631e966

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

schema.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ type DataService @entity {
252252

253253
"Ratio of max staked delegation tokens to indexers stake that earns rewards"
254254
delegationRatio: Int
255+
"Curation cut for this DataService"
256+
curationCut: BigInt!
255257

256258
provisions: [Provision!]! @derivedFrom(field: "dataService")
257259

src/mappings/helpers/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export function createOrLoadDataService(verifierAddress: Bytes): DataService {
262262
service.totalTokensProvisioned = BigInt.fromI32(0)
263263
service.totalTokensThawing = BigInt.fromI32(0)
264264
service.allowedWithTokenLockWallets = false
265+
service.curationCut = BigInt.fromI32(0)
265266
service.save()
266267
}
267268

src/mappings/subgraphService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts"
2-
import { AllocationClosed, AllocationCreated, AllocationResized, DelegationRatioSet, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService"
2+
import { AllocationClosed, AllocationCreated, AllocationResized, CurationCutSet, DelegationRatioSet, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService"
33
import { batchUpdateSubgraphSignalledTokens, calculatePricePerShare, createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadIndexerQueryFeePaymentAggregation, createOrLoadPaymentSource, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers"
44
import { Allocation, GraphAccount, Indexer, PoiSubmission, SubgraphDeployment } from "../types/schema"
55
import { addresses } from "../../config/addresses"
@@ -399,3 +399,9 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void {
399399
)
400400
paymentSource.save()
401401
}
402+
403+
export function handleCurationCutSet(event: CurationCutSet): void {
404+
let dataService = createOrLoadDataService(event.address)
405+
dataService.curationCut = event.params.curationCut
406+
dataService.save()
407+
}

subgraph.template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ dataSources:
483483
handler: handleQueryFeesCollected
484484
- event: DelegationRatioSet(uint32)
485485
handler: handleDelegationRatioSet
486+
- event: CurationCutSet(uint256)
487+
handler: handleCurationCutSet
486488
- kind: ethereum/contract
487489
name: GraphPayments
488490
network: {{network}}

0 commit comments

Comments
 (0)