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

Add supply indexing #28

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Add supply indexing #28

merged 1 commit into from
Nov 20, 2024

Conversation

jorgecuesta
Copy link
Collaborator

Summary

This pull request adds the Supply entity and updates the block entity.

Issue

This PR addresses improvements required for supply handling and indexing. The updates include:

  • Added a supplies field to the Block type to reference Supply entities.
  • Added new Supply type in schema.graphql.

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

@jorgecuesta jorgecuesta added the enhancement New feature or request label Nov 12, 2024
@jorgecuesta jorgecuesta self-assigned this Nov 12, 2024
@jorgecuesta jorgecuesta requested a review from Olshansk November 12, 2024 21:44
@jorgecuesta jorgecuesta changed the title Add supply indexing [NOT MERGE UNTIL #26] Add supply indexing Nov 12, 2024
@jorgecuesta jorgecuesta changed the title [NOT MERGE UNTIL #26] Add supply indexing [NOT MERGE BEFORE #26] Add supply indexing Nov 12, 2024
Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

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

Nice one @jorgecuesta! 🚀

src/mappings/bank/supply.ts Outdated Show resolved Hide resolved
src/mappings/bank/supply.ts Outdated Show resolved Hide resolved
src/mappings/primitives.ts Outdated Show resolved Hide resolved
src/mappings/primitives.ts Outdated Show resolved Hide resolved
src/mappings/bank/supply.ts Outdated Show resolved Hide resolved
src/mappings/bank/supply.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

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

Preemptively approving! 🙌

Just a couple more last-minute suggestions and then I think this is good to go.

src/mappings/bank/supply.ts Show resolved Hide resolved
src/mappings/primitives.ts Show resolved Hide resolved
@jorgecuesta
Copy link
Collaborator Author

@bryanchriswhite Please refer to the attached images to look how the structure looks at the database and also the same result on the graphql query.

I think now this achieve a proper handling of supply for any denomination on the block, which allows further updates on the protocol like IBC transactions without need to modify it.

image
image

Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

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

@jorgecuesta this is looking really good! 🙌

I just had a few suggestions and then we can 🚢.

schema.graphql Outdated Show resolved Hide resolved
schema.graphql Show resolved Hide resolved
src/mappings/primitives.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

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

Preemptively approving as none of my suggestions are blocking.

@jorgecuesta
Copy link
Collaborator Author

All the suggestions gone applied @bryanchriswhite now just wait to get the #26 before rebase and merge it. Thanks!

- Introduce SupplyDenom entity
- Introduce Supply entity
- Introduce BlockSupply join entity
- Update block to relate with BlockSupply
- Handle genesis SupplyDenom and Supply
@jorgecuesta jorgecuesta changed the title [NOT MERGE BEFORE #26] Add supply indexing Add supply indexing Nov 19, 2024
@jorgecuesta jorgecuesta merged commit 18bd0e5 into main Nov 20, 2024
4 checks passed
@jorgecuesta jorgecuesta deleted the add-supply branch November 20, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants