Skip to content

Commit

Permalink
add --output-document to multisign-batch (#8873) (#8877)
Browse files Browse the repository at this point in the history
Closes: #8870

Co-authored-by: SaReN <sahithnarahari@gmail.com>
(cherry picked from commit 5f71e93)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
  • Loading branch information
mergify[bot] and Alessio Treglia authored Mar 15, 2021
1 parent 1d98b2a commit e23c0ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion x/auth/client/cli/tx_multisign.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ The SIGN_MODE_DIRECT sign mode is not supported.'
flagMultisig, "",
"Address of the multisig account that the transaction signs on behalf of",
)
cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT")
flags.AddTxFlagsToCmd(cmd)

return cmd
Expand Down Expand Up @@ -275,6 +276,15 @@ func makeBatchMultisignCmd() func(cmd *cobra.Command, args []string) error {
txFactory = txFactory.WithAccountNumber(accnum).WithSequence(seq)
}

// prepare output document
closeFunc, err := setOutputFile(cmd)
if err != nil {
return err
}

defer closeFunc()
clientCtx.WithOutput(cmd.OutOrStdout())

for i := 0; scanner.Scan(); i++ {
txBldr, err := txCfg.WrapTxBuilder(scanner.Tx())
if err != nil {
Expand Down Expand Up @@ -348,7 +358,7 @@ func makeBatchMultisignCmd() func(cmd *cobra.Command, args []string) error {
txFactory = txFactory.WithSequence(sequence)
}

return nil
return scanner.UnmarshalErr()
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/auth/client/cli/tx_sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error {
return err
}

return scanner.Err()
return scanner.UnmarshalErr()
}
}

Expand Down

0 comments on commit e23c0ce

Please sign in to comment.