Fixes
This commit is contained in:
parent
6875bf4dd5
commit
b99db94993
|
@ -737,6 +737,8 @@ type PredictSlot @entity{
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
type PredictSettingUpdate @entity{
|
||||
"id = {contract address}-{txId}-{eventIndex}"
|
||||
id: ID!
|
||||
|
|
|
@ -171,10 +171,10 @@ export function handleTruevalSubmitted(event: TruevalSubmitted): void {
|
|||
BigInt.fromI32(decimals).toI32()
|
||||
)
|
||||
|
||||
if (event.status == 1) {
|
||||
if (event.params.status == 1) {
|
||||
predictSlot.status = 'Paying'
|
||||
}
|
||||
if (event.status == 2) {
|
||||
if (event.params.status == 2) {
|
||||
predictSlot.status = 'Canceled'
|
||||
}
|
||||
predictSlot.save()
|
||||
|
@ -236,9 +236,10 @@ export function handleRevenueAdded(event: RevenueAdded): void {
|
|||
const slot = event.params.slot
|
||||
for (let i = BigInt.zero(); i.lt(numEpochs); i = i.plus(BigInt.fromI32(1))) {
|
||||
const targetSlot = slot.plus(secondsPerEpoch.times(i))
|
||||
const targetSlotInt = Number(targetSlot);
|
||||
const predictSlot = getPredictSlot(
|
||||
event.address.toHexString(),
|
||||
Number(targetSlot)
|
||||
targetSlotInt
|
||||
)
|
||||
predictSlot.revenue = predictSlot.revenue.plus(amountPerEpoch)
|
||||
predictSlot.save()
|
||||
|
|
Loading…
Reference in New Issue