Add support for --prepare to store tx for multisig

This commit is contained in:
Ethan Frey
2017-07-19 13:22:53 +02:00
parent 29273e5656
commit e7da4c2d3a
5 changed files with 134 additions and 96 deletions
@@ -46,17 +46,19 @@ func counterTx(cmd *cobra.Command, args []string) error {
return err
}
// Sign if needed and post. This it the work-horse
bres, err := txcmd.SignAndPostTx(tx.Unwrap())
err = txcmd.SignTx(tx)
if err != nil {
return err
}
if err = txcmd.ValidateResult(bres); err != nil {
bres, err := txcmd.PrepareOrPostTx(tx)
if err != nil {
return err
}
// Output result
return txcmd.OutputTx(bres)
if bres == nil {
return nil // successful prep, nothing left to do
}
return txcmd.OutputTx(bres) // print response of the post
}
func readCounterTxFlags() (tx basecoin.Tx, err error) {