From c8f81febc74622397ffb2b2a4e103ef28511bb92 Mon Sep 17 00:00:00 2001 From: Christophe Camel Date: Tue, 1 Mar 2022 15:46:06 +0100 Subject: [PATCH] fix: fix missing `id` in message --- x/knowledge/client/cli/tx_bang_dataspace.go | 12 +++++++----- x/knowledge/types/message_bang_dataspace.go | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/x/knowledge/client/cli/tx_bang_dataspace.go b/x/knowledge/client/cli/tx_bang_dataspace.go index a3f2f3a5..1f819a1b 100644 --- a/x/knowledge/client/cli/tx_bang_dataspace.go +++ b/x/knowledge/client/cli/tx_bang_dataspace.go @@ -14,12 +14,13 @@ var _ = strconv.Itoa(0) func CmdBangDataspace() *cobra.Command { cmd := &cobra.Command{ - Use: "bang-dataspace [name] [description]", - Short: "Broadcast message bang-dataspace", - Args: cobra.ExactArgs(2), + Use: "bang-dataspace [id] [name] [description]", + Short: "Create a new dataspace given its identifier (unique), name and description.", + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) (err error) { - argName := args[0] - argDescription := args[1] + argID := args[0] + argName := args[1] + argDescription := args[2] clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -28,6 +29,7 @@ func CmdBangDataspace() *cobra.Command { msg := types.NewMsgBangDataspace( clientCtx.GetFromAddress().String(), + argID, argName, argDescription, ) diff --git a/x/knowledge/types/message_bang_dataspace.go b/x/knowledge/types/message_bang_dataspace.go index c9e8738a..fe637dc3 100644 --- a/x/knowledge/types/message_bang_dataspace.go +++ b/x/knowledge/types/message_bang_dataspace.go @@ -9,9 +9,10 @@ const TypeMsgBangDataspace = "bang_dataspace" var _ sdk.Msg = &MsgBangDataspace{} -func NewMsgBangDataspace(creator string, name string, description string) *MsgBangDataspace { +func NewMsgBangDataspace(creator string, id string, name string, description string) *MsgBangDataspace { return &MsgBangDataspace{ Creator: creator, + Id: id, Name: name, Description: description, }