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(client/keys): check multisig key duplicate #18703

Merged
merged 8 commits into from
Dec 13, 2023

Conversation

levisyin
Copy link
Contributor

Description

This pr added a support for checking <appd> keys multisig keys duplicate.

  • <appd> keys add
  • <appd> keys show

And btw, add simapp/simd/simd to .gitignore

@levisyin levisyin requested a review from a team as a code owner December 12, 2023 05:48
Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

The recent updates include enhancements to the client/keys module to prevent duplicate keys in multisig configurations, improvements to genesis validation in the x/gov module, and a shift from panicking to error handling in the x/bank, x/distribution, and x/slashing modules. These changes aim to improve the robustness and reliability of the codebase by ensuring better error management and validation processes.

Changes

File(s) Summary
.gitignore Added entry to ignore the "simapp/simd/simd" directory.
client/keys/add.go, client/keys/show.go Modified logic to use a keyFilter map for checking duplicate keys and updated variable naming.
client/keys/add_test.go Added Test_runAddCmdMultisig function to test multisig key addition and error handling for duplicates.
CHANGELOG.md Documented enhancements to client/keys module, genesis validation in x/gov, and error handling improvements in x/bank, x/distribution, and x/slashing.

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

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

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

For keys add it makes sense for keys show not so sure. If people rely on this weird behavior, then 0.51 won't work for them anymore.

@levisyin
Copy link
Contributor Author

For keys add it makes sense for keys show not so sure. If people rely on this weird behavior they 0.51 won't work for them anymore.

What about showing warning message instead of return error(break the process)?

@julienrbrt
Copy link
Member

For keys add it makes sense for keys show not so sure. If people rely on this weird behavior they 0.51 won't work for them anymore.

What about showing warning message instead of return error(break the process)?

Yes, I think it's better for show to do it that way!

CHANGELOG.md Outdated Show resolved Hide resolved
levisyin and others added 3 commits December 12, 2023 18:31
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Collaborator

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

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

Nice work, and thank you @levisyin! Mostly LGTM, but just some suggestions like tightening up the tests.

client/keys/add.go Outdated Show resolved Hide resolved
client/keys/add.go Outdated Show resolved Hide resolved
client/keys/add_test.go Outdated Show resolved Hide resolved
client/keys/show.go Outdated Show resolved Hide resolved
client/keys/show.go Outdated Show resolved Hide resolved
client/keys/show.go Show resolved Hide resolved
client/keys/show_test.go Show resolved Hide resolved
client/keys/show.go Outdated Show resolved Hide resolved
client/keys/show_test.go Show resolved Hide resolved
client/keys/add.go Show resolved Hide resolved
@levisyin levisyin requested a review from odeke-em December 13, 2023 01:32
Copy link
Collaborator

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @levisyin!

@levisyin levisyin requested a review from julienrbrt December 13, 2023 02:14
Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

utACK!

@julienrbrt julienrbrt added this pull request to the merge queue Dec 13, 2023
Merged via the queue into cosmos:main with commit f876b14 Dec 13, 2023
54 of 57 checks passed
@levisyin levisyin deleted the feat/check-duplicate-key branch December 13, 2023 08:30
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.

5 participants