This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d3b447
commit 1f56d06
Showing
4 changed files
with
81 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/notional-labs/anone/app" | ||
"github.com/spf13/cobra" | ||
"github.com/tendermint/spm/cosmoscmd" | ||
|
||
"github.com/CosmWasm/wasmd/x/wasm" | ||
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 | ||
} | ||
|
||
func GetWasmCmdOptions() []cosmoscmd.Option { | ||
var options []cosmoscmd.Option | ||
|
||
options = append(options, | ||
cosmoscmd.CustomizeStartCmd(func(startCmd *cobra.Command) { | ||
wasm.AddModuleInitFlags(startCmd) | ||
}), | ||
cosmoscmd.AddSubCmd(AddGenesisWasmMsgCmd(app.DefaultNodeHome)), | ||
) | ||
|
||
return options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters