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: fix spelling errors #1871

Closed
wants to merge 1 commit into from
Closed

chore: fix spelling errors #1871

wants to merge 1 commit into from

Conversation

github-prbot
Copy link
Contributor

@github-prbot github-prbot commented May 9, 2024

This PR fixes typos in the codebase.
Please review it, and merge if everything is fine.
If there are proto changes, run make proto-gen and commit the changes.

Summary by CodeRabbit

  • Refactor

    • Renamed the OptIn function to option across various modules for consistency.
  • Bug Fixes

    • Corrected a typo in the error message regarding consumer reward pool token denominations.
    • Fixed a comment typo related to consumer-key assignment in chain setup scenarios.

@github-prbot github-prbot requested a review from a team as a code owner May 9, 2024 12:03
Copy link
Contributor

coderabbitai bot commented May 9, 2024

Walkthrough

Walkthrough

The recent updates primarily involve renaming the OptIn function to option across various files in the codebase, affecting both function declarations and calls. Additionally, minor corrections were made to comments and error messages to enhance clarity and accuracy. These changes improve naming consistency without altering the core functionalities of the system.

Changes

File Path Change Summary
proto/.../tx.proto
x/ccv/provider/...
Renamed OptIn to option in RPC method and function declarations.
tests/e2e/...
tests/mbt/model/...
Updated function names from optIn to option, adjusted related calls and checks in models and test actions.
tests/integration/distribution.go Corrected a typo in an error message within a test function.
tests/e2e/steps_partial_set_security.go Fixed a typo in a comment related to setup process.

This table groups files with similar changes, focusing on renaming and typo corrections, providing a clear and concise overview of the modifications.


Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3328e9b and db41e30.
Files selected for processing (9)
  • proto/interchain_security/ccv/provider/v1/tx.proto (1 hunks)
  • tests/e2e/actions.go (5 hunks)
  • tests/e2e/steps_partial_set_security.go (1 hunks)
  • tests/e2e/test_driver.go (1 hunks)
  • tests/integration/distribution.go (1 hunks)
  • tests/mbt/model/ccv_pss.qnt (1 hunks)
  • tests/mbt/model/ccv_pss_model.qnt (2 hunks)
  • x/ccv/provider/handler.go (1 hunks)
  • x/ccv/provider/keeper/msg_server.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • tests/e2e/actions.go
  • tests/e2e/steps_partial_set_security.go
  • tests/integration/distribution.go
Additional Context Used
GitHub Check Runs (3)
tests failure (4)

x/ccv/provider/keeper/msg_server.go: [failure] 25-25:
cannot use &msgServer{…} (value of type *msgServer) as "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer value in return statement: *msgServer does not implement "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer (missing method OptIn)


x/ccv/provider/keeper/msg_server.go: [failure] 28-28:
cannot use msgServer{} (value of type msgServer) as "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer value in variable declaration: msgServer does not implement "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer (missing method OptIn)

test-integration failure (4)

x/ccv/provider/keeper/msg_server.go: [failure] 25-25:
cannot use &msgServer{…} (value of type *msgServer) as "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer value in return statement: *msgServer does not implement "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer (missing method OptIn)


x/ccv/provider/keeper/msg_server.go: [failure] 28-28:
cannot use msgServer{} (value of type msgServer) as "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer value in variable declaration: msgServer does not implement "github.com/cosmos/interchain-security/v4/x/ccv/provider/types".MsgServer (missing method OptIn)

break-check failure (3)

proto/interchain_security/ccv/provider/v1/tx.proto: [failure] 14-14:
Previously present RPC "OptIn" on service "Msg" was deleted.

Path-based Instructions (3)
x/ccv/provider/handler.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

tests/e2e/test_driver.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/e2e/*: "Assess the e2e test code assessing sufficient code coverage for the changes associated in the pull request"

x/ccv/provider/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (3)
tests/mbt/model/ccv_pss_model.qnt (1)

17-23: The renaming and trace kind update are consistent with the PR's objectives and maintain consistency in the model's trace information.

tests/e2e/test_driver.go (1)

142-142: The renaming of the method from optIn to option is consistent with the PR's objectives. Ensure e2e tests are thoroughly tested to confirm that functionality remains intact.

tests/mbt/model/ccv_pss.qnt (1)

82-82: The renaming of the function from OptIn to option is consistent with the PR's objectives and maintains consistency in the model's functionality.


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.

@github-actions github-actions bot added C:Testing Assigned automatically by the PR labeler C:x/provider Assigned automatically by the PR labeler labels May 9, 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: 4

@@ -27,7 +27,7 @@ func NewHandler(k *keeper.Keeper) sdk.Handler {
res, err := msgServer.SubmitConsumerDoubleVoting(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
case *types.MsgOptIn:
res, err := msgServer.OptIn(sdk.WrapSDKContext(ctx), msg)
res, err := msgServer.option(sdk.WrapSDKContext(ctx), msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider renaming option to a more descriptive name to avoid confusion with common programming keywords.

@@ -83,7 +83,7 @@ module ccv_pss_model {

val CanOptIn = {
not(
trace[length(trace)-1].kind == "OptIn"
trace[length(trace)-1].kind == "option"
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The verification process has revealed that the trace kind option is used only once in the file tests/mbt/model/ccv_pss_model.qnt. This suggests that the usage of this trace kind is not consistent across all relevant parts of the model, which could impact traceability and debugging clarity as noted in the review comment.

  • Location of the inconsistency: tests/mbt/model/ccv_pss_model.qnt
Analysis chain

Ensure that the trace kind option is consistently used across all relevant parts of the model to maintain traceability and debugging clarity.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify consistent use of the trace kind `option` in the model.

# Test: Search for the trace kind usage. Expect: Only occurrences of the trace kind `option`.
rg --type qnt $'trace.*kind == "option"'

Length of output: 69



Script:

#!/bin/bash
# Description: Re-verify consistent use of the trace kind `option` in the model by searching all files.

# Test: Search for the trace kind usage in all files. Expect: Only occurrences of the trace kind `option`.
rg 'trace.*kind == "option"'

Length of output: 116

rpc AssignConsumerKey(MsgAssignConsumerKey) returns (MsgAssignConsumerKeyResponse);
rpc SubmitConsumerMisbehaviour(MsgSubmitConsumerMisbehaviour) returns (MsgSubmitConsumerMisbehaviourResponse);
rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse);
rpc OptIn(MsgOptIn) returns (MsgOptInResponse);
rpc option(MsgOptIn) returns (MsgOptInResponse);
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider renaming the RPC method option to something more descriptive to avoid confusion with common programming keywords and potential issues in code generation.

@@ -137,7 +137,7 @@
return &types.MsgSubmitConsumerDoubleVotingResponse{}, nil
}

func (k msgServer) OptIn(goCtx context.Context, msg *types.MsgOptIn) (*types.MsgOptInResponse, error) {
func (k msgServer) option(goCtx context.Context, msg *types.MsgOptIn) (*types.MsgOptInResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider renaming option to a more descriptive name to avoid confusion with common programming keywords.

@MSalopek
Copy link
Contributor

MSalopek commented May 9, 2024

How do i get this bot to stop renaming optIn to option? 😄

Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

This is not an issue. OptIn is correct in this context.

@p-offtermatt
Copy link
Contributor

We have a PR, it is just missing an approval :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Testing Assigned automatically by the PR labeler C:x/provider Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants