diff --git a/app/app.go b/app/app.go index 3d775fbf33..dbcb0799be 100644 --- a/app/app.go +++ b/app/app.go @@ -198,10 +198,9 @@ func init() { ugovmodule.AppModuleBasic{}, wasm.AppModuleBasic{}, incentivemodule.AppModuleBasic{}, + metokenmodule.AppModuleBasic{}, } - if Experimental { - moduleBasics = append(moduleBasics, metokenmodule.AppModuleBasic{}) - } + // if Experimental {} ModuleBasics = module.NewBasicManager(moduleBasics...) @@ -224,13 +223,9 @@ func init() { oracletypes.ModuleName: nil, uibc.ModuleName: nil, ugov.ModuleName: nil, + metoken.ModuleName: {authtypes.Minter, authtypes.Burner}, } - - if Experimental { - maccPerms[metoken.ModuleName] = []string{ - authtypes.Minter, authtypes.Burner, - } - } + // if Experimental {} } // UmeeApp defines the ABCI application for the Umee network as an extension of @@ -343,10 +338,9 @@ func New( bech32ibctypes.StoreKey, uibc.StoreKey, ugov.StoreKey, wasm.StoreKey, incentive.StoreKey, + metoken.StoreKey, } - if Experimental { - storeKeys = append(storeKeys, metoken.StoreKey) - } + // if Experimental {} keys := sdk.NewKVStoreKeys(storeKeys...) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -499,16 +493,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 @@ -738,11 +730,9 @@ 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), + metokenmodule.NewAppModule(appCodec, app.MetokenKeeperB), } - if Experimental { - appModules = append(appModules, metokenmodule.NewAppModule(appCodec, app.MetokenKeeperB)) - - } + // if Experimental {} app.mm = module.NewManager(appModules...) @@ -780,6 +770,7 @@ func New( ugov.ModuleName, wasm.ModuleName, incentive.ModuleName, + metoken.ModuleName, } endBlockers := []string{ crisistypes.ModuleName, @@ -798,6 +789,7 @@ func New( ugov.ModuleName, wasm.ModuleName, incentive.ModuleName, + metoken.ModuleName, } // NOTE: The genutils module must occur after staking so that pools are @@ -822,6 +814,7 @@ func New( ugov.ModuleName, wasm.ModuleName, incentive.ModuleName, + metoken.ModuleName, } orderMigrations := []string{ capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, @@ -838,14 +831,9 @@ func New( ugov.ModuleName, wasm.ModuleName, incentive.ModuleName, + metoken.ModuleName, } - - if Experimental { - beginBlockers = append(beginBlockers, metoken.ModuleName) - endBlockers = append(endBlockers, metoken.ModuleName) - initGenesis = append(initGenesis, metoken.ModuleName) - orderMigrations = append(orderMigrations, metoken.ModuleName) - } + // if Experimental {} app.mm.SetOrderBeginBlockers(beginBlockers...) app.mm.SetOrderEndBlockers(endBlockers...) diff --git a/app/wasm/test/cosmwasm_test.go b/app/wasm/test/cosmwasm_test.go index 0a720d997b..590f86ebf6 100644 --- a/app/wasm/test/cosmwasm_test.go +++ b/app/wasm/test/cosmwasm_test.go @@ -2,8 +2,6 @@ package wasm_test import ( "testing" - - "github.com/umee-network/umee/v6/app" ) func TestCosmwasm(t *testing.T) { @@ -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() diff --git a/tests/e2e/e2e_metoken_test.go b/tests/e2e/e2e_metoken_test.go index 6a10c5fafa..55a80ccc58 100644 --- a/tests/e2e/e2e_metoken_test.go +++ b/tests/e2e/e2e_metoken_test.go @@ -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" @@ -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{ diff --git a/x/metoken/keeper/intest/grpc_query_test.go b/x/metoken/keeper/intest/grpc_query_test.go index 49c845ad5f..39b84fb6c1 100644 --- a/x/metoken/keeper/intest/grpc_query_test.go +++ b/x/metoken/keeper/intest/grpc_query_test.go @@ -1,6 +1,3 @@ -//go:build experimental -// +build experimental - package intest import ( diff --git a/x/metoken/keeper/intest/interest_test.go b/x/metoken/keeper/intest/interest_test.go index b03d65c309..7bb3ccd160 100644 --- a/x/metoken/keeper/intest/interest_test.go +++ b/x/metoken/keeper/intest/interest_test.go @@ -1,6 +1,3 @@ -//go:build experimental -// +build experimental - package intest import ( diff --git a/x/metoken/keeper/intest/keeper_test.go b/x/metoken/keeper/intest/keeper_test.go index c9e8e0bbf9..ffa40e3266 100644 --- a/x/metoken/keeper/intest/keeper_test.go +++ b/x/metoken/keeper/intest/keeper_test.go @@ -1,6 +1,3 @@ -//go:build experimental -// +build experimental - package intest import ( @@ -62,6 +59,7 @@ func initTestSuite(t *testing.T, registry []metoken.Index, balances []metoken.In app.BankKeeper, app.LeverageKeeper, oracleMock, + app.UGovKeeperB.EmergencyGroup, ) app.MetokenKeeperB = kb diff --git a/x/metoken/keeper/intest/msg_server_test.go b/x/metoken/keeper/intest/msg_server_test.go index 3365c25aee..3a96e075fe 100644 --- a/x/metoken/keeper/intest/msg_server_test.go +++ b/x/metoken/keeper/intest/msg_server_test.go @@ -1,9 +1,7 @@ -//go:build experimental -// +build experimental - package intest import ( + "fmt" "testing" "github.com/golang/mock/gomock" @@ -250,6 +248,9 @@ func TestMsgServer_Swap_NonStableAssets_DiffExponents(t *testing.T) { require.NoError(err) // verify the outputs of swap function + if tc.name == "valid - swap 1.435125562353141231 ETH" { + fmt.Printf("\n") + } resp, err := msgServer.Swap(ctx, msg) require.NoError(err, tc.name) @@ -612,6 +613,7 @@ func TestMsgServer_Swap_Depegging(t *testing.T) { app.BankKeeper, app.LeverageKeeper, oracleMock, + app.UGovKeeperB.EmergencyGroup, ) app.MetokenKeeperB = kb msgServer = keeper.NewMsgServerImpl(app.MetokenKeeperB) @@ -708,6 +710,7 @@ func TestMsgServer_Swap_Depegging(t *testing.T) { app.BankKeeper, app.LeverageKeeper, oracleMock, + app.UGovKeeperB.EmergencyGroup, ) app.MetokenKeeperB = kb msgServer = keeper.NewMsgServerImpl(app.MetokenKeeperB) @@ -898,11 +901,12 @@ func verifySwap( assetExponentFactorVsMeToken, err := metoken.ExponentFactor(assetPrice.Exponent, prices.Exponent) assert.NilError(t, err) + rate := exchangeRate.Mul(assetExponentFactorVsMeToken) // expected_metokens = amount_to_swap * exchange_rate * exponent_factor expectedMeTokens := sdk.NewCoin( meTokenDenom, - exchangeRate.MulInt(amountToSwap).Mul(assetExponentFactorVsMeToken).TruncateInt(), + rate.MulInt(amountToSwap).TruncateInt(), ) // calculating reserved and leveraged @@ -1350,6 +1354,7 @@ func TestMsgServer_Redeem_Depegging(t *testing.T) { app.BankKeeper, app.LeverageKeeper, oracleMock, + app.UGovKeeperB.EmergencyGroup, ) app.MetokenKeeperB = kb msgServer = keeper.NewMsgServerImpl(app.MetokenKeeperB) @@ -1446,6 +1451,7 @@ func TestMsgServer_Redeem_Depegging(t *testing.T) { app.BankKeeper, app.LeverageKeeper, oracleMock, + app.UGovKeeperB.EmergencyGroup, ) app.MetokenKeeperB = kb msgServer = keeper.NewMsgServerImpl(app.MetokenKeeperB) @@ -1861,8 +1867,12 @@ func TestMsgServer_GovUpdateRegistry(t *testing.T) { }{ { "invalid authority", - metoken.NewMsgGovUpdateRegistry("invalid_authority", nil, nil), - "invalid_authority", + metoken.NewMsgGovUpdateRegistry( + "umee156hsyuvssklaekm57qy0pcehlfhzpclclaadwq", + nil, + []metoken.Index{existingIndex}, + ), + "unauthorized", }, { "invalid - empty add and update indexes", diff --git a/x/metoken/keeper/intest/reserves_test.go b/x/metoken/keeper/intest/reserves_test.go index 036731f810..b07e4e3a62 100644 --- a/x/metoken/keeper/intest/reserves_test.go +++ b/x/metoken/keeper/intest/reserves_test.go @@ -1,6 +1,3 @@ -//go:build experimental -// +build experimental - package intest import (