This commit is contained in:
alexcos20 2023-05-19 16:58:07 +03:00
parent c3ba5ee5b4
commit 3bfc1785d2
4 changed files with 37 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -689,6 +689,7 @@ type PredictTrueVals @entity{
id: ID!
slot: PredictSlot!
trueValue: Boolean!
floatValue: BigDecimal!
"txId"
txId: String
eventIndex:Int!

View File

@ -145,6 +145,10 @@ export function handleTruevalSubmitted(event: TruevalSubmitted): void {
newPredictTrueVals.txId = event.transaction.hash.toHexString()
newPredictTrueVals.eventIndex = event.logIndex.toI32()
newPredictTrueVals.timestamp = event.block.timestamp.toI32()
newPredictTrueVals.floatValue = weiToDecimal(
event.params.floatValue.toBigDecimal(),
18
)
newPredictTrueVals.save()
}

View File

@ -80,7 +80,7 @@ templates:
handler: handlePredictionPayout
- event: NewSubscription(indexed address,uint256,uint256)
handler: handleNewSubscription
- event: TruevalSubmitted(indexed uint256,bool,uint8)
- event: TruevalSubmitted(indexed uint256,bool,uint256,uint8)
handler: handleTruevalSubmitted
- event: SettingChanged(uint256,uint256,uint256,address)
handler: handleSettingChanged