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

feat(uibc): ICS20 hooks gov switch #2459

Merged
merged 8 commits into from
Mar 16, 2024
Merged

Conversation

robert-zaremba
Copy link
Member

@robert-zaremba robert-zaremba commented Mar 14, 2024

Description

Summary by CodeRabbit

  • New Features
    • Introduced a feature to enable/disable ICS20 hooks support, enhancing the flexibility and control over ICS20 hooks.
  • Enhancements
    • Added a new message type and RPC for toggling ICS20 hooks.
    • Implemented new functionality for event emission related to ICS20 hooks.
  • Tests
    • Introduced a new utility function for error checking in tests.
    • Added comprehensive tests for the new message type MsgGovToggleICS20Hooks.

@robert-zaremba robert-zaremba requested a review from a team as a code owner March 14, 2024 18:23
Copy link
Contributor

coderabbitai bot commented Mar 14, 2024

Walkthrough

The recent updates introduce functionality to toggle ICS20 hooks in the Umee protocol, enhancing control over inter-blockchain communication. This is achieved through a new message type, EventICS20Hooks, and the addition of a corresponding boolean field in the protocol parameters. A specific RPC, GovToggleICS20Hooks, has been added for this purpose, along with necessary logic in message handling and parameter setting. Testing support for these changes is also included, ensuring reliability and ease of integration.

Changes

Files Change Summary
.../events.proto, .../quota.proto, .../tx.proto Added EventICS20Hooks message type, ics20_hooks field in Params, and GovToggleICS20Hooks RPC.
tests/tcheckers/error.go Introduced ErrorContains function for error message validation during testing.
x/uibc/msg.go, x/uibc/msg_test.go Added MsgGovToggleICS20Hooks entity with associated methods and testing utilities.
x/uibc/quota/..., x/uibc/quota/params.go Implemented GovToggleICS20Hooks logic, updated event emission, and added SetICS20HooksStatus function.

Poem

In the realm where code does leap,
A rabbit toiled, no time to sleep.
🌌 Across the chains, a bridge did grow,
🛠️ With hooks to toggle, to and fro.

"A toggle here, a check there," it said,
With every line, its wisdom spread.
🎉 "Now chains converse, with ease, with grace,"
A rabbit's touch, in digital space.

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-tests 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 tests 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 tests.
    • @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.
  • 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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@robert-zaremba robert-zaremba requested a review from gsk967 March 14, 2024 18:24
@robert-zaremba robert-zaremba added the skip-e2e-test Skip the e2e tests label Mar 14, 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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 45b1cae and d60785c.
Files ignored due to path filters (3)
  • x/uibc/events.pb.go is excluded by: !**/*.pb.go
  • x/uibc/quota.pb.go is excluded by: !**/*.pb.go
  • x/uibc/tx.pb.go is excluded by: !**/*.pb.go
Files selected for processing (8)
  • proto/umee/uibc/v1/events.proto (1 hunks)
  • proto/umee/uibc/v1/quota.proto (1 hunks)
  • proto/umee/uibc/v1/tx.proto (2 hunks)
  • tests/tcheckers/error.go (1 hunks)
  • x/uibc/msg.go (2 hunks)
  • x/uibc/msg_test.go (3 hunks)
  • x/uibc/quota/msg_server.go (1 hunks)
  • x/uibc/quota/params.go (1 hunks)
Check Runs (1)
buf-lint failure (4)
  • proto/umee/uibc/v1/tx.proto: 127-127: Message "MsgGovToggleICS20HooksResponse" should have a non-empty comment for documentation.
Additional comments: 8
tests/tcheckers/error.go (1)
  • 9-15: The ErrorContains utility function is well-implemented and follows best practices for error checking in tests. Good use of the gotest.tools/v3/assert package for assertions and thoughtful handling of both expected and unexpected errors.
proto/umee/uibc/v1/events.proto (1)
  • 23-26: The introduction of the EventICS20Hooks message type is well-defined and follows protobuf conventions. It appropriately uses a boolean field to represent the toggle state of ICS20 hooks.
x/uibc/quota/params.go (1)
  • 74-76: The SetICS20HooksStatus function is correctly implemented to update the Ics20Hooks status in the module's parameters. It follows the established pattern for parameter updates in the module.
x/uibc/quota/msg_server.go (1)
  • 66-86: The GovToggleICS20Hooks function is well-implemented, correctly handling authorization checks, updating the ICS20 hooks status, and emitting the appropriate event. It follows the established patterns for governance-related message handling in the module.
proto/umee/uibc/v1/quota.proto (1)
  • 51-52: The addition of the ics20_hooks boolean field to the Params message is correctly implemented, allowing for tracking the status of ICS20 hooks within the module's parameters.
x/uibc/msg.go (1)
  • 92-118: The MsgGovToggleICS20Hooks message type and its associated methods are correctly implemented, following the established patterns for message types in the module. The validation and signer extraction logic are appropriately handled.
x/uibc/msg_test.go (1)
  • 127-172: The refactoring of existing tests to use the tcheckers.ErrorContains utility and the addition of the TestMsgGovToggleICS20Hooks function are well-implemented. These changes improve the consistency and maintainability of the test suite, and the new test function adequately covers the validation logic of the MsgGovToggleICS20Hooks message type.
proto/umee/uibc/v1/tx.proto (1)
  • 24-25: The addition of the GovToggleICS20Hooks RPC is correctly implemented, enabling/disabling ICS20 hooks support through governance actions.

proto/umee/uibc/v1/tx.proto Outdated Show resolved Hide resolved
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 d60785c and e1e9f91.
Files ignored due to path filters (2)
  • swagger/swagger.yaml is excluded by: !**/*.yaml
  • x/uibc/tx.pb.go is excluded by: !**/*.pb.go
Files selected for processing (1)
  • proto/umee/uibc/v1/tx.proto (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • proto/umee/uibc/v1/tx.proto

@robert-zaremba robert-zaremba disabled auto-merge March 14, 2024 20:59
Copy link
Collaborator

@gsk967 gsk967 left a comment

Choose a reason for hiding this comment

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

utACK

@robert-zaremba robert-zaremba changed the title feat(uibc): ICS20 hooks gov switch DNM: feat(uibc): ICS20 hooks gov switch Mar 15, 2024
@robert-zaremba
Copy link
Member Author

let's hold on with the merge - we will merge it right after v6.4 release

@robert-zaremba robert-zaremba changed the title DNM: feat(uibc): ICS20 hooks gov switch feat(uibc): ICS20 hooks gov switch Mar 16, 2024
@robert-zaremba robert-zaremba added this pull request to the merge queue Mar 16, 2024
Merged via the queue into main with commit 54d9add Mar 16, 2024
32 of 41 checks passed
@robert-zaremba robert-zaremba deleted the robert/ics20-hooks-status branch March 16, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants