-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Threshold Subgraph recieves events from several sources (contracts). So a logical division of events handlers can be each contract. To achieve this, the generic "mappings.ts" file have been splitted in "pre-app.ts" and "staking.ts". Also, TokenStaking entities list in subgraph manifest has been updated.
- Loading branch information
Showing
4 changed files
with
36 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
OperatorBonded, | ||
OperatorConfirmed, | ||
} from "../generated/SimplePREApplication/SimplePREApplication" | ||
import { PREOperator } from "../generated/schema" | ||
|
||
export function handleOperatorBonded(event: OperatorBonded): void { | ||
const preOperator = new PREOperator( | ||
event.params.stakingProvider.toHexString() | ||
) | ||
preOperator.operator = event.params.operator | ||
preOperator.save() | ||
} | ||
|
||
export function handleOperatorConfirmed(event: OperatorConfirmed): void { | ||
const preOperator = new PREOperator( | ||
event.params.stakingProvider.toHexString() | ||
) | ||
preOperator.operator = event.params.operator | ||
preOperator.confirmationTimestamp = event.block.timestamp | ||
preOperator.save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters