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

fix(auction) link rewards accounts #2516

Merged
merged 2 commits into from
May 6, 2024
Merged

Conversation

robert-zaremba
Copy link
Member

Description

@robert-zaremba robert-zaremba requested a review from a team as a code owner May 6, 2024 13:36
Copy link
Contributor

coderabbitai bot commented May 6, 2024

Walkthrough

The changes across multiple files involve integrating rewardsAuctionAccs into various components, replacing the previous metoken.ModuleName references. This includes updating the initialization and configuration of AuctionKeeperB and LeverageKeeper, as well as aligning test setups with the new auction rewards account structure.

Changes

File Path Change Summary
app/app.go Updated AuctionKeeperB and LeverageKeeper setups with rewardsAuctionAccs. Removed redundant setup.
x/auction/keeper/keeper.go Renamed accs to Accs in the Builder struct.
x/leverage/.../internal_test.go Replaced authtypes.NewModuleAddress(metoken.ModuleName) with accs.GenerateAddr("auction.Rewards").
x/leverage/keeper/keeper.go Renamed meTokenAddr to rewardsAuction in Keeper struct.
x/metoken/.../keeper_test.go Adjusted Metoken keeper initialization to include app.AuctionKeeperB.Accs.RewardsCollect.
x/metoken/.../msg_server_test.go Added app.AuctionKeeperB.Accs.RewardsCollect in test functions.
x/metoken/keeper/keeper.go Updated Builder and Keeper structs to include rewardsAuction of type sdk.AccAddress.
x/metoken/keeper/unit_test.go Added import statement for accs and modified initSimpleKeeper with accs.GenerateAddr("auction.Rewards").

🐰✨
Oh hop! Oh joy! What changes we make,
In the code, where no line is fake.
With rewardsAuction now set in place,
Our app runs smooth, wins the race.
Hop along now, no time to waste!
🌟🐇


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5d47e66 and e2c0c6e.
Files selected for processing (7)
  • app/app.go (2 hunks)
  • x/leverage/keeper/internal_test.go (2 hunks)
  • x/leverage/keeper/keeper.go (3 hunks)
  • x/metoken/keeper/intest/keeper_test.go (1 hunks)
  • x/metoken/keeper/intest/msg_server_test.go (4 hunks)
  • x/metoken/keeper/keeper.go (5 hunks)
  • x/metoken/keeper/unit_test.go (2 hunks)
Additional comments not posted (12)
x/metoken/keeper/unit_test.go (1)

23-23: Integration of rewardsAuction in NewBuilder function aligns with PR objectives.

x/leverage/keeper/internal_test.go (1)

36-36: Integration of rewardsAuction in NewKeeper function aligns with PR objectives.

x/metoken/keeper/keeper.go (1)

21-21: Integration of rewardsAuction in Builder and Keeper structs, and their respective initialization functions, aligns with PR objectives.

Also applies to: 32-32, 41-41, 52-52, 67-67

x/metoken/keeper/intest/keeper_test.go (1)

57-57: Integration of rewardsAuction in NewBuilder function and Keeper method aligns with PR objectives.

Also applies to: 64-64, 70-70

x/leverage/keeper/keeper.go (1)

24-24: Integration of rewardsAuction in Keeper struct and NewKeeper function aligns with PR objectives.

Also applies to: 37-37

app/app.go (3)

481-488: The integration of rewardsAuctionAccs into AuctionKeeperB aligns well with the PR objectives to enhance rewards management.


489-497: The update to LeverageKeeper to use rewardsAuctionAccs.RewardsCollect is consistent with the intended enhancements to rewards management.


517-517: The inclusion of rewardsAuctionAccs.RewardsCollect in MetokenKeeperB aligns with the PR's objectives to centralize rewards management.

x/metoken/keeper/intest/msg_server_test.go (4)

619-619: Ensure the correct rewards account is used in the NewBuilder function.


Line range hint 14-618: The test setup and assertions in TestMsgServer_Swap appear correctly implemented and consistent with the PR objectives.


Line range hint 620-717: The test setup and assertions in TestMsgServer_Swap_NonStableAssets_DiffExponents appear correctly implemented and consistent with the PR objectives.


Line range hint 718-1461: The test setup and assertions in TestMsgServer_Swap_AfterAddingAssetToIndex appear correctly implemented and consistent with the PR objectives.

@robert-zaremba robert-zaremba force-pushed the robert/auction-fix-accs branch from e2c0c6e to f9a8aaf Compare May 6, 2024 13:43
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: 0

Out of diff range and nitpick comments (1)
x/auction/keeper/keeper.go (1)

Line range hint 9-11: Consider using a more appropriate type for RewardsCollect.

In blockchain applications, account addresses are typically represented as strings or specific address types. Using a byte array might lead to issues with address handling and readability. Consider changing the type to sdk.AccAddress if applicable.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5d47e66 and f9a8aaf.
Files selected for processing (8)
  • app/app.go (2 hunks)
  • x/auction/keeper/keeper.go (2 hunks)
  • x/leverage/keeper/internal_test.go (2 hunks)
  • x/leverage/keeper/keeper.go (3 hunks)
  • x/metoken/keeper/intest/keeper_test.go (1 hunks)
  • x/metoken/keeper/intest/msg_server_test.go (4 hunks)
  • x/metoken/keeper/keeper.go (5 hunks)
  • x/metoken/keeper/unit_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (7)
  • app/app.go
  • x/leverage/keeper/internal_test.go
  • x/leverage/keeper/keeper.go
  • x/metoken/keeper/intest/keeper_test.go
  • x/metoken/keeper/intest/msg_server_test.go
  • x/metoken/keeper/keeper.go
  • x/metoken/keeper/unit_test.go
Additional comments not posted (3)
x/auction/keeper/keeper.go (3)

23-23: LGTM! The addition of the Accs field aligns with the PR's objectives.


32-32: LGTM! The NewBuilder function correctly initializes the Builder struct with the new Accs field.


40-40: LGTM! The inclusion of the accs field in the Keeper struct is consistent with the PR's objectives.

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.11%. Comparing base (7f05ad4) to head (f9a8aaf).
Report is 463 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2516       +/-   ##
===========================================
- Coverage   75.38%   63.11%   -12.28%     
===========================================
  Files         100      272      +172     
  Lines        8025    15694     +7669     
===========================================
+ Hits         6050     9905     +3855     
- Misses       1589     5029     +3440     
- Partials      386      760      +374     
Files Coverage Δ
app/app.go 92.83% <100.00%> (ø)
x/auction/keeper/keeper.go 64.70% <100.00%> (ø)
x/leverage/keeper/keeper.go 59.82% <100.00%> (-10.23%) ⬇️
x/metoken/keeper/keeper.go 100.00% <100.00%> (ø)

... and 234 files with indirect coverage changes

@robert-zaremba robert-zaremba merged commit 4c77e3e into main May 6, 2024
21 of 25 checks passed
@robert-zaremba robert-zaremba deleted the robert/auction-fix-accs branch May 6, 2024 15:02
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.

1 participant