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

migrate all proto instances of sdk.Int to math.Int #1799

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

joe-bowman
Copy link
Contributor

@joe-bowman joe-bowman commented Jan 27, 2025

1. Summary

Migrate all usage of sdk.Int to math.Int

2.Type of change

  • Non breaking

3. Implementation details

Replace instances of deprecated sdk.Int to math.Int.

Summary by CodeRabbit

  • Refactor
    • Updated type references from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int across multiple protocol buffer files
    • Modified custom type annotations for various integer fields in Quicksilver project's protobuf definitions

Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Walkthrough

This pull request involves updating the custom type annotations for integer fields across multiple Protobuf files in the Quicksilver project. The changes systematically replace references to github.com/cosmos/cosmos-sdk/types.Int with cosmossdk.io/math.Int in various protocol buffer definitions. These modifications span files related to claims management, interchain queries, interchain staking, and proposals, indicating a broader migration of integer type handling in the project's type system.

Changes

File Change Summary
proto/quicksilver/claimsmanager/v1/claimsmanager.proto Updated amount field's custom type from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int
proto/quicksilver/interchainquery/v1/interchainquery.proto Updated custom types for period, last_height, last_emission, remote_height, and local_height from old to new integer type reference
proto/quicksilver/interchainstaking/v1/interchainstaking.proto Updated custom types for dust_threshold, amount, voting_power in various messages
proto/quicksilver/interchainstaking/v1/proposals.proto Updated dust_threshold custom type in RegisterZoneProposal and RegisterZoneProposalWithDeposit messages
proto/quicksilver/interchainstaking/v1/query.proto Updated custom types for deposited, delegated, supply, and tvl fields

Possibly related PRs

Suggested labels

x/interchainquery, CLI

Suggested reviewers

  • faddat
  • ajansari95
  • minhngoc274

Poem

🐰 Integers dancing, types rearranged,
From SDK's path to math's new range
Protobuf whispers of changes so neat
A rabbit's refactor, now complete!
Type migration, smooth and light 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 166c496 and eccf22c.

⛔ Files ignored due to path filters (5)
  • x/claimsmanager/types/claimsmanager.pb.go is excluded by !**/*.pb.go
  • x/interchainquery/types/interchainquery.pb.go is excluded by !**/*.pb.go
  • x/interchainstaking/types/interchainstaking.pb.go is excluded by !**/*.pb.go
  • x/interchainstaking/types/proposals.pb.go is excluded by !**/*.pb.go
  • x/interchainstaking/types/query.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (5)
  • proto/quicksilver/claimsmanager/v1/claimsmanager.proto (1 hunks)
  • proto/quicksilver/interchainquery/v1/interchainquery.proto (2 hunks)
  • proto/quicksilver/interchainstaking/v1/interchainstaking.proto (4 hunks)
  • proto/quicksilver/interchainstaking/v1/proposals.proto (2 hunks)
  • proto/quicksilver/interchainstaking/v1/query.proto (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: test quicksilver (darwin, arm64)
  • GitHub Check: test quicksilver (amd64, windows)
  • GitHub Check: test quicksilver (amd64, linux)
  • GitHub Check: lint
  • GitHub Check: DevSkim
  • GitHub Check: Analyze
🔇 Additional comments (10)
proto/quicksilver/claimsmanager/v1/claimsmanager.proto (1)

40-40: LGTM: Correct migration of Int type

The update from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly while maintaining the field properties.

proto/quicksilver/interchainquery/v1/interchainquery.proto (2)

21-21: LGTM: Correct migration of Int types in Query message

The updates from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int are done correctly for all fields.

Note: These fields are marked for conversion to uint64 in v0.5.0. Consider tracking this future change in your issue tracker.

Also applies to: 26-26, 33-33


43-43: LGTM: Correct migration of Int types in DataPoint message

The updates from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int are done correctly for both height fields.

Note: These fields are also marked for conversion to uint64 in v0.5.0. Ensure this is tracked alongside the Query message fields.

Also applies to: 48-48

proto/quicksilver/interchainstaking/v1/proposals.proto (1)

32-32: LGTM: Correct migration of Int types in proposal messages

The updates from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int are done correctly for both dust_threshold fields while maintaining their properties.

Also applies to: 59-59

proto/quicksilver/interchainstaking/v1/interchainstaking.proto (4)

55-55: LGTM: Correct migration of Int type in Zone message

The update of dust_threshold from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly.


101-101: LGTM: Correct migration of Int type in Distribution message

The update of amount from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly.


160-160: LGTM: Correct migration of Int type in RedelegationRecord message

The update of amount from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly.


179-179: LGTM: Correct migration of Int type in Validator message

The update of voting_power from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly.

proto/quicksilver/interchainstaking/v1/query.proto (2)

130-130: LGTM: Correct migration of Int types in Statistics message

The updates from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int are done correctly for all fields (deposited, delegated, supply).

Also applies to: 137-137, 142-142


232-232: LGTM: Correct migration of Int type in QueryDelegationsResponse message

The update of tvl from github.com/cosmos/cosmos-sdk/types.Int to cosmossdk.io/math.Int is done correctly.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.66%. Comparing base (7203487) to head (eccf22c).
Report is 19 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1799      +/-   ##
==========================================
+ Coverage   61.43%   61.66%   +0.23%     
==========================================
  Files         196      196              
  Lines       17117    17127      +10     
==========================================
+ Hits        10515    10562      +47     
+ Misses       5748     5700      -48     
- Partials      854      865      +11     
Flag Coverage Δ
unittests 61.66% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 6 files with indirect coverage changes

Copy link
Contributor

@arhamchordia arhamchordia left a comment

Choose a reason for hiding this comment

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

Changes looks good to me.
Not breaking as it is just a type change to same code in different location.

@joe-bowman joe-bowman merged commit b7f2bde into main Jan 28, 2025
17 checks passed
@joe-bowman joe-bowman deleted the change-sdkInt-to-mathInt branch January 28, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants