This commit is contained in:
trizin 2023-08-22 12:18:46 +00:00 committed by GitHub
parent b51cf824d8
commit 4fbe1e3335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ function getPredictSlot(
export function handlePredictionSubmitted(event: PredictionSubmitted): void {
const predictSlot = getPredictSlot(
event.address.toHexString(),
Number(event.params.slot)
event.params.slot.toNumber()
)
const user = getUser(event.params.predictoor.toHex())
const id =
@ -142,7 +142,7 @@ export function handleNewSubscription(event: NewSubscription): void {
export function handleTruevalSubmitted(event: TruevalSubmitted): void {
const predictSlot = getPredictSlot(
event.address.toHexString(),
Number(event.params.slot)
event.params.slot.toNumber()
)
const id = event.address.toHexString() + '-' + event.params.slot.toString()
const newPredictTrueVals = new PredictTrueVal(id) // they share the same id
@ -236,7 +236,7 @@ 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 targetSlotInt = targetSlot.toNumber()
const predictSlot = getPredictSlot(
event.address.toHexString(),
targetSlotInt