Skip to content

Commit

Permalink
Fix comments and add multi contract system test
Browse files Browse the repository at this point in the history
  • Loading branch information
pinosu committed May 25, 2023
1 parent 435a9f7 commit ce088d9
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 819 deletions.
28 changes: 2 additions & 26 deletions cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"
"io"
"os"
"path/filepath"

banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

Expand Down Expand Up @@ -32,11 +31,11 @@ import (
"github.com/spf13/cast"
"github.com/spf13/cobra"
"github.com/spf13/viper"
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"

"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/app/params"
"github.com/CosmWasm/wasmd/x/wasm"
wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
Expand Down Expand Up @@ -159,7 +158,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
)

server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags)
extendUnsafeResetAllCmd(rootCmd)
wasmcli.ExtendUnsafeResetAllCmd(rootCmd)

// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
Expand Down Expand Up @@ -305,26 +304,3 @@ func appExport(

return wasmApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
}

// extendUnsafeResetAllCmd - also clear wasm dir
func extendUnsafeResetAllCmd(rootCmd *cobra.Command) {
unsafeResetCmd := tmcmd.ResetAllCmd.Use
for _, branchCmd := range rootCmd.Commands() {
if branchCmd.Use != "tendermint" {
continue
}
for _, cmd := range branchCmd.Commands() {
if cmd.Use == unsafeResetCmd {
serverRunE := cmd.RunE
cmd.RunE = func(cmd *cobra.Command, args []string) error {
if err := serverRunE(cmd, args); err != nil {
return nil
}
serverCtx := server.GetServerContextFromCmd(cmd)
return os.RemoveAll(filepath.Join(serverCtx.Config.RootDir, "wasm"))
}
return
}
}
}
}
8 changes: 0 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require (
github.com/cometbft/cometbft v0.37.1
github.com/cometbft/cometbft-db v0.7.0
github.com/spf13/viper v1.15.0
github.com/tendermint/tendermint v0.35.9
)

require (
Expand All @@ -59,7 +58,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
Expand Down Expand Up @@ -102,7 +100,6 @@ require (
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
Expand All @@ -124,7 +121,6 @@ require (
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
Expand All @@ -133,7 +129,6 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect
Expand All @@ -143,14 +138,12 @@ require (
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.27.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/tm-db v0.6.6 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.1 // indirect
Expand All @@ -161,7 +154,6 @@ require (
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
Expand Down
Loading

0 comments on commit ce088d9

Please sign in to comment.