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

chore(deps): collections to v0.4.0 for math.Int value encoder #1703

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

Unique-Divine
Copy link
Member

@Unique-Divine Unique-Divine commented Dec 12, 2023

Summary by CodeRabbit

  • Refactor

    • Streamlined data encoding and decoding processes by integrating updated encoder types.
  • Chores

    • Updated dependency versions to enhance performance and security.
  • Documentation

    • Updated CHANGELOG to reflect the recent changes.

@Unique-Divine Unique-Divine requested a review from a team as a code owner December 12, 2023 01:47
Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

The recent updates involve refactoring and dependency management. Redundant encoders and associated functions have been removed from dnr.go, with imports adjusted accordingly. In keeper.go, internal encoders are replaced by those from the collections package, suggesting a shift towards standardized encoding mechanisms. These changes streamline the codebase and potentially enhance maintainability by relying on a common set of encoding utilities.

Changes

File(s) Summary
CHANGELOG.md Dependency version bump with no semantic changes.
x/perp/v2/keeper/dnr.go Removed math/big import, IntValueEncoder, IntKeyEncoder, related functions, and constants.
x/perp/v2/keeper/keeper.go Replaced internal encoders with collections package encoders in NewKeeper function.

Poem

🐇 CodeRabbit hopped along,
Refactoring code, making it strong.
Out with the old, in with the new,
Cleaner, leaner — a fresh morning dew. 🌱

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@Unique-Divine Unique-Divine added type: refactor dependencies Pull requests that update a dependency file labels Dec 12, 2023
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b400eed and eff498f.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • x/perp/v2/keeper/dnr.go (2 hunks)
  • x/perp/v2/keeper/keeper.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
Additional comments: 4
x/perp/v2/keeper/dnr.go (3)
  • 1-6: The import of the collections package is correctly updated to presumably use the new math.Int value encoder from the collections package v0.4.0. Ensure that the collections package at this version is compatible with the rest of the codebase and that all necessary migrations from the old encoders to the new ones are complete.

  • 10-11: The removal of the math/big package import suggests that the new collections package handles the functionality previously provided by math/big. Verify that all instances where math/big was used are now correctly using the collections package and that there are no leftover usages that would require the math/big package.

  • 13-15: The rest of the file appears to be unchanged, which implies that the existing logic and functionality are expected to work with the updated collections package. Confirm that the integration of the new encoders from the collections package does not require any additional changes to the existing methods and that they are compatible with the rest of the codebase.

x/perp/v2/keeper/keeper.go (1)
  • 103-122: The changes to the NewKeeper function correctly replace the old IntValueEncoder and IntKeyEncoder with collections.IntValueEncoder and collections.IntKeyEncoder from the updated collections package. This aligns with the PR objectives and the AI-generated overview. Ensure that the collections package is indeed updated to v0.4.0 in the go.mod file to match the PR's intent.

The verification script confirms that the collections package has been updated to version v0.4.0 in the go.mod file, which is consistent with the PR's objective to use the new math.Int value encoder from this version. The changes in the keeper.go file, replacing the old IntValueEncoder and IntKeyEncoder with collections.IntValueEncoder and collections.IntKeyEncoder, are also in line with the PR's intent.

Final review comment:

The updates to the NewKeeper function in keeper.go are verified to correctly implement the new encoders from the collections package version v0.4.0, as intended by the PR. The dependency version in the go.mod file matches the PR's objective.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #1703 (eff498f) into main (b400eed) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1703      +/-   ##
==========================================
- Coverage   73.93%   73.92%   -0.02%     
==========================================
  Files         191      191              
  Lines       15129    15103      -26     
==========================================
- Hits        11186    11165      -21     
+ Misses       3289     3285       -4     
+ Partials      654      653       -1     
Files Coverage Δ
x/perp/v2/keeper/dnr.go 85.15% <ø> (+0.74%) ⬆️
x/perp/v2/keeper/keeper.go 97.46% <100.00%> (ø)

@Unique-Divine Unique-Divine merged commit 8d4ee29 into main Dec 12, 2023
21 checks passed
@Unique-Divine Unique-Divine deleted the realu/1678-coll-int branch December 12, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(collections): cosmossdk.io/math.Int key and value encoder
2 participants