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

[NOT MERGE BEFORE #26] Add supply indexing #28

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Commits on Nov 12, 2024

  1. Add total supply handling.

    - Introduced a new `Supply` type in `schema.graphql`.
    - Created `getSupply` function in `src/mappings/bank/supply.ts` to fetch total supply.
    - Modified `handleGenesis` to store the initial supply from genesis state.
    - Added `_handleSupply` function in `src/mappings/primitives.ts` to periodically index total supply.
    - Updated the Genesis interface to include supply data.
    jorgecuesta committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    80f41c6 View commit details
    Browse the repository at this point in the history
  2. Add Supply entity and update supply handling logic

    - Introduced `supplies` field in `Block` type to reference `Supply` entities.
    - Added new fields `denom` and `block` to `Supply` type.
    - Replaced `getSupply` with `queryTotalSupply` and implement `getSupplyRecord`.
    - Modified `_handleSupply` to create supply records with `getSupplyRecord` and avoid duplicates.
    jorgecuesta committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    d6c72fa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26968ed View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2024

  1. Refactor and relocate _handleSupply function

    - Removed `_handleSupply` from `primitives.ts` and imported it from `supply.ts`.
    - Reorganized `getSupplyRecord` in `supply.ts` to use `getSupplyId` for ID generation.
    - Simplified supply concatenation logic in `queryTotalSupply` by using `push` instead of `concat`.
    - Centralized total supply handling in `supply.ts` for clearer separation of concerns.
    jorgecuesta committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    579aef8 View commit details
    Browse the repository at this point in the history
  2. Included a comment about why we handle supply in the current way and …

    …what we plan to do on future releases.
    jorgecuesta committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    a0d5d44 View commit details
    Browse the repository at this point in the history
  3. Add support for linking block and supply data

    - Introduced new handler `handleBlockSupply` to link block with recent supply.
    - Added `supply` field to `Block` entity in GraphQL schema.
    - Ensured supply records in genesis block are handled properly.
    - Modified `_handleSupply` and `_handleBlockSupply` to update and retrieve supply data.
    - Updated `Genesis` interface to include supply information.
    jorgecuesta committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    4ed4975 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7ed0355 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2024

  1. Implement an enhanced supply tracking mechanism

    - Replaced the old block supply handler with a more robust tracking system.
    - Introduced `SupplyDenom` and `BlockSupply` entities for better denomination supply tracking.
    - Added logic to handle supply records creation for each block, adjusting for the genesis block.
    - Adjusted schema to accommodate new entities and relationships.
    - Removed unused functions and refactored supply-related code for clarity and efficiency.
    jorgecuesta committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    339b635 View commit details
    Browse the repository at this point in the history