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 block metadata and size calculation #29

Merged
merged 3 commits into from
Nov 20, 2024
Merged

Conversation

jorgecuesta
Copy link
Collaborator

@jorgecuesta jorgecuesta commented Nov 16, 2024

Summary

  • Updated Block to handle block metadata (header, last commit, etc) and calculated block size.
  • Restructured utils.ts file into a utils folder with focused files instead.
  • Enhanced error messages to provide clearer context in exception cases.
  • Adjusted constants to correct the PREFIX value.
  • Fixed various formatting issues, including
    • Replacing double quotes with single quotes where appropriate
    • Adding missing semicolons
    • Ensuring uniform indentation and spacing consistency.
    • Updated function signatures to consistently include trailing commas for parameters.

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 16, 2024
@jorgecuesta jorgecuesta self-assigned this Nov 16, 2024
Base automatically changed from add-supply to main November 20, 2024 01:32
- Updated Block to handle block metadata (header, last commit, etc) and calculated block size.
- Restructured `utils.ts` file into a `utils` folder with focused files instead.
- Fixed various formatting issues, including
  - Replacing double quotes with single quotes where appropriate
  - Adding missing semicolons
  - Ensuring uniform indentation and spacing consistency.
  - Updated function signatures to consistently include trailing commas for parameters.
- Enhanced error messages to provide clearer context in exception cases.
- Adjusted constants to correct the PREFIX value.
@jorgecuesta jorgecuesta changed the title [NOT MERGE BEFORE #28] Refactor utility functions and enhance block processing Refactor utility functions and enhance block processing Nov 20, 2024
@jorgecuesta jorgecuesta changed the title Refactor utility functions and enhance block processing Add block metadata and size calculation Nov 20, 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.

This one is also pretty big - I only did a cursory review but it we already discussed the schema changes which is what I'm most concerned about. LGTM. 👍

src/mappings/utils/block_parser.ts Outdated Show resolved Hide resolved
- Introduced functions to calculate the byte size of `TxData`, `TxEvent`, and `EventAttribute`.
- Enhanced block size calculation by using detailed parsing of `TxData`.
- Optimized import statements in block size and block parser utilities.
- Replaced custom `bytesToBech32` and `bytesToHex` functions with `@cosmjs/encoding` equivalents for consistency.
@jorgecuesta jorgecuesta merged commit 8b630eb into main Nov 20, 2024
4 checks passed
@jorgecuesta jorgecuesta deleted the add-block-metadata branch November 20, 2024 22:35
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
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants