Skip to content

Commit

Permalink
fix(#patch); Maker Governance; avoid lifting inactive spells (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkhoo authored Oct 2, 2023
1 parent 45f8887 commit 9b812ba
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9b812ba

Please sign in to comment.