Skip to content
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

feat(payment-detection): add minIndexedBlock option for TheGraph #1262

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

alexandre-abrioux
Copy link
Member

@alexandre-abrioux alexandre-abrioux commented Nov 23, 2023

supersedes #1253

Context

When using TheGraph decentralized network, different GQL queries can target different indexers. For consistency, we can ask to target only indexers that have processed specific blocks using a block filter.

For more info, see here or here, look for number_gte in these pages.

Description of the changes

  • Added a new minIndexedBlock option to TheGraph client in order to handle this

@coveralls
Copy link

coveralls commented Nov 23, 2023

Coverage Status

coverage: 87.098%. remained the same
when pulling 586ca8f on subgraph-min-indexed-block-v2
into 9c9a2c1 on master.

@alexandre-abrioux alexandre-abrioux changed the title feat(payment-detection): add subgraphMinIndexedBlock option feat(payment-detection): add minIndexedBlock option for TheGraph Nov 23, 2023
Copy link
Contributor

@benjlevesque benjlevesque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: add a method getTheGraphClient(network, url, options) that deals with the near/evm condition:

const getTheGraphClient = (network:string, url: string, options?: TheGraphClientOptions) => NearChains.isChainSupported(network) ? getTheGraphNearClient(url, options) : getTheEvmGraphClient(url, options);

@alexandre-abrioux alexandre-abrioux marked this pull request as ready for review November 23, 2023 16:44
@alexandre-abrioux alexandre-abrioux enabled auto-merge (squash) November 24, 2023 11:03
@alexandre-abrioux alexandre-abrioux merged commit b3e0dce into master Nov 24, 2023
24 of 25 checks passed
@alexandre-abrioux alexandre-abrioux deleted the subgraph-min-indexed-block-v2 branch November 24, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants