From b4ac0bc82b3cdf3c6b7c0f24cd5739eb7f245ae8 Mon Sep 17 00:00:00 2001 From: Arnaud Mimart <33665250+amimart@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:51:21 +0200 Subject: [PATCH] feat: implement genesis wasm cmd --- cmd/okp4d/genwasm.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cmd/okp4d/genwasm.go diff --git a/cmd/okp4d/genwasm.go b/cmd/okp4d/genwasm.go new file mode 100644 index 00000000..fba3d503 --- /dev/null +++ b/cmd/okp4d/genwasm.go @@ -0,0 +1,27 @@ +package main + +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 +}