Skip to content

Commit

Permalink
Add wasm command to support v1 gov proposals (#1326)
Browse files Browse the repository at this point in the history
* Add wasm command to support v1 gov proposals

* fix lint issues

* fix comments

* Minor tweak and test files

---------

Co-authored-by: Alex Peters <[email protected]>
  • Loading branch information
pinosu and alpe authored Apr 21, 2023
1 parent e06c445 commit 52996db
Show file tree
Hide file tree
Showing 7 changed files with 1,086 additions and 2 deletions.
19 changes: 19 additions & 0 deletions contrib/local/04-gov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

echo "Compile with buildflag ''-X github.com/CosmWasm/wasmd/app.ProposalsEnabled=true' to enable gov"
sleep 1
echo "## Submit a CosmWasm gov proposal"
RESP=$(wasmd tx wasm submit-proposal store-instantiate "$DIR/../../x/wasm/keeper/testdata/reflect.wasm" \
'{}' --label="testing" \
--title "testing" --summary "Testing" --deposit "1000000000ustake" \
--admin $(wasmd keys show -a validator --keyring-backend=test) \
--amount 123ustake \
--keyring-backend=test \
--from validator --gas auto --gas-adjustment=1.5 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json)
echo $RESP
sleep 6
wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq

2 changes: 1 addition & 1 deletion contrib/local/setup_wasmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if ! wasmd keys show validator --keyring-backend=test; then
) | wasmd keys add validator --keyring-backend=test
fi
# hardcode the validator account for this instance
echo "$PASSWORD" | wasmd genesis add-genesis-account validator "1000000000$STAKE,1000000000$FEE" --keyring-backend=test
echo "$PASSWORD" | wasmd genesis add-genesis-account validator "1000000000000$STAKE,1000000000000$FEE" --keyring-backend=test
# (optionally) add a few more genesis accounts
for addr in "$@"; do
echo "$addr"
Expand Down
Loading

0 comments on commit 52996db

Please sign in to comment.