-
Notifications
You must be signed in to change notification settings - Fork 48
[Horizon] Subgraph indexing registration implementation #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juanmardefago
merged 20 commits into
juanmardefago/horizon-delegation-pool-management
from
juanmardefago/horizon-subgraph-indexing-registration
Mar 31, 2025
Merged
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
83303d3
feat: prepared configs, placeholder mapping file
juanmardefago dfa15dd
feat: added basic service registry for Horizon
juanmardefago 3c5144b
fix: abi.decode potential decoding failure
juanmardefago dc3485a
chore: placeholder event handlers
juanmardefago c53dafc
chore: updated ABIs
juanmardefago 9b7848f
feat: implemented AllocationCreated, Closed and Resized
juanmardefago ec7b808
fix: build issues
juanmardefago e294b7d
chore: placeholder handler definition
juanmardefago c6cfb8f
feat: added indexing rewards collection handler
juanmardefago e369281
feat: add QueryFeesCollected support
juanmardefago 6e10a77
feat: added QueryFeesCollected handler with latest contract changes
juanmardefago 100cc4d
feat: add GraphPayments abi
juanmardefago c1591c0
feat: add tax tracking for Horizon through GraphPayments
juanmardefago a39e714
feat: placeholders and manifest changes for delegation
juanmardefago 82e1367
feat: added horizon delegation events support
juanmardefago 2134b1b
fix: missing inits
juanmardefago 77e8285
fix: address gh pr feedback
juanmardefago acaa649
fix: build issues and feedback from PaymentCollection PR
juanmardefago de56491
fix: addressed AllocationManagement pr feedback
juanmardefago 272e9f1
fix: address feedback from Subgraph Indexing Registration PR
juanmardefago File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 { ethereum, ValueKind, log } from "@graphprotocol/graph-ts" | ||
| import { RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" | ||
| import { createOrLoadProvision } from "./helpers/helpers" | ||
|
|
||
| export function handleServiceProviderRegistered(event: ServiceProviderRegistered): void { | ||
| let decodedCalldata = ethereum.decode('(string,string,address)', event.params.data) | ||
| if( decodedCalldata != null && decodedCalldata.kind == ethereum.ValueKind.TUPLE) { | ||
| let tupleData = decodedCalldata.toTuple() | ||
| let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) | ||
| provision.url = tupleData[0].toString() | ||
| provision.geoHash = tupleData[1].toString() | ||
| provision.save() | ||
| } else { | ||
| log.warning("ServiceProviderRegistered failed to decode: {}", [event.params.data.toHexString()]) | ||
| } | ||
juanmardefago marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| export function handleRewardsDestinationSet(event: RewardsDestinationSet): void { | ||
| let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) | ||
| provision.rewardsDestination = event.params.rewardsDestination | ||
| provision.save() | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.