Skip to content

Commit 8f6a3b4

Browse files
committed
fix: most of the feedback from ProvisionManagement PR
1 parent 55f3ef5 commit 8f6a3b4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

schema.graphql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,9 @@ type ThawRequest @entity {
982982

983983
thawingUntil: BigInt!
984984

985-
valid: Boolean
985+
fulfilledAsValid: Boolean
986+
987+
fulfilled: Boolean!
986988
}
987989

988990
"""

src/mappings/horizonStaking.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export function handleTokensDeprovisioned(event: TokensDeprovisioned): void {
153153
graphNetwork.save()
154154

155155
provision.tokensProvisioned = provision.tokensProvisioned.minus(event.params.tokens)
156+
provision.tokensThawing = provision.tokensThawing.plus(event.params.tokens)
156157
provision.save()
157158
}
158159

@@ -239,6 +240,7 @@ export function handleProvisionSlashed(event: ProvisionSlashed): void {
239240
graphNetwork.save()
240241

241242
provision.tokensProvisioned = provision.tokensProvisioned.minus(event.params.tokens)
243+
// To DO, update thawing tokens according to the accounting calculation from the contract
242244
provision.tokensSlashedServiceProvider = provision.tokensSlashedServiceProvider.plus(event.params.tokens)
243245
provision.save()
244246
}
@@ -255,13 +257,15 @@ export function handleThawRequestCreated(event: ThawRequestCreated): void {
255257
request.shares = event.params.shares
256258
request.tokens = BigInt.fromI32(0)
257259
request.thawingUntil = event.params.thawingUntil
260+
request.fulfilled = false
258261
request.save()
259262
}
260263

261264
export function handleThawRequestFulfilled(event: ThawRequestFulfilled): void {
262265
let request = ThawRequest.load(event.params.thawRequestId.toHexString())!
263266
request.tokens = event.params.tokens
264-
request.valid = event.params.valid
267+
request.fulfilledAsValid = event.params.valid
268+
request.fulfilled = true
265269
request.save()
266270
}
267271

0 commit comments

Comments
 (0)