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 Msgs and Codecs. #1957

Merged
merged 43 commits into from
May 13, 2024
Merged

Clean up Msgs and Codecs. #1957

merged 43 commits into from
May 13, 2024

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented Apr 26, 2024

Description

This PR does the following:

  • Adds unit tests ensuring the new signer stuff works for all our Msgs.
  • Fixes the signers of a few Msgs.
  • Removes all the GetSigners methods as well as some other ones previously needed by the Msg interface.
  • Standardizes and cleans up all the codec.go files.
  • Removes all the ModuleCdc variables.
  • Uses the same options on the Coins proto fields that the SDK does.
  • Switch to auto-generated String and Equal methods for most proto messages.

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

…AllRequestMsgs list used to, at the very least, register all the msg interfaces.
… the expected panic in case it's being wrapped with other info.
…gEmitIBCAck that was missing a signers option.
…uest that had the wrong signer option in the proto.
Copy link
Contributor

coderabbitai bot commented Apr 26, 2024

Important

Auto Review Skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

52 files out of 111 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

… back to sdk.AccAddress variables since they're now being returned as []byte, but we want them treated as AccAddresses everywhere in there. Specifically, the error message isn't right when they are just []byte.
…ion, and switch them to an auto-generated version.
…ses in better ways. Specifically, %v will now output the bech32 string so that the other .String() methods have the bech32 there instead of the hex bytes.
@SpicyLemon SpicyLemon changed the title Remove GetSigners methods. Clean up Msgs and Codecs. May 7, 2024
@SpicyLemon SpicyLemon marked this pull request as ready for review May 7, 2024 23:34
@SpicyLemon SpicyLemon requested a review from a team as a code owner May 7, 2024 23:34
@SpicyLemon SpicyLemon enabled auto-merge (squash) May 10, 2024 01:15
@SpicyLemon SpicyLemon merged commit 5e61431 into main May 13, 2024
25 of 37 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/1760-get-signers branch May 13, 2024 18:52
nullpointer0x00 pushed a commit that referenced this pull request May 15, 2024
* [1760]: Rename all the msg.go files (and their relatives) to msgs.go.

* [1760]: Standardize all the msg and codec definition to use a public AllRequestMsgs list used to, at the very least, register all the msg interfaces.

* [1760]: Create RunGetSignersTests to standardize checking signers-related stuff for all our msgs.

* [1760]: Switch the exchange GetSigners test over to the new RunGetSignersTests helper.

* [1760]: Switch the metadata GetSigners test over to the new RunGetSignersTests helper.

* [1760]: For the legacy test runner, just make sure the panic contains the expected panic in case it's being wrapped with other info.

* [1760]: Add GetSigners tests to the attribute module.

* [1760]: Streamline the exchange GetSigners maker definitions.

* [1760]: Change ExpPanic fields to ExpInErr since the new stuff isn't supposed to panic like the old stuff.

* [1760]: Add a GetSigners tests to the ibchooks module, and fix the MsgEmitIBCAck that was missing a signers option.

* [1760]: Add GetSigners tests to the ibcratelimit module.

* [1760]: GetSigners Tests on all the marker Msgs, and fix MsgCancelRequest that had the wrong signer option in the proto.

* [1760]: Switch to RunGetSignersTests in the msgfees module.

* [1760]: Switch to RunGetSignersTests in the name module.

* [1760]: Switch to RunGetSignersTests in the oracle module.

* [1760]: Switch to RunGetSignersTests for the quarantine module.

* [1760]: Switch to RunGetSignersTests for the sanction module.

* [1760]: Switch to RunGetSignersTests for the trigger module.

* [1760]: Get rid of most of the GetSigners methods (the ones that weren't called directly).

* [1760]: Remove the marker module's GetSigners methods, and update the handful of places where those were being called directly.

* [1760]: Remove the GetSigners() methods from the metadata module.

* [1760]: Get rid of some ibchooks msg methods that used to be required for sdk.Msg, but aren't anymore.

* [1760]: Reorder the stuff in marker/types/msgs.go to match the order they're in in the proto.

* [1760]: Reorder the stuff in names msgs.go to match the proto ordering.

* [1760]: Reorganize the metadata msgs.go stuff.

* [1760]: Clean up the attribute and ibchooks protos a little.

* [1760]: Get rid of most of the yaml tags from the protos. Only ones left are ones that rename a field.

* [1760]: Remove the rest of the uses of gogoproto.moretags.

* [1760]: Clean up some unneeded gogoproto.goproto_stringer options from the protos.

* [1760]: Update all the Coins fields in the protos to match the same options the sdk uses.

* [1760]: Remove all uses of any ModuleCdc variables, and delete them all.

* [1760]: In GetFeePayerUsingFeeGrant, cast the feePayer and feeGranter back to sdk.AccAddress variables since they're now being returned as []byte, but we want them treated as AccAddresses everywhere in there. Specifically, the error message isn't right when they are just []byte.

* [1760]: Get rid of all the String() methods that just do yaml conversion, and switch them to an auto-generated version.

* [1760]: Refactor the MetadataAddress.Format method to handle more casses in better ways. Specifically, %v will now output the bech32 string so that the other .String() methods have the bech32 there instead of the hex bytes.

* [1760]: Remove a private unused function: stringsToAccAddresses

* [1760]: Switch to sigs.k8s.io/yaml (from gopkg.in/yaml.v2) in the last remaining place.

* [1760]: Move DefineCustomGetSigners to the top of the file.

* [1760]: Add changelog entries.

* [1760]: Move now-indirect require of gopkg.in/yaml.v2 to the indirect section.

* [1760]: Tweak the MetadataAddress.Format method: add some comments and remove the p and T cases which never get actually used.
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.

3 participants