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

fix(cli): Allow max 1 DIRECT signer per tx #10683

Merged
merged 10 commits into from
Dec 6, 2021
Merged

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Dec 6, 2021

Description

Be slightly less strict in a multi-signer TX:

  • BEFORE: we don't allow any signer to be DIRECT
  • AFTER: we allow 1 signer maximum to be DIRECT

Note: this only changes behavior in the CLI. In the antehandlers, we always allow any number of signers to be DIRECT.

This PR is to allow using transaction tips in the CLI.


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 the C:CLI label Dec 6, 2021
var prevSignatures []signing.SignatureV2
if !overwriteSig {
prevSignatures, err = txBuilder.GetTx().GetSignaturesV2()
if err != nil {
return err
}
}
if err := txBuilder.SetSignatures(sig); err != nil {
// Overwrite or append signer infos.
Copy link
Contributor Author

@amaury1093 amaury1093 Dec 6, 2021

Choose a reason for hiding this comment

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

the old behavior was always overwriting signer info.

Now with the new behavior, when overwriteSig == false, we append signer infos.

client/tx/tx_test.go Outdated Show resolved Hide resolved
client/tx/tx.go Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
@amaury1093 amaury1093 merged commit 1d43663 into master Dec 6, 2021
@amaury1093 amaury1093 deleted the am/fix-check-signers branch December 6, 2021 18:45
blewater pushed a commit to e-money/cosmos-sdk that referenced this pull request Dec 8, 2021
* fix(cli): Allow max 1 DIRECT signer per tx

* Use sdkerrors

* Update client/tx/tx_test.go

* add more test

* cl

* Fix test

* Update x/auth/client/testutil/suite.go

* Address nits
@amaury1093 amaury1093 mentioned this pull request May 23, 2022
72 tasks
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.

3 participants