From 94dac8a77113a0a3567df3091847f9c772d8786a Mon Sep 17 00:00:00 2001 From: dylanVerstraete Date: Mon, 22 Aug 2022 16:58:10 +0200 Subject: [PATCH] fix: farm create/update --- package-lock.json | 4 ++-- package.json | 2 +- processor-chart/Chart.yaml | 2 +- src/mappings/farms.ts | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a64480..e4ff02d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "graphql_tfgrid", - "version": "2.5.4", + "version": "2.5.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "graphql_tfgrid", - "version": "2.5.4", + "version": "2.5.5", "license": "ISC", "dependencies": { "@subsquid/graphql-server": "^0.1.5", diff --git a/package.json b/package.json index f09e075..08a2836 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "graphql_tfgrid", "private": "true", - "version": "2.5.4", + "version": "2.5.5", "description": "GraphQL server and Substrate indexer. Generated with ♥ by Hydra-CLI", "author": "", "license": "ISC", diff --git a/processor-chart/Chart.yaml b/processor-chart/Chart.yaml index 5df9a49..834bc97 100644 --- a/processor-chart/Chart.yaml +++ b/processor-chart/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: tfchain-processor description: A chart for the tfchain graphql processor and query node version: 1.0.4 -appVersion: "2.5.4" +appVersion: "2.5.5" diff --git a/src/mappings/farms.ts b/src/mappings/farms.ts index 438b2bb..1eedc67 100644 --- a/src/mappings/farms.ts +++ b/src/mappings/farms.ts @@ -3,10 +3,12 @@ import { } from "@subsquid/substrate-processor"; import { Farm, FarmCertification, PublicIp } from "../model"; import { TfgridModuleFarmStoredEvent, TfgridModuleFarmDeletedEvent, TfgridModuleFarmUpdatedEvent, TfgridModuleFarmPayoutV2AddressRegisteredEvent, TfgridModuleFarmCertificationSetEvent } from "../types/events"; +import * as v63 from '../types/v63' export async function farmStored(ctx: EventHandlerContext) { const farmStoredEvent = new TfgridModuleFarmStoredEvent(ctx) + console.log(ctx._chain.getEventHash('tfgridModule.FarmStored')) let farmStoredEventParsed if (farmStoredEvent.isV9) { farmStoredEventParsed = farmStoredEvent.asV9 @@ -15,6 +17,8 @@ export async function farmStored(ctx: EventHandlerContext) { } else if (farmStoredEvent.isV63) { farmStoredEventParsed = farmStoredEvent.asV63 } else if (farmStoredEvent.isV101) { + let eventValue = ctx.event.params[0].value as v63.Farm + eventValue.dedicatedFarm = false farmStoredEventParsed = farmStoredEvent.asV101 } @@ -75,6 +79,8 @@ export async function farmUpdated(ctx: EventHandlerContext) { } else if (farmUpdatedEvent.isV63) { farmUpdatedEventParsed = farmUpdatedEvent.asV63 } else if (farmUpdatedEvent.isV101) { + let eventValue = ctx.event.params[0].value as v63.Farm + eventValue.dedicatedFarm = false farmUpdatedEventParsed = farmUpdatedEvent.asV101 }