Skip to content

Commit

Permalink
move meToken out of experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
kosegor committed Sep 28, 2023
1 parent 19f5ab6 commit 3b247ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 43 deletions.
49 changes: 16 additions & 33 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ func init() {
ugovmodule.AppModuleBasic{},
wasm.AppModuleBasic{},
incentivemodule.AppModuleBasic{},
}
if Experimental {
moduleBasics = append(moduleBasics, metokenmodule.AppModuleBasic{})
metokenmodule.AppModuleBasic{},
}

ModuleBasics = module.NewBasicManager(moduleBasics...)
Expand All @@ -224,12 +222,7 @@ func init() {
oracletypes.ModuleName: nil,
uibc.ModuleName: nil,
ugov.ModuleName: nil,
}

if Experimental {
maccPerms[metoken.ModuleName] = []string{
authtypes.Minter, authtypes.Burner,
}
metoken.ModuleName: {authtypes.Minter, authtypes.Burner},
}
}

Expand Down Expand Up @@ -343,9 +336,7 @@ func New(
bech32ibctypes.StoreKey, uibc.StoreKey, ugov.StoreKey,
wasm.StoreKey,
incentive.StoreKey,
}
if Experimental {
storeKeys = append(storeKeys, metoken.StoreKey)
metoken.StoreKey,
}

keys := sdk.NewKVStoreKeys(storeKeys...)
Expand Down Expand Up @@ -499,16 +490,14 @@ func New(
)
app.LeverageKeeper.SetBondHooks(app.IncentiveKeeper.BondHooks())

if Experimental {
app.MetokenKeeperB = metokenkeeper.NewKeeperBuilder(
appCodec,
keys[metoken.StoreKey],
app.BankKeeper,
app.LeverageKeeper,
app.OracleKeeper,
app.UGovKeeperB.EmergencyGroup,
)
}
app.MetokenKeeperB = metokenkeeper.NewKeeperBuilder(
appCodec,
keys[metoken.StoreKey],
app.BankKeeper,
app.LeverageKeeper,
app.OracleKeeper,
app.UGovKeeperB.EmergencyGroup,
)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
Expand Down Expand Up @@ -738,10 +727,7 @@ func New(
ugovmodule.NewAppModule(appCodec, app.UGovKeeperB),
wasm.NewAppModule(app.appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
incentivemodule.NewAppModule(appCodec, app.IncentiveKeeper, app.BankKeeper, app.LeverageKeeper),
}
if Experimental {
appModules = append(appModules, metokenmodule.NewAppModule(appCodec, app.MetokenKeeperB))

metokenmodule.NewAppModule(appCodec, app.MetokenKeeperB),
}

app.mm = module.NewManager(appModules...)
Expand Down Expand Up @@ -780,6 +766,7 @@ func New(
ugov.ModuleName,
wasm.ModuleName,
incentive.ModuleName,
metoken.ModuleName,
}
endBlockers := []string{
crisistypes.ModuleName,
Expand All @@ -798,6 +785,7 @@ func New(
ugov.ModuleName,
wasm.ModuleName,
incentive.ModuleName,
metoken.ModuleName,
}

// NOTE: The genutils module must occur after staking so that pools are
Expand All @@ -822,6 +810,7 @@ func New(
ugov.ModuleName,
wasm.ModuleName,
incentive.ModuleName,
metoken.ModuleName,
}
orderMigrations := []string{
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName,
Expand All @@ -838,13 +827,7 @@ func New(
ugov.ModuleName,
wasm.ModuleName,
incentive.ModuleName,
}

if Experimental {
beginBlockers = append(beginBlockers, metoken.ModuleName)
endBlockers = append(endBlockers, metoken.ModuleName)
initGenesis = append(initGenesis, metoken.ModuleName)
orderMigrations = append(orderMigrations, metoken.ModuleName)
metoken.ModuleName,
}

app.mm.SetOrderBeginBlockers(beginBlockers...)
Expand Down
6 changes: 1 addition & 5 deletions app/wasm/test/cosmwasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package wasm_test

import (
"testing"

"github.com/umee-network/umee/v6/app"
)

func TestCosmwasm(t *testing.T) {
Expand All @@ -24,9 +22,7 @@ func TestCosmwasm(t *testing.T) {
its.TestOracleQueries()
its.TestLeverageTxs()
its.TestIncentiveQueries()
if app.Experimental {
its.TestMetokenQueries()
}
its.TestMetokenQueries()

// stargate queries
its.TestStargateQueries()
Expand Down
5 changes: 0 additions & 5 deletions tests/e2e/e2e_metoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/umee-network/umee/v6/app"
"github.com/umee-network/umee/v6/tests/grpc"
ltypes "github.com/umee-network/umee/v6/x/leverage/types"
"github.com/umee-network/umee/v6/x/metoken"
Expand All @@ -21,10 +20,6 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() {
s.Require().NoError(err)
expectedBalance := mocks.EmptyUSDIndexBalances(mocks.MeUSDDenom)

if app.Experimental {
s.T().Skip("Skipping tests for experimental module x/metoken")
}

s.Run(
"create_stable_index", func() {
tokens := []ltypes.Token{
Expand Down

0 comments on commit 3b247ac

Please sign in to comment.