From 6954d83902ee9f44be5d98823a33b7cde4d10162 Mon Sep 17 00:00:00 2001 From: Philip Su Date: Wed, 29 Mar 2023 13:39:39 -0700 Subject: [PATCH] Add add-wasm-genesis-message to seid --- cmd/seid/cmd/genwasm.go | 27 +++++++++++++++++++++++++++ cmd/seid/cmd/root.go | 1 + 2 files changed, 28 insertions(+) create mode 100644 cmd/seid/cmd/genwasm.go diff --git a/cmd/seid/cmd/genwasm.go b/cmd/seid/cmd/genwasm.go new file mode 100644 index 0000000000..ee58db9ef3 --- /dev/null +++ b/cmd/seid/cmd/genwasm.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + + wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli" +) + +func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command { + txCmd := &cobra.Command{ + Use: "add-wasm-genesis-message", + Short: "Wasm genesis subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + genesisIO := wasmcli.NewDefaultGenesisIO() + txCmd.AddCommand( + wasmcli.GenesisStoreCodeCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisInstantiateContractCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisExecuteContractCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisListContractsCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO), + ) + return txCmd +} diff --git a/cmd/seid/cmd/root.go b/cmd/seid/cmd/root.go index 3bcf664386..6ba2d03c15 100644 --- a/cmd/seid/cmd/root.go +++ b/cmd/seid/cmd/root.go @@ -128,6 +128,7 @@ func initRootCmd( ), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), + AddGenesisWasmMsgCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), debugCmd, config.Cmd(),