Skip to content

Commit

Permalink
fix: farm create/update
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVerstraete committed Aug 22, 2022
1 parent fa82b89 commit 94dac8a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion processor-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions src/mappings/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 94dac8a

Please sign in to comment.