Skip to content

Commit

Permalink
temp disable parsing old events with U16F16 type
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed May 13, 2024
1 parent f5a3cd8 commit 064e0cc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mappings/tftPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export async function priceStored(

let priceEvent
if (priceStoredEvent.isV9) {
priceEvent = priceStoredEvent.asV9 // [Uint8Array, Uint8Array] <- U16F16, AccountId
} else if (priceStoredEvent.isV49) {
priceEvent = priceStoredEvent.asV49 // Uint8Array <-U16F16
// TODO: fix me U16F16 -> number
// use @encointer/util to parse U16F16 to number

// priceEvent = priceStoredEvent.asV9[0] // [Uint8Array, Uint8Array] <- U16F16, AccountId
return
} else if (priceStoredEvent.isV49) {
// TODO: fix me U16F16 -> number
// priceEvent = priceStoredEvent.asV49 // Uint8Array <-U16F16
return
} else if (priceStoredEvent.isV101) {
priceEvent = priceStoredEvent.asV101 // number <- u32
}
Expand All @@ -33,7 +36,7 @@ export async function priceStored(
let newPrice = new PriceStored()
newPrice.block = block.height
newPrice.timestamp = timestamp
newPrice.newPrice = priceEvent // TODO: fix me U16F16 -> number
newPrice.newPrice = priceEvent

await ctx.store.save<PriceStored>(newPrice)
}
Expand Down

0 comments on commit 064e0cc

Please sign in to comment.