Skip to content

Commit

Permalink
Merge branch 'minh/v3' into strath/fix-tests-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole authored May 7, 2024
2 parents 60b28d6 + ca067e4 commit e8c0c89
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 25 deletions.
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import (
customauthtx "github.com/classic-terra/core/v3/custom/auth/tx"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

// unnamed import of statik for swagger UI support
_ "github.com/classic-terra/core/v3/client/docs/statik"
Expand Down Expand Up @@ -122,7 +123,7 @@ func init() {
func NewTerraApp(
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
homePath string, encodingConfig terraappparams.EncodingConfig, appOpts servertypes.AppOptions,
wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp),
wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp),
) *TerraApp {
appCodec := encodingConfig.Marshaler
legacyAmino := encodingConfig.Amino
Expand Down
3 changes: 2 additions & 1 deletion app/keepers/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7"
)
Expand Down Expand Up @@ -72,7 +73,7 @@ func (appKeepers *AppKeepers) newIBCRouter() *porttypes.Router {
ibcRouter := porttypes.NewRouter()
ibcRouter.
AddRoute(ibctransfertypes.ModuleName, transferHookFeeStack).
AddRoute(wasm.ModuleName, wasmStack).
AddRoute(wasmtypes.ModuleName, wasmStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)

Expand Down
3 changes: 1 addition & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
terraapp "github.com/classic-terra/core/v3/app"
helpers "github.com/classic-terra/core/v3/app/testing"
Expand Down Expand Up @@ -136,7 +135,7 @@ func TestAppStateDeterminism(t *testing.T) {
}

db := dbm.NewMemDB()
var emptyWasmOpts []wasm.Option
var emptyWasmOpts []wasmkeeper.Option
app := terraapp.NewTerraApp(
logger, db, nil, true, map[int64]bool{}, terraapp.DefaultNodeHome,
terraapp.MakeEncodingConfig(),
Expand Down
4 changes: 2 additions & 2 deletions app/testing/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/classic-terra/core/v3/app"
appparams "github.com/classic-terra/core/v3/app/params"
Expand Down Expand Up @@ -43,7 +43,7 @@ const (
SimAppChainID = ""
)

var emptyWasmOpts []wasm.Option
var emptyWasmOpts []wasmkeeper.Option

// EmptyBaseAppOptions is a stub implementing AppOptions
type EmptyBaseAppOptions struct{}
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades/v8/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

func CreateV8UpgradeHandler(
Expand Down Expand Up @@ -60,6 +61,10 @@ func CreateV8UpgradeHandler(

legacyBaseAppSubspace := keepers.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
baseapp.MigrateParams(ctx, legacyBaseAppSubspace, &keepers.ConsensusParamsKeeper)

params := keepers.IBCKeeper.ClientKeeper.GetParams(ctx)
params.AllowedClients = append(params.AllowedClients, exported.Localhost)
keepers.IBCKeeper.ClientKeeper.SetParams(ctx, params)
return mm.RunMigrations(ctx, cfg, fromVM)
}
}
7 changes: 3 additions & 4 deletions cmd/terrad/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
core "github.com/classic-terra/core/v3/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)

// NewRootCmd creates a new root command for terrad. It is called once in the
Expand All @@ -58,7 +58,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
sdkConfig.SetBech32PrefixForAccount(core.Bech32PrefixAccAddr, core.Bech32PrefixAccPub)
sdkConfig.SetBech32PrefixForValidator(core.Bech32PrefixValAddr, core.Bech32PrefixValPub)
sdkConfig.SetBech32PrefixForConsensusNode(core.Bech32PrefixConsAddr, core.Bech32PrefixConsPub)
sdkConfig.SetAddressVerifier(wasmtypes.VerifyAddressLen())
sdkConfig.Seal()

initClientCtx := client.Context{}.
Expand Down Expand Up @@ -261,7 +260,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
)

// TODO: We want to parse legacy wasm options from app.toml in [wasm] section here or not?
var wasmOpts []wasm.Option
var wasmOpts []wasmkeeper.Option

return terraapp.NewTerraApp(
logger, db, traceStore, true, skipUpgradeHeights,
Expand Down Expand Up @@ -290,7 +289,7 @@ func (a appCreator) appExport(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
appOpts servertypes.AppOptions, modulesToExport []string,
) (servertypes.ExportedApp, error) {
var wasmOpts []wasm.Option
var wasmOpts []wasmkeeper.Option
homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" {
return servertypes.ExportedApp{}, errors.New("application home not set")
Expand Down
4 changes: 2 additions & 2 deletions custom/auth/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
terraapp "github.com/classic-terra/core/v3/app"
treasurytypes "github.com/classic-terra/core/v3/x/treasury/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)

// AnteTestSuite is a test suite to be used with ante handler tests.
Expand All @@ -41,7 +41,7 @@ type AnteTestSuite struct {
// returns context and app with params set on account keeper
func createTestApp(isCheckTx bool, tempDir string) (*terraapp.TerraApp, sdk.Context) {
// TODO: we need to feed in custom binding here?
var wasmOpts []wasm.Option
var wasmOpts []wasmkeeper.Option
app := terraapp.NewTerraApp(
log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{},
tempDir, terraapp.MakeEncodingConfig(),
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ replace (
)

replace (
github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.45.0-classic
github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.45.0-terra1
// use cometbft
github.com/cometbft/cometbft => github.com/classic-terra/cometbft v0.37.4-classic
github.com/cometbft/cometbft => github.com/classic-terra/cometbft v0.37.4-terra1
github.com/cometbft/cometbft-db => github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.47.10-classic
github.com/cosmos/ibc-go/v7 => github.com/classic-terra/ibc-go/v7 v7.0.0-20240419072319-aa9d74dc39ae
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.47.10-terra
github.com/cosmos/ibc-go/v7 => github.com/classic-terra/ibc-go/v7 v7.4.0-terra
github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2
// replace goleveldb to optimized one
github.com/syndtr/goleveldb => github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,16 @@ github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/classic-terra/cometbft v0.37.4-classic h1:7HfuM/VfD7hBTIiF/pCWsyH6gh9YrsD05Xv1TErEwN8=
github.com/classic-terra/cometbft v0.37.4-classic/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8=
github.com/classic-terra/cosmos-sdk v0.47.10-classic h1:HJMcVfw4b3t9jOFUxwQuFwgxO49mmojLP2pr4vo6FNk=
github.com/classic-terra/cosmos-sdk v0.47.10-classic/go.mod h1:fLbF9OIrgXq5W7LxvOSzAM9tOMfqxYeprlMH7RFmozs=
github.com/classic-terra/cometbft v0.37.4-terra1 h1:eT5B2n5KKi5WVW+3ZNOVTmtfKKaZrXOLX9G80m9mhZo=
github.com/classic-terra/cometbft v0.37.4-terra1/go.mod h1:vFqj7Qe3uFFJvHZleTJPQDmJ/WscXHi4rKWqiCAaNZk=
github.com/classic-terra/cosmos-sdk v0.47.10-terra h1:5Kbe5ys+buLGH60lg6dWX938ajPUMFnDTCMA3/PsnKo=
github.com/classic-terra/cosmos-sdk v0.47.10-terra/go.mod h1:4mBvTB8zevoeTuQufWwTcNnthGG2afXO+9D42BKzlRo=
github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121 h1:fjpWDB0hm225wYg9vunyDyTH8ftd5xEUgINJKidj+Tw=
github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/classic-terra/ibc-go/v7 v7.0.0-20240419072319-aa9d74dc39ae h1:dPxkxNcORnKN/ZWqzH4zxfi42FK2bes02LgIj5P/f4k=
github.com/classic-terra/ibc-go/v7 v7.0.0-20240419072319-aa9d74dc39ae/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo=
github.com/classic-terra/wasmd v0.45.0-classic h1:6yZZuYybnzg5nOo6bHHO7/In/XJJDuPwfIewmW3PYuY=
github.com/classic-terra/wasmd v0.45.0-classic/go.mod h1:h+dgrilC9naGP0NKFWOZ691qpY07BMbWnF4X1FwPVik=
github.com/classic-terra/ibc-go/v7 v7.4.0-terra h1:hawaq62XKlxyc8xLyIcc6IujDDEbqDBU+2U15SF+hj8=
github.com/classic-terra/ibc-go/v7 v7.4.0-terra/go.mod h1:s0lxNkjVIqsb8AVltL0qhzxeLgOKvWZrknPuvgjlEQ8=
github.com/classic-terra/wasmd v0.45.0-terra1 h1:0QT9ViBy2kFDqGhcbTXvIuwgycVAWmAWemMV1PmOlWQ=
github.com/classic-terra/wasmd v0.45.0-terra1/go.mod h1:n1BJiGOIkPR3dZyQCfNAO2k2bPC/lnxZLIBMA1PM6/A=
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304=
Expand Down
2 changes: 1 addition & 1 deletion x/dyncomm/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"cosmossdk.io/math"
"github.com/classic-terra/core/v3/app"
core "github.com/classic-terra/core/v3/types"
proto "github.com/cosmos/gogoproto/proto"
"github.com/cosmos/gogoproto/proto"
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/client"
Expand Down

0 comments on commit e8c0c89

Please sign in to comment.