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 upgrade handler for v1.7.5 #1767

Merged
merged 1 commit into from
Dec 3, 2024
Merged

add upgrade handler for v1.7.5 #1767

merged 1 commit into from
Dec 3, 2024

Conversation

joe-bowman
Copy link
Contributor

@joe-bowman joe-bowman commented Dec 3, 2024

1. Summary

Add upgrade handler and test for v1.7.5.

This upgrade handler resets the redemption rate on Cosmoshub-4, based upon the fixed logic in v1.7.5.

As of 3/12, this would be 1.3875 atom to 1 qatom.

It also sets the last redemption rate to 1.38, which is that rate at which unbondings take place.

Summary by CodeRabbit

  • New Features

    • Introduced a new upgrade version identifier, v1.7.5, to enhance upgrade tracking.
    • Added a new upgrade handler for v1.7.5 to manage withdrawal records and redemption rates.
  • Bug Fixes

    • Enhanced logic for handling duplicate withdrawal records and improved error handling.
  • Tests

    • Added a new test function to validate the functionality of the v1.7.5 upgrade handler.

Copy link
Contributor

coderabbitai bot commented Dec 3, 2024

Walkthrough

The changes in this pull request introduce a new upgrade constant and handler for version v1.7.5 in the upgrades package. Specifically, a new constant V010705UpgradeName is added, along with the corresponding V010705UpgradeHandler, which manages upgrade logic related to withdrawal records and redemption rates. Additionally, a test function is included to validate the behavior of the new upgrade handler. These modifications enhance the upgrade management system without altering existing functionalities.

Changes

File Change Summary
app/upgrades/types.go Added constant: V010705UpgradeName = "v1.7.5"
app/upgrades/upgrades.go New upgrade added: {UpgradeName: V010705UpgradeName, CreateUpgradeHandler: V010705UpgradeHandler}
app/upgrades/v1_7.go Added method: func V010705UpgradeHandler(...) for managing upgrades; existing handlers modified for logic enhancements.
app/upgrades_test.go Added test method: func (s *AppTestSuite) TestV010705UpgradeHandler() to validate the new handler.

Possibly related issues

  • Add upgrade handler for v1.6.3 #1707: The addition of the V010705UpgradeHandler may indirectly relate to the management of withdrawals, as it enhances upgrade handling, though it does not directly address the cancellation of withdrawals.

Possibly related PRs

Suggested labels

x/participationrewards

Suggested reviewers

  • minhngoc274
  • faddat
  • ajansari95

Poem

🐇 In the realm of upgrades, a new name we see,
V010705, as bright as can be.
With handlers and tests, our code's in good cheer,
For a seamless transition, we hold dear!
Hops of joy for the changes, let’s give a big cheer! 🎉


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 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.

app/upgrades_test.go Dismissed Show dismissed Hide dismissed
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.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2be465f and 2d95f22.

📒 Files selected for processing (4)
  • app/upgrades/types.go (1 hunks)
  • app/upgrades/upgrades.go (1 hunks)
  • app/upgrades/v1_7.go (1 hunks)
  • app/upgrades_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/upgrades/types.go
🧰 Additional context used
🪛 GitHub Check: devskim
app/upgrades_test.go

[failure] 485-485: A token or key was found in source code. If this represents a secret, it should be moved somewhere else.
Do not store tokens or keys in source code.

🔇 Additional comments (1)
app/upgrades/upgrades.go (1)

30-30: LGTM: Upgrade entry correctly added

The new upgrade entry for V010705UpgradeName has been correctly added to the Upgrades function, ensuring the new handler is included in the upgrade process.

app/upgrades/v1_7.go Show resolved Hide resolved
app/upgrades_test.go Show resolved Hide resolved
app/upgrades_test.go Show resolved Hide resolved
Copy link
Contributor

@ajansari95 ajansari95 left a comment

Choose a reason for hiding this comment

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

lgtm

@joe-bowman joe-bowman merged commit 644d7fd into main Dec 3, 2024
15 checks passed
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.43%. Comparing base (2be465f) to head (2d95f22).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/upgrades/v1_7.go 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1767      +/-   ##
==========================================
+ Coverage   61.41%   61.43%   +0.01%     
==========================================
  Files         196      196              
  Lines       17105    17117      +12     
==========================================
+ Hits        10505    10515      +10     
- Misses       5747     5748       +1     
- Partials      853      854       +1     
Flag Coverage Δ
unittests 61.43% <83.33%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
app/upgrades/types.go 50.00% <ø> (ø)
app/upgrades/upgrades.go 88.00% <100.00%> (+0.50%) ⬆️
app/upgrades/v1_7.go 12.50% <81.81%> (+8.97%) ⬆️

@joe-bowman joe-bowman deleted the v1.7.5-upgrade branch December 3, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants