diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index b69af2d15154..cd5c687eac6b 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -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 @@ -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 { @@ -348,7 +358,7 @@ func makeBatchMultisignCmd() func(cmd *cobra.Command, args []string) error { txFactory = txFactory.WithSequence(sequence) } - return nil + return scanner.UnmarshalErr() } } diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index 955554512125..f814f9b99a41 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -137,7 +137,7 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { return err } - return scanner.Err() + return scanner.UnmarshalErr() } }