Skip to content

Commit

Permalink
Add all versions of the classic harvest event
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Nov 28, 2024
1 parent 723b487 commit efbd0b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/classic/compound.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { BigInt, ethereum, log } from "@graphprotocol/graph-ts"
import { StratHarvest as HarvestEvent, StratHarvest1 as HarvestEvent1 } from "../../generated/templates/ClassicStrategy/ClassicStrategy"
import { StratHarvest as HarvestEvent0 } from "../../generated/templates/ClassicStrategy/ClassicStrategyStratHarvest0"
import { StratHarvest as HarvestEvent1 } from "../../generated/templates/ClassicStrategy/ClassicStrategyStratHarvest1"
import { getAndSaveTransaction } from "../common/entity/transaction"
import { ClassicHarvestEvent } from "../../generated/schema"
import { getEventIdentifier } from "../common/utils/event"
import { getClassic, getClassicStrategy, hasClassicBeenRemoved, isClassicInitialized } from "./entity/classic"
import { fetchClassicData, updateClassicDataAndSnapshots } from "./utils/classic-data"

export function handleClassicStrategyHarvestAllIndexed(event: HarvestEvent1): void {
export function handleClassicStrategyHarvest0(event: HarvestEvent0): void {
_handleClassicStrategyHarvest(event, event.params.wantHarvested)
}

export function handleClassicStrategyHarvest(event: HarvestEvent): void {
export function handleClassicStrategyHarvest1(event: HarvestEvent1): void {
_handleClassicStrategyHarvest(event, event.params.wantHarvested)
}

Expand Down
2 changes: 1 addition & 1 deletion src/classic/mapping/strategy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { handleClassicStrategyInitialized } from "../lifecycle"
export { handleClassicStrategyPaused } from "../lifecycle"
export { handleClassicStrategyUnpaused } from "../lifecycle"
export { handleClassicStrategyHarvest, handleClassicStrategyHarvestAllIndexed } from "../compound"
export { handleClassicStrategyHarvest0, handleClassicStrategyHarvest1 } from "../compound"
4 changes: 2 additions & 2 deletions subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ templates:
abis: *abis
eventHandlers:
- event: StratHarvest(indexed address,uint256,uint256)
handler: handleClassicStrategyHarvest
handler: handleClassicStrategyHarvest0

- name: ClassicStrategyStratHarvest1
kind: ethereum/contract
Expand All @@ -355,7 +355,7 @@ templates:
abis: *abis
eventHandlers:
- event: StratHarvest(indexed address,indexed uint256,indexed uint256)
handler: handleClassicStrategyHarvestAllIndexed
handler: handleClassicStrategyHarvest1

- name: ClassicBoost
kind: ethereum/contract
Expand Down

0 comments on commit efbd0b6

Please sign in to comment.