Skip to content

Commit dd91040

Browse files
committed
fix: maxVerifierCut/Pending wrong types, schema issues and more
1 parent d5a12ff commit dd91040

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

schema.graphql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,10 +854,10 @@ type Provision @entity {
854854
tokensThawing: BigInt!
855855

856856
"Max amount that can be taken by the verifier when slashing, expressed in parts-per-million of the amount slashed"
857-
maxVerifierCut: Int!
857+
maxVerifierCut: BigInt!
858858

859859
"Pending value for maxVerifierCut. Verifier needs to accept it before it becomes active"
860-
maxVerifierCutPending: Int!
860+
maxVerifierCutPending: BigInt!
861861

862862
"Time, in seconds, tokens must thaw before being withdrawn"
863863
thawingPeriod: BigInt!
@@ -871,7 +871,7 @@ type ThawRequest @entity {
871871

872872
indexer: Indexer!
873873

874-
service: DataService!
874+
dataService: DataService!
875875

876876
owner: GraphAccount!
877877

src/mappings/helpers/helpers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,12 @@ export function createOrLoadProvision(indexerAddress: Bytes, verifierAddress: By
197197
if (provision == null) {
198198
provision = new Provision(id)
199199
provision.indexer = indexerAddress.toHexString()
200-
provision.service = verifierAddress.toHexString()
200+
provision.dataService = verifierAddress.toHexString()
201201
provision.tokensProvisioned = BigInt.fromI32(0)
202202
provision.tokensThawing = BigInt.fromI32(0)
203-
provision.sharesThawing = BigInt.fromI32(0)
204203
provision.createdAt = timestamp
205-
provision.maxVerifierCut = 0
206-
provision.maxVerifierCutPending = 0
204+
provision.maxVerifierCut = BigInt.fromI32(0)
205+
provision.maxVerifierCutPending = BigInt.fromI32(0)
207206
provision.thawingPeriod = BigInt.fromI32(0)
208207
provision.thawingPeriodPending = BigInt.fromI32(0)
209208
provision.save()

src/mappings/horizonStaking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export function handleThawRequestCreated(event: ThawRequestCreated): void {
183183

184184
let request = new ThawRequest(event.params.thawRequestId.toHexString())
185185
request.indexer = indexer.id
186-
request.service = dataService.id
186+
request.dataService = dataService.id
187187
request.owner = owner.id
188188
request.shares = event.params.shares
189189
request.tokens = BigInt.fromI32(0)
@@ -192,7 +192,7 @@ export function handleThawRequestCreated(event: ThawRequestCreated): void {
192192
}
193193

194194
export function handleThawRequestFulfilled(event: ThawRequestFulfilled): void {
195-
let request = ThawRequest.load(event.params.thawRequestId.toHexString())
195+
let request = ThawRequest.load(event.params.thawRequestId.toHexString())!
196196
request.tokens = event.params.tokens
197197
request.valid = event.params.valid
198198
request.save()

0 commit comments

Comments
 (0)