Skip to content

Commit

Permalink
Avoid lifting inactive spells
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkhoo committed Sep 21, 2023
1 parent 658c454 commit 258f7a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,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 258f7a2

Please sign in to comment.