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

refactor: Update GetSigners to return []string #9418

Merged
merged 20 commits into from
Jul 7, 2021
Merged

Conversation

atheeshp
Copy link
Contributor

Description

closes: #9239


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.
  • Code follows the module structure standards.
  • 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

@atheeshp atheeshp changed the title Update GetSigners to return []string refactor: Update GetSigners to return []string May 28, 2021
@github-actions github-actions bot added C:CLI C:x/genutil genutil module issues labels May 29, 2021
@codecov
Copy link

codecov bot commented May 29, 2021

Codecov Report

Merging #9418 (72c93f5) into master (bfa18c7) will decrease coverage by 0.07%.
The diff coverage is 36.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9418      +/-   ##
==========================================
- Coverage   63.54%   63.46%   -0.08%     
==========================================
  Files         570      571       +1     
  Lines       37474    37524      +50     
==========================================
+ Hits        23812    23815       +3     
- Misses      11803    11851      +48     
+ Partials     1859     1858       -1     
Impacted Files Coverage Δ
client/tx/tx.go 40.83% <0.00%> (ø)
server/mock/tx.go 61.53% <ø> (+3.84%) ⬆️
types/tx_msg.go 100.00% <ø> (ø)
x/auth/ante/basic.go 78.26% <ø> (ø)
x/auth/vesting/types/msgs.go 0.00% <0.00%> (ø)
x/authz/msgs.go 56.96% <0.00%> (+5.82%) ⬆️
x/distribution/client/cli/tx.go 3.97% <ø> (+0.08%) ⬆️
x/distribution/types/msg.go 55.76% <0.00%> (+8.22%) ⬆️
x/gov/client/cli/tx.go 18.24% <ø> (+0.39%) ⬆️
x/gov/types/msgs.go 51.00% <0.00%> (+1.96%) ⬆️
... and 12 more

types/tx_msg.go Outdated Show resolved Hide resolved
x/auth/ante/basic.go Outdated Show resolved Hide resolved
@atheeshp atheeshp requested a review from amaury1093 July 6, 2021 12:18
client/tx/tx.go Outdated
@@ -23,6 +23,23 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)

func ValidateMsg(msg sdk.Msg) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a godoc for ValidateMsg?

@@ -13,6 +13,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

txvalidate "github.com/cosmos/cosmos-sdk/client/tx"
Copy link
Contributor

@amaury1093 amaury1093 Jul 6, 2021

Choose a reason for hiding this comment

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

baseapp should not import anything from client, it creates messy code. Is there somewhere else we can put ValidateMsg?

Edit: Maybe types/tx?

Copy link
Contributor Author

@atheeshp atheeshp Jul 6, 2021

Choose a reason for hiding this comment

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

how about types/utils.go ?

Copy link
Contributor

@amaury1093 amaury1093 Jul 6, 2021

Choose a reason for hiding this comment

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

I believe we're moving away of putting anything in the types root package, it's too large already.

Edit: or put it in types/bech32, and call it bech32.ValidateMsgSigners

We can also create a new types/msg package. @robert-zaremba @aaronc @ryanchristo Do you have any opinions on this?

Copy link
Contributor Author

@atheeshp atheeshp Jul 6, 2021

Choose a reason for hiding this comment

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

or put it in types/bech32, and call it bech32.ValidateMsgSigners

I don't think it is fine to put it in types/bech32, since it is calling msg.ValidateBasic() inside. For now I kept it in the types/tx.

Copy link
Member

Choose a reason for hiding this comment

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

I would like to avoid adding these as new public functions if possible and that means we don't need to think about packages as much if they're private. Since we are deprecating global bech32's soon that will avoid another API breaking change.

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

thanks @atheeshp!

types/tx/types.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change sdk.Msg.GetSigners() return type to []string
5 participants