Skip to content

Commit

Permalink
Add failing address to multisig validation (cosmos#8518)
Browse files Browse the repository at this point in the history
* Add helper to multisig validation

* Added bech32 address output

* Fix test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Amaury M <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2021
1 parent ceeb2a0 commit e577378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/auth/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ func (s *IntegrationTestSuite) TestCLIMultisign() {

// Does not work in offline mode.
_, err = authtest.TxMultiSignExec(val1.ClientCtx, multisigInfo.GetName(), multiGeneratedTxFile.Name(), "--offline", sign1File.Name(), sign2File.Name())
s.Require().EqualError(err, "couldn't verify signature: unable to verify single signer signature")
s.Require().EqualError(err, fmt.Sprintf("couldn't verify signature for address %s", account1.GetAddress()))

val1.ClientCtx.Offline = false
multiSigWith2Signatures, err := authtest.TxMultiSignExec(val1.ClientCtx, multisigInfo.GetName(), multiGeneratedTxFile.Name(), sign1File.Name(), sign2File.Name())
Expand Down
3 changes: 2 additions & 1 deletion x/auth/client/cli/tx_multisign.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) {
for _, sig := range sigs {
err = signing.VerifySignature(sig.PubKey, signingData, sig.Data, txCfg.SignModeHandler(), txBuilder.GetTx())
if err != nil {
return fmt.Errorf("couldn't verify signature: %w", err)
addr, _ := sdk.AccAddressFromHex(sig.PubKey.Address().String())
return fmt.Errorf("couldn't verify signature for address %s", addr)
}

if err := multisig.AddSignatureV2(multisigSig, sig, multisigPub.GetPubKeys()); err != nil {
Expand Down

0 comments on commit e577378

Please sign in to comment.