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

Clean up the Marker's expected BankKeeper interface. #1954

Merged
merged 10 commits into from
May 13, 2024

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented Apr 25, 2024

Description

This PR removes a couple entries form the marker module's expected BankKeeper interface:

  • IterateAllBalances: This was originally for the Holding query. We've since switched to the SDK's DenomOwners query, so we can get rid of this entry.
  • GetAllSendEnabledEntries: This was only needed for the quicksilver upgrade, and is no longer used.

Related to:


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Summary by CodeRabbit

  • New Features

    • Added functionality to retrieve accounts holding a specific denomination.
  • Refactor

    • Simplified access to marker holders by centralizing function calls.
    • Streamlined the BankKeeper interface by removing unused methods.
  • Documentation

    • Updated CHANGELOG to reflect recent fixes and interface clean-up.
  • Bug Fixes

    • Addressed failing unit tests related to marker module changes.

# Conflicts:
#	x/marker/keeper/keeper_test.go
…ery directly (instead of marker's Holding query) because the marker's Holding query fails if the marker doesn't exist, which we don't care about here.
@SpicyLemon SpicyLemon requested a review from a team as a code owner April 25, 2024 18:10
Copy link
Contributor

coderabbitai bot commented Apr 25, 2024

Warning

Rate Limit Exceeded

@SpicyLemon has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 52 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 22833f4 and c7b5327.

Walkthrough

The recent updates refine marker management in the blockchain app, enhancing efficiency and clarity. Changes include introducing a new function for retrieving marker holders, refining marker logic by removing unnecessary iterations, and optimizing the BankKeeper interface by removing less utilized methods.

Changes

File Path Change Summary
x/marker/keeper/keeper_test.go Added getAllMarkerHolders function; refactored test calls.
x/marker/keeper/marker.go Removed GetAllMarkerHolders function; simplified marker handling.
x/marker/types/expected_keepers.go Updated BankKeeper interface by removing certain methods.
x/marker/types/marker_test.go Streamlined marker testing by removing unnecessary code block.

🎉🐇
Among lines of code, a rabbit dances with glee,
Cleaning up clutter, making code sparkle with glee.
Unnecessary bits bid farewell, leaving behind what's true,
Cheers to streamlined code, a developer's dream come true.
Onward we hop, in the land of bytes and arrays,
Celebrating clean code, brightening our coding days!
🎉🐇


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.

Taztingo
Taztingo previously approved these changes Apr 25, 2024
@SpicyLemon SpicyLemon enabled auto-merge (squash) April 25, 2024 18:15
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 (4)
CHANGELOG.md (4)

Line range hint 77-319: Convert dashes to asterisks for unordered list items to maintain consistency in list formatting.

- -
+ *

Line range hint 193-193: Convert bare URLs to markdown links for better readability and to follow markdown best practices.

- https://github.com/provenance-io/provenance/issues/192
+ [Issue #192](https://github.com/provenance-io/provenance/issues/192)

Line range hint 306-306: Remove unnecessary spaces inside code span elements to clean up the formatting.

- ` MsgAddAccessRequest `
+ `MsgAddAccessRequest`

Line range hint 910-910: Remove spaces inside emphasis markers to correct the markdown formatting.

- * message *
+ *message*

Taztingo
Taztingo previously approved these changes Apr 25, 2024
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)
CHANGELOG.md (1)

Line range hint 77-321: Consistent list item markers should be used.

- - Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
+ * Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
- - Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
+ * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
- - Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
+ * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
- - Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Remove unsupported database types [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Remove unsupported database types [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Update ibc and migrate params [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Update ibc and migrate params [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Replace ModuleBasics with BasicModuleManager [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Replace ModuleBasics with BasicModuleManager [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Remove handlers from provenance modules [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Remove handlers from provenance modules [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Updated app.go to use RegisterStreamingServices on BaseApp [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Updated app.go to use RegisterStreamingServices on BaseApp [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Bump the SDK to `v0.50.5-pio-1` (from an earlier ephemeral version) [#1897](https://github.com/provenance-io/provenance/pull/1897).
+ * Bump the SDK to `v0.50.5-pio-1` (from an earlier ephemeral version) [#1897](https://github.com/provenance-io/provenance/pull/1897).
- - Removed `rewards` module [#1905](https://github.com/provenance-io/provenance/pull/1905).
+ * Removed `rewards` module [#1905](https://github.com/provenance-io/provenance/pull/1905).
- - Remove unused navs [#1920](https://github.com/provenance-io/provenance/issues/1920).
+ * Remove unused navs [#1920](https://github.com/provenance-io/provenance/issues/1920).
- - Remove emitting of EventTypeMessage [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Remove emitting of EventTypeMessage [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Update genutil for sdk 50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Update genutil for sdk 50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- - Migrate module params from param space to module store.[#1760](https://github.com/provenance-io/provenance/issues/1935)
+ * Migrate module params from param space to module store.[#1760](https://github.com/provenance-io/provenance/issues/1935)
-   - Attribute module param migration [#1927](https://github.com/provenance-io/provenance/pull/1927).
+   * Attribute module param migration [#1927](https://github.com/provenance-io/provenance/pull/1927).
-   - Marker module param migration [#1934](https://github.com/provenance-io/provenance/pull/1934).
+   * Marker module param migration [#1934](https://github.com/provenance-io/provenance/pull/1934).
-   - Metadata module param migration [#1932](https://github.com/provenance-io/provenance/pull/1932).
+   * Metadata module param migration [#1932](https://github.com/provenance-io/provenance/pull/1932).
-   - Msgfees module param migration [#1936](https://github.com/provenance-io/provenance/pull/1936).
+   * Msgfees module param migration [#1936](https://github.com/provenance-io/provenance/pull/1936).
-   - Name module param migration [#1937](https://github.com/provenance-io/provenance/pull/1937).
+   * Name module param migration [#1937](https://github.com/provenance-io/provenance/pull/1937).
-   - IbcHooks module param migration [#1939](https://github.com/provenance-io/provenance/pull/1939).
+   * IbcHooks module param migration [#1939](https://github.com/provenance-io/provenance/pull/1939).
- - Restore the hold module [#1930](https://github.com/provenance-io/provenance/pull/1930).
+ * Restore the hold module [#1930](https://github.com/provenance-io/provenance/pull/1930).
- - Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930).
+ * Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930).
- - Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930).
+ * Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930).
- - Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931).
+ * Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931).
- - Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943).
+ * Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943).
- - Clean up the marker module's expected BankKeeper interface [#1954](https://github.com/provenance-io/provenance/pull/1954).
+ * Clean up the marker module's expected BankKeeper interface [#1954](https://github.com/provenance-io/provenance/pull/1954).
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8584862 and 0453584.
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • x/marker/types/marker_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/marker/types/marker_test.go

iramiller
iramiller previously approved these changes May 7, 2024
@SpicyLemon SpicyLemon dismissed stale reviews from iramiller and Taztingo via 8375ef6 May 7, 2024 23:34
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 (2)
CHANGELOG.md (2)

Line range hint 79-321: Consistent list style is recommended.

- * Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
- * Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
- * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
- * Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
+ * Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
+ * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
+ * Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).

Line range hint 198-619: Avoid using bare URLs. Use markdown link syntax.

- https://github.com/provenance-io/provenance/issues/1772
+ [Issue #1772](https://github.com/provenance-io/provenance/issues/1772)
- https://github.com/provenance-io/provenance/issues/1760
+ [Issue #1760](https://github.com/provenance-io/provenance/issues/1760)
- https://github.com/provenance-io/provenance/pull/1922
+ [PR #1922](https://github.com/provenance-io/provenance/pull/1922)
- https://github.com/provenance-io/provenance/pull/1926
+ [PR #1926](https://github.com/provenance-io/provenance/pull/1926)
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0453584 and 8375ef6.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)

Taztingo
Taztingo previously approved these changes May 8, 2024
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 (27)
CHANGELOG.md (27)

Line range hint 80-325: Consistent list style is recommended.

- -
+ *

Line range hint 788-788: Remove extra blank lines.

-

Line range hint 1189-1189: Remove extra blank lines.

-

Line range hint 1206-1206: Remove extra blank lines.

-

Line range hint 1258-1258: Remove extra blank lines.

-

Line range hint 1362-1362: Remove extra blank lines.

-

Line range hint 199-199: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/199
+ [Issue #199](https://github.com/provenance-io/provenance/issues/199)

Line range hint 230-230: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/230
+ [Issue #230](https://github.com/provenance-io/provenance/issues/230)

Line range hint 329-329: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/329
+ [Issue #329](https://github.com/provenance-io/provenance/issues/329)

Line range hint 379-379: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/379
+ [Issue #379](https://github.com/provenance-io/provenance/issues/379)

Line range hint 391-391: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/391
+ [Issue #391](https://github.com/provenance-io/provenance/issues/391)

Line range hint 407-407: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/407
+ [Issue #407](https://github.com/provenance-io/provenance/issues/407)

Line range hint 478-478: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/478
+ [Issue #478](https://github.com/provenance-io/provenance/issues/478)

Line range hint 489-489: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/489
+ [Issue #489](https://github.com/provenance-io/provenance/issues/489)

Line range hint 497-497: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/497
+ [Issue #497](https://github.com/provenance-io/provenance/issues/497)

Line range hint 533-533: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/533
+ [Issue #533](https://github.com/provenance-io/provenance/issues/533)

Line range hint 558-558: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/558
+ [Issue #558](https://github.com/provenance-io/provenance/issues/558)

Line range hint 570-570: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/570
+ [Issue #570](https://github.com/provenance-io/provenance/issues/570)

Line range hint 616-616: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/616
+ [Issue #616](https://github.com/provenance-io/provenance/issues/616)

Line range hint 617-617: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/617
+ [Issue #617](https://github.com/provenance-io/provenance/issues/617)

Line range hint 618-618: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/618
+ [Issue #618](https://github.com/provenance-io/provenance/issues/618)

Line range hint 619-619: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/619
+ [Issue #619](https://github.com/provenance-io/provenance/issues/619)

Line range hint 620-620: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/620
+ [Issue #620](https://github.com/provenance-io/provenance/issues/620)

Line range hint 667-667: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/667
+ [Issue #667](https://github.com/provenance-io/provenance/issues/667)

Line range hint 708-708: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/708
+ [Issue #708](https://github.com/provenance-io/provenance/issues/708)

Line range hint 761-761: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/761
+ [Issue #761](https://github.com/provenance-io/provenance/issues/761)

Line range hint 874-874: Avoid using bare URLs. Provide a descriptive hyperlink text.

- https://github.com/provenance-io/provenance/issues/874
+ [Issue #874](https://github.com/provenance-io/provenance/issues/874)
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8375ef6 and 22833f4.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)

@SpicyLemon SpicyLemon merged commit 6b0c442 into main May 13, 2024
23 of 36 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/1760-marker-bank branch May 13, 2024 19:13
nullpointer0x00 pushed a commit that referenced this pull request May 15, 2024
* [1760]: Clean up the marker module's BankKeeper expected keeper.

* [1760]: For getAllMarkerHolders, use the bank keeper's DenomOwners query directly (instead of marker's Holding query) because the marker's Holding query fails if the marker doesn't exist, which we don't care about here.

* [1760]: Add changelog entry.
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.

4 participants