Add libwasm-version query command (#846)
* add vm-version query command * update command name
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
|||||||
flag "github.com/spf13/pflag"
|
flag "github.com/spf13/pflag"
|
||||||
|
|
||||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||||
|
wasmvmapi "github.com/CosmWasm/wasmvm/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetQueryCmd() *cobra.Command {
|
func GetQueryCmd() *cobra.Command {
|
||||||
@@ -35,10 +36,31 @@ func GetQueryCmd() *cobra.Command {
|
|||||||
GetCmdGetContractHistory(),
|
GetCmdGetContractHistory(),
|
||||||
GetCmdGetContractState(),
|
GetCmdGetContractState(),
|
||||||
GetCmdListPinnedCode(),
|
GetCmdListPinnedCode(),
|
||||||
|
GetCmdLibVersion(),
|
||||||
)
|
)
|
||||||
return queryCmd
|
return queryCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCmdLibVersion gets current libwasmvm version.
|
||||||
|
func GetCmdLibVersion() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "libwasmvm-version",
|
||||||
|
Short: "Get libwasmvm version",
|
||||||
|
Long: "Get libwasmvm version",
|
||||||
|
Aliases: []string{"lib-version"},
|
||||||
|
Args: cobra.ExactArgs(0),
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
version, err := wasmvmapi.LibwasmvmVersion()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error retrieving libwasmvm version: %w", err)
|
||||||
|
}
|
||||||
|
fmt.Println(version)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
// GetCmdListCode lists all wasm code uploaded
|
// GetCmdListCode lists all wasm code uploaded
|
||||||
func GetCmdListCode() *cobra.Command {
|
func GetCmdListCode() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
|
|||||||
Reference in New Issue
Block a user