Skip to content

Commit 94dac8a

Browse files
fix: farm create/update
1 parent fa82b89 commit 94dac8a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphql_tfgrid",
33
"private": "true",
4-
"version": "2.5.4",
4+
"version": "2.5.5",
55
"description": "GraphQL server and Substrate indexer. Generated with ♥ by Hydra-CLI",
66
"author": "",
77
"license": "ISC",

processor-chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
name: tfchain-processor
33
description: A chart for the tfchain graphql processor and query node
44
version: 1.0.4
5-
appVersion: "2.5.4"
5+
appVersion: "2.5.5"

src/mappings/farms.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import {
33
} from "@subsquid/substrate-processor";
44
import { Farm, FarmCertification, PublicIp } from "../model";
55
import { TfgridModuleFarmStoredEvent, TfgridModuleFarmDeletedEvent, TfgridModuleFarmUpdatedEvent, TfgridModuleFarmPayoutV2AddressRegisteredEvent, TfgridModuleFarmCertificationSetEvent } from "../types/events";
6+
import * as v63 from '../types/v63'
67

78
export async function farmStored(ctx: EventHandlerContext) {
89
const farmStoredEvent = new TfgridModuleFarmStoredEvent(ctx)
910

11+
console.log(ctx._chain.getEventHash('tfgridModule.FarmStored'))
1012
let farmStoredEventParsed
1113
if (farmStoredEvent.isV9) {
1214
farmStoredEventParsed = farmStoredEvent.asV9
@@ -15,6 +17,8 @@ export async function farmStored(ctx: EventHandlerContext) {
1517
} else if (farmStoredEvent.isV63) {
1618
farmStoredEventParsed = farmStoredEvent.asV63
1719
} else if (farmStoredEvent.isV101) {
20+
let eventValue = ctx.event.params[0].value as v63.Farm
21+
eventValue.dedicatedFarm = false
1822
farmStoredEventParsed = farmStoredEvent.asV101
1923
}
2024

@@ -75,6 +79,8 @@ export async function farmUpdated(ctx: EventHandlerContext) {
7579
} else if (farmUpdatedEvent.isV63) {
7680
farmUpdatedEventParsed = farmUpdatedEvent.asV63
7781
} else if (farmUpdatedEvent.isV101) {
82+
let eventValue = ctx.event.params[0].value as v63.Farm
83+
eventValue.dedicatedFarm = false
7884
farmUpdatedEventParsed = farmUpdatedEvent.asV101
7985
}
8086

0 commit comments

Comments
 (0)