From 9b812baf93249815d68529089504d26a49081b40 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 16:11:23 +0800 Subject: [PATCH] fix(#patch); Maker Governance; avoid lifting inactive spells (#2378) --- .../protocols/maker-governance/src/ds-chief.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subgraphs/maker-governance/protocols/maker-governance/src/ds-chief.ts b/subgraphs/maker-governance/protocols/maker-governance/src/ds-chief.ts index 291550e09b..5c79d8e95d 100644 --- a/subgraphs/maker-governance/protocols/maker-governance/src/ds-chief.ts +++ b/subgraphs/maker-governance/protocols/maker-governance/src/ds-chief.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-magic-numbers */ + import { BigInt, Bytes, Address, ethereum, log } from "@graphprotocol/graph-ts"; import { LogNote, Etch } from "../../../generated/DSChief/DSChief"; import { VoteDelegate } from "../../../generated/DSChief/VoteDelegate"; @@ -187,7 +189,7 @@ export function handleLift(event: LogNote): void { const spellID = Address.fromString(event.params.foo.toHexString().slice(26)); const spell = Spell.load(spellID.toHexString()); - if (!spell) return; + if (!spell || spell.state != SpellState.ACTIVE) return; spell.state = SpellState.LIFTED; spell.liftedTxnHash = event.transaction.hash.toHexString(); spell.liftedBlock = event.block.number;