Skip to content

Commit

Permalink
Merge pull request #209 from CosmWasm/upgrade_to_launchpad
Browse files Browse the repository at this point in the history
Upgrade sdk to launchpad
  • Loading branch information
alpe authored Jul 21, 2020
2 parents 1f701b8 + 0a045ce commit 6e021d9
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 59 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func NewWasmApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest b
cdc := MakeCodec()

debug := viper.GetBool(cli.TraceFlag)
baseAppOptions = append(baseAppOptions, bam.SetDebug(debug))
baseAppOptions = append(baseAppOptions, bam.SetTrace(debug))

bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
Expand Down
7 changes: 5 additions & 2 deletions cmd/wasmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
if viper.GetBool(server.FlagInterBlockCache) {
cache = store.NewCommitKVStoreCacheManager()
}

pruningOpts, err := server.GetPruningOptionsFromFlags()
if err != nil {
panic(err)
}
skipUpgradeHeights := make(map[int64]bool)
for _, h := range viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) {
skipUpgradeHeights[int64(h)] = true
}

return app.NewWasmApp(logger, db, traceStore, true, invCheckPeriod,
wasm.DisableAllProposals, skipUpgradeHeights,
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),
Expand Down
6 changes: 3 additions & 3 deletions cmd/wasmd/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/store"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
cpm "github.com/otiai10/copy"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -93,7 +93,7 @@ func replayTxs(rootDir string) error {
gapp := app.NewWasmApp(
// TODO: do we want to set skipUpgradeHieghts here?
ctx.Logger, appDB, traceStoreWriter, true, uint(1), wasm.DisableAllProposals, nil,
baseapp.SetPruning(store.PruneEverything))
baseapp.SetPruning(storetypes.PruneEverything))

// Genesis
var genDocPath = filepath.Join(configDir, "genesis.json")
Expand Down Expand Up @@ -176,7 +176,7 @@ func replayTxs(rootDir string) error {

t2 := time.Now()

state, err = blockExec.ApplyBlock(state, blockmeta.BlockID, block)
state, _, err = blockExec.ApplyBlock(state, blockmeta.BlockID, block)
if err != nil {
return err
}
Expand Down
7 changes: 5 additions & 2 deletions cmd/wasmgovd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,18 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
if viper.GetBool(server.FlagInterBlockCache) {
cache = store.NewCommitKVStoreCacheManager()
}

pruningOpts, err := server.GetPruningOptionsFromFlags()
if err != nil {
panic(err)
}
skipUpgradeHeights := make(map[int64]bool)
for _, h := range viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) {
skipUpgradeHeights[int64(h)] = true
}

return app.NewWasmApp(logger, db, traceStore, true, invCheckPeriod,
wasm.EnableAllProposals, skipUpgradeHeights,
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),
Expand Down
6 changes: 3 additions & 3 deletions cmd/wasmgovd/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/store"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
cpm "github.com/otiai10/copy"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -93,7 +93,7 @@ func replayTxs(rootDir string) error {
gapp := app.NewWasmApp(
// TODO: do we want to set skipUpgradeHieghts here?
ctx.Logger, appDB, traceStoreWriter, true, uint(1), wasm.EnableAllProposals, nil,
baseapp.SetPruning(store.PruneEverything))
baseapp.SetPruning(storetypes.PruneEverything))

// Genesis
var genDocPath = filepath.Join(configDir, "genesis.json")
Expand Down Expand Up @@ -176,7 +176,7 @@ func replayTxs(rootDir string) error {

t2 := time.Now()

state, err = blockExec.ApplyBlock(state, blockmeta.BlockID, block)
state, _, err = blockExec.ApplyBlock(state, blockmeta.BlockID, block)
if err != nil {
return err
}
Expand Down
18 changes: 6 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ go 1.13
require (
// Note: update ENV GO_COSMWASM in Dockerfile when updating this
github.com/CosmWasm/go-cosmwasm v0.9.1
github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a // indirect
github.com/cosmos/cosmos-sdk v0.38.3
github.com/cosmos/cosmos-sdk v0.39.0
github.com/golang/mock v1.4.3 // indirect
github.com/google/gofuzz v1.0.0
github.com/gorilla/mux v1.7.4
Expand All @@ -15,23 +14,18 @@ require (
github.com/otiai10/copy v1.0.2
github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962 // indirect
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.6
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.5.1
github.com/spf13/viper v1.6.3
github.com/stretchr/testify v1.6.1
github.com/tendermint/go-amino v0.15.1
github.com/tendermint/tendermint v0.33.3
github.com/tendermint/tendermint v0.33.6
github.com/tendermint/tm-db v0.5.1
go.etcd.io/bbolt v1.3.4 // indirect
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v2 v2.3.0
)

replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4

// this include a few extra debug helpers on top of cosmos v0.38.3 but original also works fine
replace github.com/cosmos/cosmos-sdk => github.com/confio/cosmos-sdk v0.38.7
Loading

0 comments on commit 6e021d9

Please sign in to comment.