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: add proto annotation #1185

Merged
merged 11 commits into from
Jul 3, 2023
Merged

chore: add proto annotation #1185

merged 11 commits into from
Jul 3, 2023

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Jun 26, 2023

Description

This PR adds useful proto annotation for upcoming feature cosmos/cosmos-sdk#13310, which supports the auto command line tool generation.

  • cosmos.AddressString
  • cosmos.msg.v1.signer
  • amino.name
  • cosmos.msg.v1.service
  • amino.dont_omit_empty
  • amino.encoding

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module x/relationships labels Jun 26, 2023
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (6a228c0) 80.80% compared to head (e28c67f) 80.80%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1185   +/-   ##
=======================================
  Coverage   80.80%   80.80%           
=======================================
  Files         194      194           
  Lines       17310    17310           
=======================================
  Hits        13987    13987           
  Misses       2727     2727           
  Partials      596      596           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions github-actions bot added the x/CLI label Jun 27, 2023
@dadamu dadamu marked this pull request as ready for review June 30, 2023 08:25
@dadamu dadamu requested a review from a team as a code owner June 30, 2023 08:25
@@ -22,15 +24,23 @@ message Subspace {
// Optional description of this subspace
string description = 3 [ (gogoproto.moretags) = "yaml:\"description\"" ];

// Represents the account that is associated with the subspace and
// should be used to connect external applications to verify this subspace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove it since now no one can use treasury account to sign anything

@dadamu dadamu marked this pull request as draft June 30, 2023 11:03
@dadamu dadamu force-pushed the paul/add-proto-annotation branch from a2730bb to 3a40908 Compare July 3, 2023 10:48
repeated UserAnswer user_answers = 6 [ (gogoproto.nullable) = false ];
Params params = 7 [ (gogoproto.nullable) = false ];
repeated PostOwnerTransferRequest post_owner_transfer_requests = 8 [ (gogoproto.nullable) = false ];
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cosmos-SDK adds amino annotation inside genesis files as well.
https://github.com/cosmos/cosmos-sdk/blob/ab77fe20d3c00ef4cb73dfd0c803c4593a3c8233/proto/cosmos/bank/v1beta1/genesis.proto#L15

But, I think genesis is not needed to support Amino. What do you think? @RiccardoM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it should not be added to the genesis file. However, we can keep it for now as it's only metadata that does not truly affect anything to be honest.

Comment on lines +78 to +79
repeated Post posts = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As above.

@RiccardoM
Copy link
Contributor

@dadamu Is this PR ready to be reviewed? If so can you mark it as such instead of Draft?

@dadamu dadamu marked this pull request as ready for review July 3, 2023 14:34
@dadamu
Copy link
Contributor Author

dadamu commented Jul 3, 2023

@RiccardoM Yes, it is ready to review. Turned it.

Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

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

Great job! 🙏

@RiccardoM RiccardoM merged commit 9788688 into master Jul 3, 2023
35 checks passed
@RiccardoM RiccardoM deleted the paul/add-proto-annotation branch July 3, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants