mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-21 06:16:38 +00:00

* Fix liuqid notarization (#191) * Fix liuqid notarization - 2nd part (#193) * fixed missing unmarshaling * fixed message formatting issue * fixed config parsing issue (#194) * [util] Supply fees But only where we want to see the transaction succeed. The other ones we let in a broken state. * Added logger a logger struct to log with a TAG (#198) Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com> Signed-off-by: Julian Strobl <jmastr@mailbox.org> Co-authored-by: Jürgen Eckel <eckelj@users.noreply.github.com>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package cli
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"encoding/json"
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
"github.com/planetmint/planetmint-go/x/machine/types"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var _ = strconv.Itoa(0)
|
|
|
|
func CmdNotarizeLiquidAsset() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "notarize-liquid-asset [notarization]",
|
|
Short: "Broadcast message NotarizeLiquidAsset",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
|
argNotarization := new(types.LiquidAsset)
|
|
err = json.Unmarshal([]byte(args[0]), argNotarization)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
clientCtx, err := client.GetClientTxContext(cmd)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
msg := types.NewMsgNotarizeLiquidAsset(
|
|
clientCtx.GetFromAddress().String(),
|
|
argNotarization,
|
|
)
|
|
if err := msg.ValidateBasic(); err != nil {
|
|
return err
|
|
}
|
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
|
},
|
|
}
|
|
|
|
flags.AddTxFlagsToCmd(cmd)
|
|
|
|
return cmd
|
|
}
|