Skip to content

Commit e23c0ce

Browse files
mergify[bot]Alessio Treglia
and
Alessio Treglia
authored
add --output-document to multisign-batch (#8873) (#8877)
Closes: #8870 Co-authored-by: SaReN <[email protected]> (cherry picked from commit 5f71e93) Co-authored-by: Alessio Treglia <[email protected]>
1 parent 1d98b2a commit e23c0ce

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

x/auth/client/cli/tx_multisign.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ The SIGN_MODE_DIRECT sign mode is not supported.'
215215
flagMultisig, "",
216216
"Address of the multisig account that the transaction signs on behalf of",
217217
)
218+
cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT")
218219
flags.AddTxFlagsToCmd(cmd)
219220

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

279+
// prepare output document
280+
closeFunc, err := setOutputFile(cmd)
281+
if err != nil {
282+
return err
283+
}
284+
285+
defer closeFunc()
286+
clientCtx.WithOutput(cmd.OutOrStdout())
287+
278288
for i := 0; scanner.Scan(); i++ {
279289
txBldr, err := txCfg.WrapTxBuilder(scanner.Tx())
280290
if err != nil {
@@ -348,7 +358,7 @@ func makeBatchMultisignCmd() func(cmd *cobra.Command, args []string) error {
348358
txFactory = txFactory.WithSequence(sequence)
349359
}
350360

351-
return nil
361+
return scanner.UnmarshalErr()
352362
}
353363
}
354364

x/auth/client/cli/tx_sign.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error {
137137
return err
138138
}
139139

140-
return scanner.Err()
140+
return scanner.UnmarshalErr()
141141
}
142142
}
143143

0 commit comments

Comments
 (0)