forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cosmos#346 from CosmWasm/genesis_contract_msg_326
Improve Contract initialization in genesis and tooling
- Loading branch information
Showing
25 changed files
with
2,219 additions
and
187 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,26 @@ | ||
package main | ||
|
||
import ( | ||
wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
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, | ||
} | ||
txCmd.AddCommand( | ||
wasmcli.GenesisStoreCodeCmd(defaultNodeHome), | ||
wasmcli.GenesisInstantiateContractCmd(defaultNodeHome), | ||
wasmcli.GenesisExecuteContractCmd(defaultNodeHome), | ||
wasmcli.GenesisListContractsCmd(defaultNodeHome), | ||
wasmcli.GenesisListCodesCmd(defaultNodeHome), | ||
) | ||
return txCmd | ||
|
||
} |
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,28 @@ | ||
#!/bin/bash | ||
set -o errexit -o nounset -o pipefail | ||
|
||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
BASE_ACCOUNT=$(wasmd keys show validator -a) | ||
|
||
echo "-----------------------" | ||
echo "## Genesis CosmWasm contract" | ||
wasmd add-wasm-genesis-message store "$DIR/../../x/wasm/internal/keeper/testdata/hackatom.wasm" --instantiate-everybody true --builder=foo/bar:latest --run-as validator | ||
|
||
echo "-----------------------" | ||
echo "## Genesis CosmWasm instance" | ||
INIT="{\"verifier\":\"$(wasmd keys show validator -a)\", \"beneficiary\":\"$(wasmd keys show fred -a)\"}" | ||
wasmd add-wasm-genesis-message instantiate-contract 1 "$INIT" --run-as validator --label=foobar --amount=100ustake --admin $BASE_ACCOUNT | ||
|
||
echo "-----------------------" | ||
echo "## Genesis CosmWasm execute" | ||
FIRST_CONTRACT_ADDR=wasm18vd8fpwxzck93qlwghaj6arh4p7c5n89k7fvsl | ||
MSG='{"release":{}}' | ||
wasmd add-wasm-genesis-message execute $FIRST_CONTRACT_ADDR "$MSG" --run-as validator --amount=1ustake | ||
|
||
echo "-----------------------" | ||
echo "## List Genesis CosmWasm codes" | ||
wasmd add-wasm-genesis-message list-codes | ||
|
||
echo "-----------------------" | ||
echo "## List Genesis CosmWasm contracts" | ||
wasmd add-wasm-genesis-message list-contracts |
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
Oops, something went wrong.