From c25e4e03233a63bbcb05c53bd6fa9539870bdd53 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Thu, 25 Apr 2024 04:37:42 -0600 Subject: [PATCH] chore: don't use hardcoded "uosmo" string (#8141) * use uosmo var * fix lint * tidy --- app/app.go | 12 ++- app/apptesting/concentrated_liquidity.go | 3 +- app/apptesting/gamm.go | 8 +- app/upgrades/v15/upgrade_test.go | 9 +- app/upgrades/v16/upgrades.go | 5 +- app/upgrades/v16/upgrades_test.go | 17 +-- app/upgrades/v17/constants.go | 3 +- app/upgrades/v17/upgrades_test.go | 25 ++--- app/upgrades/v18/upgrades_test.go | 3 +- app/upgrades/v21/upgrades.go | 3 +- app/upgrades/v22/upgrades_test.go | 5 +- app/upgrades/v23/upgrades_test.go | 5 +- app/upgrades/v24/upgrades_test.go | 5 +- app/upgrades/v3/forks.go | 2 +- app/upgrades/v4/prop12.go | 6 +- app/upgrades/v4/upgrade_test.go | 16 +-- app/upgrades/v4/upgrades.go | 2 +- .../sqs/pools/transformer/pool_transformer.go | 5 +- simulation/simtypes/legacy.go | 6 +- tests/e2e/configurer/upgrade.go | 4 +- tests/e2e/e2e_cl_test.go | 25 ++--- tests/e2e/e2e_test.go | 29 ++--- tests/e2e/initialization/config.go | 5 +- tests/ibc-hooks/ibc_middleware_test.go | 11 +- wasmbinding/query_plugin_test.go | 5 +- wasmbinding/test/helpers_test.go | 3 +- wasmbinding/test/queries_test.go | 3 +- wasmbinding/test/store_run_test.go | 3 +- x/concentrated-liquidity/bench_test.go | 3 +- x/concentrated-liquidity/genesis_test.go | 3 +- x/concentrated-liquidity/pool_test.go | 5 +- x/concentrated-liquidity/position_test.go | 11 +- .../spread_rewards_test.go | 5 +- x/concentrated-liquidity/types/gov_test.go | 9 +- x/concentrated-liquidity/types/params.go | 3 +- .../msg/transmuter/transmuter_test.go | 5 +- x/gamm/client/cli/cli_test.go | 4 +- x/gamm/keeper/gas_test.go | 5 +- x/gamm/keeper/genesis_test.go | 7 +- x/gamm/keeper/grpc_query_test.go | 25 ++--- x/gamm/keeper/migrate_test.go | 7 +- x/gamm/keeper/msg_server_test.go | 5 +- x/gamm/keeper/pool_service_test.go | 3 +- x/gamm/keeper/pool_test.go | 8 +- .../pool-models/balancer/pool_suite_test.go | 101 +++++++++--------- x/gamm/pool-models/balancer/pool_test.go | 57 +++++----- x/gamm/pool-models/stableswap/amm_test.go | 49 ++++----- x/incentives/client/cli/cli_test.go | 5 +- x/incentives/keeper/distribute_test.go | 4 +- x/incentives/keeper/gauge_test.go | 10 +- x/incentives/keeper/genesis_test.go | 4 +- x/incentives/keeper/hooks_test.go | 3 +- x/incentives/keeper/msg_server_test.go | 10 +- x/incentives/keeper/store_test.go | 11 +- x/incentives/keeper/suite_test.go | 1 - x/incentives/types/constants.go | 4 +- x/incentives/types/params.go | 4 +- x/lockup/client/cli/cli_test.go | 7 +- x/lockup/keeper/lock_test.go | 5 +- x/mint/keeper/genesis_test.go | 5 +- x/mint/keeper/keeper_test.go | 5 +- x/pool-incentives/keeper/genesis_test.go | 2 +- x/poolmanager/create_pool_test.go | 3 +- x/poolmanager/keeper_test.go | 17 +-- x/poolmanager/msg_server_test.go | 5 +- x/poolmanager/router_test.go | 7 +- x/poolmanager/types/gov_test.go | 9 +- x/poolmanager/types/keys_test.go | 5 +- x/poolmanager/types/msgs_test.go | 9 +- x/poolmanager/types/params.go | 2 +- x/poolmanager/types/routes_test.go | 3 +- x/protorev/keeper/emit_test.go | 5 +- x/protorev/keeper/epoch_hook_test.go | 7 +- x/protorev/keeper/grpc_query_test.go | 3 +- x/protorev/keeper/hooks_test.go | 96 +++++++++-------- x/protorev/keeper/keeper_test.go | 37 +++---- x/protorev/keeper/posthandler_test.go | 5 +- x/protorev/keeper/rebalance_test.go | 49 ++++----- x/protorev/types/constants.go | 7 +- x/smart-account/authenticator/base_test.go | 3 +- .../authenticator/spend_limits_test.go | 14 +-- x/superfluid/keeper/epoch_test.go | 6 +- x/superfluid/keeper/grpc_query_test.go | 11 +- x/superfluid/keeper/hooks_test.go | 4 +- x/superfluid/keeper/slash_test.go | 3 +- x/superfluid/keeper/stake_test.go | 9 +- x/superfluid/keeper/unpool_test.go | 3 +- x/tokenfactory/keeper/admins_test.go | 23 ++-- x/tokenfactory/keeper/createdenom_test.go | 5 +- x/tokenfactory/keeper/genesis_test.go | 3 +- x/tokenfactory/keeper/msg_server_test.go | 10 +- x/txfees/client/cli/query_test.go | 9 +- x/txfees/keeper/feedecorator.go | 3 +- x/txfees/keeper/feedecorator_test.go | 3 +- x/txfees/keeper/genesis_test.go | 11 +- x/txfees/keeper/keeper_test.go | 3 +- x/txfees/keeper/txfee_filters/arb_tx_test.go | 3 +- x/valset-pref/keeper_test.go | 3 +- 98 files changed, 558 insertions(+), 463 deletions(-) diff --git a/app/app.go b/app/app.go index e9e1005a22f..cf125ba6981 100644 --- a/app/app.go +++ b/app/app.go @@ -87,6 +87,8 @@ import ( authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/cosmos/cosmos-sdk/x/crisis" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" + minttypes "github.com/osmosis-labs/osmosis/v24/x/mint/types" protorevtypes "github.com/osmosis-labs/osmosis/v24/x/protorev/types" @@ -613,8 +615,8 @@ func InitOsmosisAppForTestnet(app *OsmosisApp, newValAddr bytes.HexBytes, newVal govParams := app.GovKeeper.GetParams(ctx) govParams.ExpeditedVotingPeriod = &newExpeditedVotingPeriod govParams.VotingPeriod = &newVotingPeriod - govParams.MinDeposit = sdk.NewCoins(sdk.NewInt64Coin("uosmo", 100000000)) - govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewInt64Coin("uosmo", 150000000)) + govParams.MinDeposit = sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 100000000)) + govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 150000000)) err = app.GovKeeper.SetParams(ctx, govParams) if err != nil { @@ -654,7 +656,7 @@ func InitOsmosisAppForTestnet(app *OsmosisApp, newValAddr bytes.HexBytes, newVal defaultCoins := sdk.NewCoins( sdk.NewInt64Coin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", 1000000000000), // DAI sdk.NewInt64Coin("ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4", 1000000000000), // USDC, for pool creation fee - sdk.NewInt64Coin("uosmo", 1000000000000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1000000000000), sdk.NewInt64Coin("uion", 1000000000)) localOsmosisAccounts := []sdk.AccAddress{ @@ -686,7 +688,7 @@ func InitOsmosisAppForTestnet(app *OsmosisApp, newValAddr bytes.HexBytes, newVal // Fund edgenet faucet faucetCoins := sdk.NewCoins( sdk.NewInt64Coin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", 1000000000000000), // DAI - sdk.NewInt64Coin("uosmo", 1000000000000000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1000000000000000), sdk.NewInt64Coin("uion", 1000000000000)) err = app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, faucetCoins) if err != nil { @@ -699,7 +701,7 @@ func InitOsmosisAppForTestnet(app *OsmosisApp, newValAddr bytes.HexBytes, newVal // Mars bank account marsCoins := sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 10000000000000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 10000000000000), sdk.NewInt64Coin("ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E", 400000000000), sdk.NewInt64Coin("ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", 3000000000000), sdk.NewInt64Coin("ibc/C140AFD542AE77BD7DCC83F13FDD8C5E5BB8C4929785E6EC2F4C636F98F17901", 200000000000), diff --git a/app/apptesting/concentrated_liquidity.go b/app/apptesting/concentrated_liquidity.go index 8940a3200b8..2bc6a73b9aa 100644 --- a/app/apptesting/concentrated_liquidity.go +++ b/app/apptesting/concentrated_liquidity.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" clmath "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/math" clmodel "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" @@ -912,7 +913,7 @@ func (s *KeeperTestHelper) SetupConcentratedLiquidityDenomsAndPoolCreation() { defaultParams.IsPermissionlessPoolCreationEnabled = true s.App.ConcentratedLiquidityKeeper.SetParams(s.Ctx, defaultParams) - authorizedQuoteDenoms := append(poolmanagertypes.DefaultParams().AuthorizedQuoteDenoms, ETH, USDC, BAR, BAZ, FOO, UOSMO, STAKE, WBTC) + authorizedQuoteDenoms := append(poolmanagertypes.DefaultParams().AuthorizedQuoteDenoms, ETH, USDC, BAR, BAZ, FOO, appparams.BaseCoinUnit, STAKE, WBTC) s.App.PoolManagerKeeper.SetParam(s.Ctx, poolmanagertypes.KeyAuthorizedQuoteDenoms, authorizedQuoteDenoms) } diff --git a/app/apptesting/gamm.go b/app/apptesting/gamm.go index fba3dff6fae..25b04844fa0 100644 --- a/app/apptesting/gamm.go +++ b/app/apptesting/gamm.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" gammkeeper "github.com/osmosis-labs/osmosis/v24/x/gamm/keeper" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" @@ -15,12 +16,11 @@ const ( BAR = "bar" BAZ = "baz" FOO = "foo" - UOSMO = "uosmo" STAKE = "stake" ) var DefaultAcctFunds sdk.Coins = sdk.NewCoins( - sdk.NewCoin(UOSMO, osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin(FOO, osmomath.NewInt(10000000000)), sdk.NewCoin(BAR, osmomath.NewInt(10000000000)), sdk.NewCoin(BAZ, osmomath.NewInt(10000000000)), @@ -41,7 +41,7 @@ var DefaultPoolAssets = []balancer.PoolAsset{ }, { Weight: osmomath.NewInt(400), - Token: sdk.NewCoin(UOSMO, osmomath.NewInt(5000000)), + Token: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(5000000)), }, } @@ -161,7 +161,7 @@ func (s *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer // PrepareCustomBalancerPool sets up a Balancer pool with an array of assets and given parameters func (s *KeeperTestHelper) PrepareCustomBalancerPool(assets []balancer.PoolAsset, params balancer.PoolParams) uint64 { // Add coins for pool creation fee + coins needed to mint balances - fundCoins := sdk.NewCoins(sdk.NewCoin(UOSMO, osmomath.NewInt(10000000000))) + fundCoins := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000))) for _, a := range assets { fundCoins = fundCoins.Add(a.Token) } diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 4334ad8bb8f..44a9c7d95dc 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -19,6 +19,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" v15 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v15" gamm "github.com/osmosis-labs/osmosis/v24/x/gamm/keeper" balancer "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" @@ -30,7 +31,7 @@ type UpgradeTestSuite struct { } var DefaultAcctFunds sdk.Coins = sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin("foo", osmomath.NewInt(10000000)), sdk.NewCoin("bar", osmomath.NewInt(10000000)), sdk.NewCoin("baz", osmomath.NewInt(10000000)), @@ -171,14 +172,14 @@ func (s *UpgradeTestSuite) TestMigrateBalancerToStablePools() { func (s *UpgradeTestSuite) TestRegisterOsmoIonMetadata() { s.SetupTest() // reset - expectedUosmodenom := "uosmo" + expectedUosmodenom := appparams.BaseCoinUnit expectedUiondenom := "uion" ctx := s.Ctx bankKeeper := s.App.BankKeeper // meta data should not be found pre-registration of meta data - _, found := s.App.BankKeeper.GetDenomMetaData(ctx, "uosmo") + _, found := s.App.BankKeeper.GetDenomMetaData(ctx, appparams.BaseCoinUnit) s.Require().False(found) _, found = s.App.BankKeeper.GetDenomMetaData(ctx, "uion") @@ -187,7 +188,7 @@ func (s *UpgradeTestSuite) TestRegisterOsmoIonMetadata() { // system under test. v15.RegisterOsmoIonMetadata(ctx, bankKeeper) - uosmoMetadata, found := s.App.BankKeeper.GetDenomMetaData(ctx, "uosmo") + uosmoMetadata, found := s.App.BankKeeper.GetDenomMetaData(ctx, appparams.BaseCoinUnit) s.Require().True(found) uionMetadata, found := s.App.BankKeeper.GetDenomMetaData(ctx, "uion") diff --git a/app/upgrades/v16/upgrades.go b/app/upgrades/v16/upgrades.go index ebb05ce023f..8a8a72dd06e 100644 --- a/app/upgrades/v16/upgrades.go +++ b/app/upgrades/v16/upgrades.go @@ -15,6 +15,7 @@ import ( cosmwasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types" superfluidtypes "github.com/osmosis-labs/osmosis/v24/x/superfluid/types" @@ -31,7 +32,7 @@ const ( // Denom0 translates to a base asset while denom1 to a quote asset // We want quote asset to be DAI so that when the limit orders on ticks // are implemented, we have tick spacing in terms of DAI as the quote. - DesiredDenom0 = "uosmo" + DesiredDenom0 = appparams.BaseCoinUnit TickSpacing = 100 // isPermissionlessPoolCreationEnabledCL is a boolean that determines if @@ -54,7 +55,7 @@ var ( // from tick to price conversion. These increments are in a human // understandeable magnitude only for token1 as a quote. authorizedQuoteDenoms []string = []string{ - "uosmo", + appparams.BaseCoinUnit, ATOMIBCDenom, DAIIBCDenom, USDCIBCDenom, diff --git a/app/upgrades/v16/upgrades_test.go b/app/upgrades/v16/upgrades_test.go index 40a3086270a..a6d46acbb73 100644 --- a/app/upgrades/v16/upgrades_test.go +++ b/app/upgrades/v16/upgrades_test.go @@ -16,6 +16,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" v16 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v16" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types" @@ -83,15 +84,15 @@ func (s *UpgradeTestSuite) TestUpgrade() { // Create earlier pools for i := uint64(1); i < v16.DaiOsmoPoolId; i++ { - s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", defaultDaiAmount)) + s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", defaultDaiAmount)) } // Create DAI / OSMO pool - s.PrepareBalancerPoolWithCoins(sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", defaultDaiAmount), sdk.NewCoin("uosmo", osmomath.NewInt(10000000000))) + s.PrepareBalancerPoolWithCoins(sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", defaultDaiAmount), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000))) }, func() { stakingParams := s.App.StakingKeeper.GetParams(s.Ctx) - stakingParams.BondDenom = "uosmo" + stakingParams.BondDenom = appparams.BaseCoinUnit s.App.StakingKeeper.SetParams(s.Ctx, stakingParams) oneDai := sdk.NewCoins(sdk.NewCoin(v16.DAIIBCDenom, osmomath.NewInt(1000000000000000000))) @@ -123,11 +124,11 @@ func (s *UpgradeTestSuite) TestUpgrade() { // Validate that the community pool balance has been reduced by the amount of OSMO that was used to create the pool // Note we use all the osmo, but a small amount of DAI is left over due to rounding when creating the first position. - s.Require().Equal(communityPoolBalancePre.AmountOf("uosmo").Sub(respectiveOsmo.Amount).String(), communityPoolBalancePost.AmountOf("uosmo").String()) + s.Require().Equal(communityPoolBalancePre.AmountOf(appparams.BaseCoinUnit).Sub(respectiveOsmo.Amount).String(), communityPoolBalancePost.AmountOf(appparams.BaseCoinUnit).String()) osmoassert.Equal(s.T(), multiplicativeTolerance, communityPoolBalancePre.AmountOf(v16.DAIIBCDenom), oneDai[0].Amount.Sub(communityPoolBalancePost.AmountOf(v16.DAIIBCDenom))) // Validate that the fee pool community pool balance has been decreased by the amount of OSMO/DAI that was used to create the pool - s.Require().Equal(communityPoolBalancePost.AmountOf("uosmo").String(), feePoolCommunityPoolPost.AmountOf("uosmo").TruncateInt().String()) + s.Require().Equal(communityPoolBalancePost.AmountOf(appparams.BaseCoinUnit).String(), feePoolCommunityPoolPost.AmountOf(appparams.BaseCoinUnit).TruncateInt().String()) s.Require().Equal(communityPoolBalancePost.AmountOf(v16.DAIIBCDenom).String(), feePoolCommunityPoolPost.AmountOf(v16.DAIIBCDenom).TruncateInt().String()) // Get balancer pool's spot price. @@ -227,12 +228,12 @@ func upgradeProtorevSetup(s *UpgradeTestSuite) error { account := apptesting.CreateRandomAccounts(1)[0] s.App.ProtoRevKeeper.SetDeveloperAccount(s.Ctx, account) - devFee := sdk.NewCoin("uosmo", osmomath.NewInt(1000000)) + devFee := sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000)) if err := s.App.ProtoRevKeeper.SetDeveloperFees(s.Ctx, devFee); err != nil { return err } - fundCoin := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))) + fundCoin := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))) if err := s.App.AppKeepers.BankKeeper.MintCoins(s.Ctx, protorevtypes.ModuleName, fundCoin); err != nil { return err @@ -245,7 +246,7 @@ func upgradeProtorevSetup(s *UpgradeTestSuite) error { // // Ensure balance was transferred to the developer account // devAcc, err := s.App.ProtoRevKeeper.GetDeveloperAccount(s.Ctx) // s.Require().NoError(err) -// s.Require().Equal(s.App.BankKeeper.GetBalance(s.Ctx, devAcc, "uosmo"), sdk.NewCoin("uosmo", osmomath.NewInt(1000000))) +// s.Require().Equal(s.App.BankKeeper.GetBalance(s.Ctx, devAcc, appparams.BaseCoinUnit), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))) // // Ensure developer fees are empty // coins, err := s.App.ProtoRevKeeper.GetAllDeveloperFees(s.Ctx) diff --git a/app/upgrades/v17/constants.go b/app/upgrades/v17/constants.go index 6c4612631e3..175fd80b07f 100644 --- a/app/upgrades/v17/constants.go +++ b/app/upgrades/v17/constants.go @@ -17,6 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v24/app/keepers" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) // UpgradeName defines the on-chain upgrade name for the Osmosis v17 upgrade. @@ -32,7 +33,7 @@ var Upgrade = upgrades.Upgrade{ } const ( - OSMO = "uosmo" + OSMO = appparams.BaseCoinUnit TickSpacing = 100 ) diff --git a/app/upgrades/v17/upgrades_test.go b/app/upgrades/v17/upgrades_test.go index 77dbf273de6..362c327a565 100644 --- a/app/upgrades/v17/upgrades_test.go +++ b/app/upgrades/v17/upgrades_test.go @@ -17,6 +17,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" "github.com/osmosis-labs/osmosis/v24/app/keepers" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" v17 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v17" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" @@ -143,42 +144,42 @@ func (s *UpgradeTestSuite) TestUpgrade() { lastPoolID = poolID } - existingPool := s.PrepareConcentratedPoolWithCoins("ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", "uosmo") - existingPool2 := s.PrepareConcentratedPoolWithCoins("akash", "uosmo") - existingBalancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("atom", osmomath.NewInt(10000000000)), sdk.NewCoin("uosmo", osmomath.NewInt(10000000000))) + existingPool := s.PrepareConcentratedPoolWithCoins("ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", appparams.BaseCoinUnit) + existingPool2 := s.PrepareConcentratedPoolWithCoins("akash", appparams.BaseCoinUnit) + existingBalancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("atom", osmomath.NewInt(10000000000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000))) // create few TWAP records for the pools - t1 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour*24), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", "uosmo", osmomath.NewDec(10), + t1 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour*24), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", appparams.BaseCoinUnit, osmomath.NewDec(10), osmomath.OneDec().MulInt64(10*10), osmomath.OneDec().MulInt64(3), osmomath.ZeroDec()) - t2 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour*10), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", "uosmo", osmomath.NewDec(30), + t2 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour*10), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", appparams.BaseCoinUnit, osmomath.NewDec(30), osmomath.OneDec().MulInt64(10*10+10), osmomath.OneDec().MulInt64(5), osmomath.ZeroDec()) - t3 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", "uosmo", osmomath.NewDec(20), + t3 := dummyTwapRecord(existingPool.GetId(), time.Now().Add(-time.Hour), "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", appparams.BaseCoinUnit, osmomath.NewDec(20), osmomath.OneDec().MulInt64(10*10+10*5), osmomath.OneDec().MulInt64(10), osmomath.ZeroDec()) - t4 := dummyTwapRecord(existingPool2.GetId(), time.Now().Add(-time.Hour*24), "akash", "uosmo", osmomath.NewDec(10), + t4 := dummyTwapRecord(existingPool2.GetId(), time.Now().Add(-time.Hour*24), "akash", appparams.BaseCoinUnit, osmomath.NewDec(10), osmomath.OneDec().MulInt64(10*10*10), osmomath.OneDec().MulInt64(5), osmomath.ZeroDec()) - t5 := dummyTwapRecord(existingPool2.GetId(), time.Now().Add(-time.Hour), "akash", "uosmo", osmomath.NewDec(20), + t5 := dummyTwapRecord(existingPool2.GetId(), time.Now().Add(-time.Hour), "akash", appparams.BaseCoinUnit, osmomath.NewDec(20), osmomath.OneDec().MulInt64(10), osmomath.OneDec().MulInt64(2), osmomath.ZeroDec()) - t6 := dummyTwapRecord(existingBalancerPoolId, time.Now().Add(-time.Hour), "atom", "uosmo", osmomath.NewDec(10), + t6 := dummyTwapRecord(existingBalancerPoolId, time.Now().Add(-time.Hour), "atom", appparams.BaseCoinUnit, osmomath.NewDec(10), osmomath.OneDec().MulInt64(10), osmomath.OneDec().MulInt64(10), osmomath.ZeroDec()) - t7 := dummyTwapRecord(existingBalancerPoolId, time.Now().Add(-time.Minute*20), "atom", "uosmo", osmomath.NewDec(50), + t7 := dummyTwapRecord(existingBalancerPoolId, time.Now().Add(-time.Minute*20), "atom", appparams.BaseCoinUnit, osmomath.NewDec(50), osmomath.OneDec().MulInt64(10*5), osmomath.OneDec().MulInt64(5), osmomath.ZeroDec()) @@ -198,7 +199,7 @@ func (s *UpgradeTestSuite) TestUpgrade() { lastPoolIdMinusOne := lastPoolID - 1 lastPoolIdMinusTwo := lastPoolID - 2 stakingParams := s.App.StakingKeeper.GetParams(s.Ctx) - stakingParams.BondDenom = "uosmo" + stakingParams.BondDenom = appparams.BaseCoinUnit s.App.StakingKeeper.SetParams(s.Ctx, stakingParams) // Retrieve the community pool balance before the upgrade @@ -376,7 +377,7 @@ func (s *UpgradeTestSuite) TestUpgrade() { func(keepers *keepers.AppKeepers, expectedCoinsUsedInUpgradeHandler sdk.Coins, lastPoolID uint64) { // Set the bond denom to uosmo stakingParams := s.App.StakingKeeper.GetParams(s.Ctx) - stakingParams.BondDenom = "uosmo" + stakingParams.BondDenom = appparams.BaseCoinUnit s.App.StakingKeeper.SetParams(s.Ctx, stakingParams) // Retrieve the community pool balance before the upgrade diff --git a/app/upgrades/v18/upgrades_test.go b/app/upgrades/v18/upgrades_test.go index a1faa48bdcf..c9a59f2d1a3 100644 --- a/app/upgrades/v18/upgrades_test.go +++ b/app/upgrades/v18/upgrades_test.go @@ -17,6 +17,7 @@ import ( "github.com/osmosis-labs/osmosis/v24/app/apptesting" v17 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v17" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" gammmigration "github.com/osmosis-labs/osmosis/v24/x/gamm/types/migration" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" protorevtypes "github.com/osmosis-labs/osmosis/v24/x/protorev/types" @@ -247,7 +248,7 @@ func (s *UpgradeTestSuite) ensurePreUpgradeDistributionPanics() { s.App.GAMMKeeper.SetMigrationRecords(s.Ctx, migrationInfo) // add new coins to the CL pool gauge so that it would be distributed after epoch ends then trigger panic - coinsToAdd := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000))) + coinsToAdd := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000))) gagueId, err := s.App.PoolIncentivesKeeper.GetPoolGaugeId(s.Ctx, clPool.GetId(), epochInfo.Duration) s.Require().NoError(err) gauge, err := s.App.IncentivesKeeper.GetGaugeByID(s.Ctx, gagueId) diff --git a/app/upgrades/v21/upgrades.go b/app/upgrades/v21/upgrades.go index 53e5b6a1bb4..1846dfb6b50 100644 --- a/app/upgrades/v21/upgrades.go +++ b/app/upgrades/v21/upgrades.go @@ -15,6 +15,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/v24/app/keepers" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/app/upgrades" concentratedliquiditytypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types" @@ -149,7 +150,7 @@ func CreateUpgradeHandler( // Set expedited proposal param: govParams := keepers.GovKeeper.GetParams(ctx) - govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(5000000000))) + govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(5000000000))) govParams.MinInitialDepositRatio = "0.250000000000000000" err = keepers.GovKeeper.SetParams(ctx, govParams) if err != nil { diff --git a/app/upgrades/v22/upgrades_test.go b/app/upgrades/v22/upgrades_test.go index 83f881cc4de..46a9bcfeb4b 100644 --- a/app/upgrades/v22/upgrades_test.go +++ b/app/upgrades/v22/upgrades_test.go @@ -12,6 +12,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/protorev/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -34,8 +35,8 @@ func TestUpgradeTestSuite(t *testing.T) { func (s *UpgradeTestSuite) TestUpgrade() { s.Setup() - expectedTakerFeeForStakers := []sdk.Coin{sdk.NewCoin("uakt", osmomath.NewInt(3000)), sdk.NewCoin("uatom", osmomath.NewInt(1000)), sdk.NewCoin("uosmo", osmomath.NewInt(2000))} - expectedTakerFeeForCommunityPool := []sdk.Coin{sdk.NewCoin("uakt", osmomath.NewInt(2000)), sdk.NewCoin("uatom", osmomath.NewInt(3000)), sdk.NewCoin("uosmo", osmomath.NewInt(1000))} + expectedTakerFeeForStakers := []sdk.Coin{sdk.NewCoin("uakt", osmomath.NewInt(3000)), sdk.NewCoin("uatom", osmomath.NewInt(1000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000))} + expectedTakerFeeForCommunityPool := []sdk.Coin{sdk.NewCoin("uakt", osmomath.NewInt(2000)), sdk.NewCoin("uatom", osmomath.NewInt(3000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000))} expectedTrackerStartHeight := int64(3) // Set up old protorev tracker prior to upgrade diff --git a/app/upgrades/v23/upgrades_test.go b/app/upgrades/v23/upgrades_test.go index 7fa2b7789a1..a062ab4c981 100644 --- a/app/upgrades/v23/upgrades_test.go +++ b/app/upgrades/v23/upgrades_test.go @@ -13,6 +13,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" concentratedtypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" ) @@ -55,14 +56,14 @@ func (s *UpgradeTestSuite) TestUpgrade() { concentratedPoolIDs = append(concentratedPoolIDs, secondLastPoolID) concentratedPoolIDs = append(concentratedPoolIDs, lastPoolID) s.CreateConcentratedPoolsAndFullRangePosition([][]string{ - {"uion", "uosmo"}, + {"uion", appparams.BaseCoinUnit}, {apptesting.ETH, apptesting.USDC}, }) lastPoolPositionID := s.App.ConcentratedLiquidityKeeper.GetNextPositionId(s.Ctx) - 1 // Create incentive record for last pool - incentiveCoin := sdk.NewCoin("uosmo", sdk.NewInt(1000000)) + incentiveCoin := sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000)) _, err := s.App.ConcentratedLiquidityKeeper.CreateIncentive(s.Ctx, lastPoolID, s.TestAccs[0], incentiveCoin, osmomath.OneDec(), s.Ctx.BlockTime(), concentratedtypes.DefaultAuthorizedUptimes[0]) s.Require().NoError(err) diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go index 324850dea4d..da6177aae77 100644 --- a/app/upgrades/v24/upgrades_test.go +++ b/app/upgrades/v24/upgrades_test.go @@ -20,6 +20,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" v24 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v24" concentratedtypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" incentivestypes "github.com/osmosis-labs/osmosis/v24/x/incentives/types" @@ -123,14 +124,14 @@ func (s *UpgradeTestSuite) TestUpgrade() { concentratedPoolIDs = append(concentratedPoolIDs, secondLastPoolID) concentratedPoolIDs = append(concentratedPoolIDs, lastPoolID) s.CreateConcentratedPoolsAndFullRangePosition([][]string{ - {"uion", "uosmo"}, + {"uion", appparams.BaseCoinUnit}, {apptesting.ETH, apptesting.USDC}, }) lastPoolPositionID := s.App.ConcentratedLiquidityKeeper.GetNextPositionId(s.Ctx) - 1 // Create incentive record for last pool - incentiveCoin := sdk.NewCoin("uosmo", sdk.NewInt(1000000)) + incentiveCoin := sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000)) _, err = s.App.ConcentratedLiquidityKeeper.CreateIncentive(s.Ctx, lastPoolID, s.TestAccs[0], incentiveCoin, osmomath.OneDec(), s.Ctx.BlockTime(), concentratedtypes.DefaultAuthorizedUptimes[0]) s.Require().NoError(err) diff --git a/app/upgrades/v3/forks.go b/app/upgrades/v3/forks.go index d12aa613bbc..76a94784599 100644 --- a/app/upgrades/v3/forks.go +++ b/app/upgrades/v3/forks.go @@ -23,7 +23,7 @@ func RunForkLogic(ctx sdk.Context, keepers *keepers.AppKeepers) { func FixMinDepositDenom(ctx sdk.Context, gov *govkeeper.Keeper) { // UNFORKINGNOTE: GetDepositParams no longer exists, keeping commented for historical purposes // params := gov.GetDepositParams(ctx) - // params.MinDeposit = sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(500000000))) + // params.MinDeposit = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500000000))) // gov.SetDepositParams(ctx, params) } diff --git a/app/upgrades/v4/prop12.go b/app/upgrades/v4/prop12.go index d4882e229a4..190024a8176 100644 --- a/app/upgrades/v4/prop12.go +++ b/app/upgrades/v4/prop12.go @@ -8,6 +8,8 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) func Prop12(ctx sdk.Context, bank bankkeeper.Keeper, distr *distrkeeper.Keeper) { @@ -26,7 +28,7 @@ func Prop12(ctx sdk.Context, bank bankkeeper.Keeper, distr *distrkeeper.Keeper) panic(err) } - coins := sdk.NewCoins(sdk.NewInt64Coin("uosmo", amount)) + coins := sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, amount)) if err := bank.SendCoinsFromModuleToAccount(ctx, "distribution", addr, coins); err != nil { panic(err) } @@ -35,6 +37,6 @@ func Prop12(ctx sdk.Context, bank bankkeeper.Keeper, distr *distrkeeper.Keeper) // deduct from the feePool tracker feePool := distr.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Sub(sdk.NewDecCoins(sdk.NewInt64DecCoin("uosmo", total))) + feePool.CommunityPool = feePool.CommunityPool.Sub(sdk.NewDecCoins(sdk.NewInt64DecCoin(appparams.BaseCoinUnit, total))) distr.SetFeePool(ctx, feePool) } diff --git a/app/upgrades/v4/upgrade_test.go b/app/upgrades/v4/upgrade_test.go index d4719b219fa..d411aa570e2 100644 --- a/app/upgrades/v4/upgrade_test.go +++ b/app/upgrades/v4/upgrade_test.go @@ -16,6 +16,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) type UpgradeTestSuite struct { @@ -50,7 +52,7 @@ func (s *UpgradeTestSuite) TestUpgradePayments() { // mint coins to distribution module / feepool.communitypool bal := int64(1000000000000) - coin := sdk.NewInt64Coin("uosmo", bal) + coin := sdk.NewInt64Coin(appparams.BaseCoinUnit, bal) coins := sdk.NewCoins(coin) err := s.app.BankKeeper.MintCoins(s.ctx, "mint", coins) s.Require().NoError(err) @@ -85,9 +87,9 @@ func (s *UpgradeTestSuite) TestUpgradePayments() { s.Require().NoError(err) amount, err := strconv.ParseInt(strings.TrimSpace(payment[1]), 10, 64) s.Require().NoError(err) - coin := sdk.NewInt64Coin("uosmo", amount) + coin := sdk.NewInt64Coin(appparams.BaseCoinUnit, amount) - accBal := s.app.BankKeeper.GetBalance(s.ctx, addr, "uosmo") + accBal := s.app.BankKeeper.GetBalance(s.ctx, addr, appparams.BaseCoinUnit) s.Require().Equal(coin, accBal) total += amount @@ -100,18 +102,18 @@ func (s *UpgradeTestSuite) TestUpgradePayments() { // check that distribution module account balance has been reduced correctly distAddr := s.app.AccountKeeper.GetModuleAddress("distribution") - distBal := s.app.BankKeeper.GetBalance(s.ctx, distAddr, "uosmo") - s.Require().Equal(distBal, sdk.NewInt64Coin("uosmo", expectedBal)) + distBal := s.app.BankKeeper.GetBalance(s.ctx, distAddr, appparams.BaseCoinUnit) + s.Require().Equal(distBal, sdk.NewInt64Coin(appparams.BaseCoinUnit, expectedBal)) // check that feepool.communitypool has been reduced correctly feePool := s.app.DistrKeeper.GetFeePool(s.ctx) - s.Require().Equal(feePool.GetCommunityPool(), sdk.NewDecCoins(sdk.NewInt64DecCoin("uosmo", expectedBal))) + s.Require().Equal(feePool.GetCommunityPool(), sdk.NewDecCoins(sdk.NewInt64DecCoin(appparams.BaseCoinUnit, expectedBal))) // Check that gamm Minimum Fee has been set correctly // Kept as comments for recordkeeping. Since SetParams is now private, the changes being tested for can no longer be made: // gammParams := s.app.GAMMKeeper.GetParams(suite.ctx) - // expectedCreationFee := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.OneInt())) + // expectedCreationFee := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.OneInt())) // s.Require().Equal(gammParams.PoolCreationFee, expectedCreationFee) }, true, diff --git a/app/upgrades/v4/upgrades.go b/app/upgrades/v4/upgrades.go index 73ecfc0f082..a7197fe2e21 100644 --- a/app/upgrades/v4/upgrades.go +++ b/app/upgrades/v4/upgrades.go @@ -22,7 +22,7 @@ func CreateUpgradeHandler( ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { // Kept as comments for recordkeeping. SetParams is now private: - // keepers.GAMMKeeper.SetParams(ctx, gammtypes.NewParams(sdk.Coins{sdk.NewInt64Coin("uosmo", 1)})) // 1 uOSMO + // keepers.GAMMKeeper.SetParams(ctx, gammtypes.NewParams(sdk.Coins{sdk.NewInt64Coin(appparams.BaseCoinUnit, 1)})) // 1 uOSMO Prop12(ctx, keepers.BankKeeper, keepers.DistrKeeper) diff --git a/ingest/sqs/pools/transformer/pool_transformer.go b/ingest/sqs/pools/transformer/pool_transformer.go index 966b8b88d24..3119954c63b 100644 --- a/ingest/sqs/pools/transformer/pool_transformer.go +++ b/ingest/sqs/pools/transformer/pool_transformer.go @@ -15,6 +15,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/ingest/sqs/domain" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/client/queryproto" concentratedtypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" @@ -46,7 +47,7 @@ type denomRoutingInfo struct { } const ( - UOSMO = "uosmo" + UOSMO = appparams.BaseCoinUnit uosmoPrecision = 6 noTokenPrecisionErrorFmtStr = "error getting token precision %s" @@ -72,7 +73,7 @@ var ( oneOsmoInt = osmomath.NewInt(oneOSMO) oneOsmoBigDec = osmomath.NewBigDec(oneOSMO) - oneOsmoCoin = sdk.NewCoin(UOSMO, oneOsmoInt) + oneOsmoCoin = sdk.NewCoin(appparams.BaseCoinUnit, oneOsmoInt) ) // These are the routes that we use for pricing certain tokens against OSMO diff --git a/simulation/simtypes/legacy.go b/simulation/simtypes/legacy.go index 59f73692e8b..249ed048560 100644 --- a/simulation/simtypes/legacy.go +++ b/simulation/simtypes/legacy.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" - "github.com/osmosis-labs/osmosis/v24/app/params" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) // TODO: Must delete @@ -39,7 +39,7 @@ func GenAndDeliverTxWithRandFees( } // Only allow fees in "uosmo" - coins = sdk.NewCoins(sdk.NewCoin("uosmo", coins.AmountOf("uosmo"))) + coins = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, coins.AmountOf(appparams.BaseCoinUnit))) fees, err = simulation.RandomFees(r, ctx, coins) if err != nil { @@ -74,7 +74,7 @@ func GenAndDeliverTx( return simulation.NoOpMsg(moduleName, msg.Type(), "unable to generate mock tx"), nil, err } - txConfig := params.MakeEncodingConfig().TxConfig + txConfig := appparams.MakeEncodingConfig().TxConfig txBytes, err := txConfig.TxEncoder()(tx) if err != nil { return simulation.OperationMsg{}, nil, err diff --git a/tests/e2e/configurer/upgrade.go b/tests/e2e/configurer/upgrade.go index 3b5a23edc48..5d8971c1bb4 100644 --- a/tests/e2e/configurer/upgrade.go +++ b/tests/e2e/configurer/upgrade.go @@ -269,7 +269,7 @@ func (uc *UpgradeConfigurer) CreatePreUpgradeState() error { go func() { defer wg.Done() // test swap exact amount in for stable swap pool - chainANode.SwapExactAmountIn("2000stake", "1", fmt.Sprintf("%d", config.PreUpgradeStableSwapPoolId[0]), "uosmo", config.StableswapWallet[0]) + chainANode.SwapExactAmountIn("2000stake", "1", fmt.Sprintf("%d", config.PreUpgradeStableSwapPoolId[0]), appparams.BaseCoinUnit, config.StableswapWallet[0]) }() go func() { @@ -290,7 +290,7 @@ func (uc *UpgradeConfigurer) CreatePreUpgradeState() error { go func() { defer wg.Done() // test swap exact amount in for stable swap pool - chainBNode.SwapExactAmountIn("2000stake", "1", fmt.Sprintf("%d", config.PreUpgradeStableSwapPoolId[1]), "uosmo", config.StableswapWallet[1]) + chainBNode.SwapExactAmountIn("2000stake", "1", fmt.Sprintf("%d", config.PreUpgradeStableSwapPoolId[1]), appparams.BaseCoinUnit, config.StableswapWallet[1]) }() go func() { diff --git a/tests/e2e/e2e_cl_test.go b/tests/e2e/e2e_cl_test.go index 1bc8b63bc38..1cdaf833fcc 100644 --- a/tests/e2e/e2e_cl_test.go +++ b/tests/e2e/e2e_cl_test.go @@ -15,6 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/tests/e2e/configurer/chain" "github.com/osmosis-labs/osmosis/v24/tests/e2e/initialization" clmath "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/math" @@ -36,7 +37,7 @@ func (s *IntegrationTestSuite) CreateConcentratedLiquidityPoolVoting_And_TWAP() var ( expectedDenom0 = "stake" - expectedDenom1 = "uosmo" + expectedDenom1 = appparams.BaseCoinUnit expectedTickspacing = uint64(100) expectedSpreadFactor = "0.001000000000000000" ) @@ -135,7 +136,7 @@ func (s *IntegrationTestSuite) CreateConcentratedLiquidityPoolVoting_And_TWAP() func (s *IntegrationTestSuite) ConcentratedLiquidity() { var ( denom0 = "uion" - denom1 = "uosmo" + denom1 = appparams.BaseCoinUnit tickSpacing uint64 = 100 spreadFactor = "0.001" // 0.1% spreadFactorDec = osmomath.MustNewDecFromStr("0.001") @@ -325,16 +326,16 @@ func (s *IntegrationTestSuite) ConcentratedLiquidity() { // Determine forfeited dust amount forfeitedDustAmt := spreadRewardsUncollectedAddress1Position1_Swap1.Sub(spreadRewardsUncollectedAddress1Position1_Swap1.TruncateDec()) - forfeitedDust := sdk.NewDecCoins(sdk.NewDecCoinFromDec("uosmo", forfeitedDustAmt)) + forfeitedDust := sdk.NewDecCoins(sdk.NewDecCoinFromDec(appparams.BaseCoinUnit, forfeitedDustAmt)) forfeitedDustPerShare := forfeitedDust.QuoDecTruncate(totalLiquidity) // Add forfeited dust back to the global spread reward growth - spreadRewardGrowthGlobal.AddMut(forfeitedDustPerShare.AmountOf("uosmo")) + spreadRewardGrowthGlobal.AddMut(forfeitedDustPerShare.AmountOf(appparams.BaseCoinUnit)) // Assert s.Require().Equal( - addr1BalancesBefore.AmountOf("uosmo").Add(spreadRewardsUncollectedAddress1Position1_Swap1.TruncateInt()).String(), - addr1BalancesAfter.AmountOf("uosmo").String(), + addr1BalancesBefore.AmountOf(appparams.BaseCoinUnit).Add(spreadRewardsUncollectedAddress1Position1_Swap1.TruncateInt()).String(), + addr1BalancesAfter.AmountOf(appparams.BaseCoinUnit).String(), ) // Swap 2 @@ -447,8 +448,8 @@ func (s *IntegrationTestSuite) ConcentratedLiquidity() { // Assert s.Require().Equal( - addr1BalancesBefore.AmountOf("uosmo").Add(spreadRewardsUncollectedAddress1Position1_Swap2.TruncateInt()), - addr1BalancesAfter.AmountOf("uosmo"), + addr1BalancesBefore.AmountOf(appparams.BaseCoinUnit).Add(spreadRewardsUncollectedAddress1Position1_Swap2.TruncateInt()), + addr1BalancesAfter.AmountOf(appparams.BaseCoinUnit), ) // Assert that address3 position2 earned rewards from first and second swaps @@ -481,8 +482,8 @@ func (s *IntegrationTestSuite) ConcentratedLiquidity() { // Assert s.Require().Equal( - addr3BalancesBefore.AmountOf("uosmo").Add(totalUncollectedSpreadRewardsAddress3Position2.TruncateInt()), - addr3BalancesAfter.AmountOf("uosmo"), + addr3BalancesBefore.AmountOf(appparams.BaseCoinUnit).Add(totalUncollectedSpreadRewardsAddress3Position2.TruncateInt()), + addr3BalancesAfter.AmountOf(appparams.BaseCoinUnit), ) // Swap 3 @@ -681,7 +682,7 @@ func (s *IntegrationTestSuite) ConcentratedLiquidity() { func (s *IntegrationTestSuite) TickSpacingUpdateProp() { var ( denom0 = "uion" - denom1 = "uosmo" + denom1 = appparams.BaseCoinUnit tickSpacing uint64 = 100 spreadFactor = "0.001" // 0.1% ) @@ -777,7 +778,7 @@ func (s *IntegrationTestSuite) assertBalancesInvariants(balancesBefore, balances s.Require().True(balancesAfter.AmountOf("uion").Equal(balancesBefore.AmountOf("uion"))) } if assertUosmoBalanceIsConstant { - s.Require().True(balancesAfter.AmountOf("uosmo").Equal(balancesBefore.AmountOf("uosmo"))) + s.Require().True(balancesAfter.AmountOf(appparams.BaseCoinUnit).Equal(balancesBefore.AmountOf(appparams.BaseCoinUnit))) } } diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index ef0f7cc132b..7479a04cedf 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -27,6 +27,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/tests/e2e/configurer/chain" "github.com/osmosis-labs/osmosis/v24/tests/e2e/configurer/config" "github.com/osmosis-labs/osmosis/v24/tests/e2e/initialization" @@ -224,7 +225,7 @@ func (s *IntegrationTestSuite) ProtoRev() { supportedBaseDenoms, err := chainANode.QueryProtoRevBaseDenoms() s.Require().NoError(err) s.Require().Len(supportedBaseDenoms, 1, "protorev module should only have uosmo as a supported base denom on init") - s.Require().Equal(supportedBaseDenoms[0].Denom, "uosmo", "protorev module should only have uosmo as a supported base denom on init") + s.Require().Equal(supportedBaseDenoms[0].Denom, appparams.BaseCoinUnit, "protorev module should only have uosmo as a supported base denom on init") s.T().Logf("completed protorev module init checks") @@ -299,7 +300,7 @@ func (s *IntegrationTestSuite) StableSwap() { const ( denomA = "stake" - denomB = "uosmo" + denomB = appparams.BaseCoinUnit minAmountOut = "1" ) @@ -340,7 +341,7 @@ func (s *IntegrationTestSuite) GeometricTwapMigration() { sender := chainABNode.GetWallet(initialization.ValidatorWalletName) - uosmoIn := fmt.Sprintf("1000000%s", "uosmo") + uosmoIn := fmt.Sprintf("1000000%s", appparams.BaseCoinUnit) swapWalletAddr := chainABNode.CreateWallet(migrationWallet, chainAB) @@ -468,7 +469,7 @@ func (s *IntegrationTestSuite) IBCTokenTransferRateLimiting() { param := chainANode.QueryParams(ibcratelimittypes.ModuleName, string(ibcratelimittypes.KeyContractAddress)) fmt.Println("param", param) - osmoSupply, err := chainANode.QuerySupplyOf("uosmo") + osmoSupply, err := chainANode.QuerySupplyOf(appparams.BaseCoinUnit) s.Require().NoError(err) f, err := osmoSupply.ToLegacyDec().Float64() @@ -539,12 +540,12 @@ func (s *IntegrationTestSuite) IBCWasmHooks() { transferAmount := int64(10) validatorAddr := chainBNode.GetWallet(initialization.ValidatorWalletName) fmt.Println("Sending IBC transfer IBCWasmHooks") - coin := sdk.NewCoin("uosmo", osmomath.NewInt(transferAmount)) + coin := sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(transferAmount)) chainBNode.SendIBCTransfer(chainA, validatorAddr, contractAddr, fmt.Sprintf(`{"wasm":{"contract":"%s","msg": {"increment": {}} }}`, contractAddr), coin) // check the balance of the contract - denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", "uosmo")) + denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", "channel-0", appparams.BaseCoinUnit)) ibcDenom := denomTrace.IBCDenom() s.CallCheckBalance(chainANode, contractAddr, ibcDenom, transferAmount) @@ -614,11 +615,11 @@ func (s *IntegrationTestSuite) PacketForwarding() { forwardMemo, err := json.Marshal(memoData) s.NoError(err) // Send the transfer from chainA to chainB. ChainB will parse the memo and forward the packet back to chainA - coin := sdk.NewCoin("uosmo", osmomath.NewInt(transferAmount)) + coin := sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(transferAmount)) chainANode.SendIBCTransfer(chainB, validatorAddr, validatorAddr, string(forwardMemo), coin) // check the balance of the contract - s.CallCheckBalance(chainANode, contractAddr, "uosmo", transferAmount) + s.CallCheckBalance(chainANode, contractAddr, appparams.BaseCoinUnit, transferAmount) // Getting the sender as set by PFM senderStr := fmt.Sprintf("channel-0/%s", validatorAddr) @@ -701,7 +702,7 @@ func (s *IntegrationTestSuite) ArithmeticTWAP() { denomA = "stake" denomB = "uion" - denomC = "uosmo" + denomC = appparams.BaseCoinUnit minAmountOut = "1" @@ -883,7 +884,7 @@ func (s *IntegrationTestSuite) ExpeditedProposals() { "metadata": "%s", "deposit": "%s", "expedited": true -}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin("uosmo", math.NewInt(5000000000))) +}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(appparams.BaseCoinUnit, math.NewInt(5000000000))) propNumber := chainABNode.SubmitNewV1ProposalType(validProp, sender) @@ -928,8 +929,8 @@ func (s *IntegrationTestSuite) GeometricTWAP() { poolFile = "geometricPool.json" walletName = "geometric-twap-wallet" - denomA = "uosmo" // 1_000_000 uosmo - denomB = "stake" // 2_000_000 stake + denomA = appparams.BaseCoinUnit // 1_000_000 uosmo + denomB = "stake" // 2_000_000 stake minAmountOut = "1" ) @@ -1065,7 +1066,7 @@ func (s *IntegrationTestSuite) SetExpeditedVotingPeriodChainA() { "metadata": "%s", "deposit": "%s", "expedited": false -}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin("uosmo", math.NewInt(10000000))) +}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(appparams.BaseCoinUnit, math.NewInt(10000000))) proposalID := chainANode.SubmitNewV1ProposalType(validProp, sender) @@ -1124,7 +1125,7 @@ func (s *IntegrationTestSuite) SetExpeditedVotingPeriodChainB() { "metadata": "%s", "deposit": "%s", "expedited": false -}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin("uosmo", math.NewInt(10000000))) +}`, govModuleAccount, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(appparams.BaseCoinUnit, math.NewInt(10000000))) proposalID := chainBNode.SubmitNewV1ProposalType(validProp, sender) diff --git a/tests/e2e/initialization/config.go b/tests/e2e/initialization/config.go index 2b90cfc0d1d..7c2e3493546 100644 --- a/tests/e2e/initialization/config.go +++ b/tests/e2e/initialization/config.go @@ -20,6 +20,7 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v24/x/gamm/types" incentivestypes "github.com/osmosis-labs/osmosis/v24/x/incentives/types" @@ -52,7 +53,7 @@ type NodeConfig struct { const ( // common - OsmoDenom = "uosmo" + OsmoDenom = appparams.BaseCoinUnit IonDenom = "uion" StakeDenom = "stake" AtomDenom = "uatom" @@ -409,7 +410,7 @@ func updateTxfeesGenesis(txfeesGenState *txfeestypes.GenesisState) { func updateGammGenesis(gammGenState *gammtypes.GenesisState) { gammGenState.Params.PoolCreationFee = tenOsmo // setup fee pool, between "e2e_default_fee_token" and "uosmo" - uosmoFeeTokenPool := setupPool(1, "uosmo", E2EFeeToken) + uosmoFeeTokenPool := setupPool(1, appparams.BaseCoinUnit, E2EFeeToken) gammGenState.Pools = []*types1.Any{uosmoFeeTokenPool} diff --git a/tests/ibc-hooks/ibc_middleware_test.go b/tests/ibc-hooks/ibc_middleware_test.go index ab74e6243c6..e68ef70d3d0 100644 --- a/tests/ibc-hooks/ibc_middleware_test.go +++ b/tests/ibc-hooks/ibc_middleware_test.go @@ -3,12 +3,15 @@ package ibc_hooks_test import ( "encoding/json" "fmt" - abcitypes "github.com/cometbft/cometbft/abci/types" - "golang.org/x/exp/slices" "strings" "testing" "time" + abcitypes "github.com/cometbft/cometbft/abci/types" + "golang.org/x/exp/slices" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" + "github.com/tidwall/gjson" "github.com/CosmWasm/wasmd/x/wasm/types" @@ -761,7 +764,7 @@ func (suite *HooksTestSuite) SetupCrosschainSwaps(chainName Chain, setupForwardi bankKeeper := chain.GetOsmosisApp().BankKeeper i, ok := osmomath.NewIntFromString("20000000000000000000000") suite.Require().True(ok) - amounts := sdk.NewCoins(sdk.NewCoin("uosmo", i), sdk.NewCoin(sdk.DefaultBondDenom, i), sdk.NewCoin("token0", i), sdk.NewCoin("token1", i)) + amounts := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, i), sdk.NewCoin(sdk.DefaultBondDenom, i), sdk.NewCoin("token0", i), sdk.NewCoin("token1", i)) err := bankKeeper.MintCoins(chain.GetContext(), minttypes.ModuleName, amounts) suite.Require().NoError(err) err = bankKeeper.SendCoinsFromModuleToAccount(chain.GetContext(), minttypes.ModuleName, owner, amounts) @@ -805,7 +808,7 @@ func (suite *HooksTestSuite) fundAccount(chain *osmosisibctesting.TestChain, own bankKeeper := chain.GetOsmosisApp().BankKeeper i, ok := osmomath.NewIntFromString("20000000000000000000000") suite.Require().True(ok) - amounts := sdk.NewCoins(sdk.NewCoin("uosmo", i), sdk.NewCoin(sdk.DefaultBondDenom, i), sdk.NewCoin("token0", i), sdk.NewCoin("token1", i)) + amounts := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, i), sdk.NewCoin(sdk.DefaultBondDenom, i), sdk.NewCoin("token0", i), sdk.NewCoin("token1", i)) err := bankKeeper.MintCoins(chain.GetContext(), minttypes.ModuleName, amounts) suite.Require().NoError(err) err = bankKeeper.SendCoinsFromModuleToAccount(chain.GetContext(), minttypes.ModuleName, owner, amounts) diff --git a/wasmbinding/query_plugin_test.go b/wasmbinding/query_plugin_test.go index d211ff0734f..c9eb804f5ef 100644 --- a/wasmbinding/query_plugin_test.go +++ b/wasmbinding/query_plugin_test.go @@ -25,6 +25,7 @@ import ( gammv2types "github.com/osmosis-labs/osmosis/v24/x/gamm/v2types" "github.com/osmosis-labs/osmosis/v24/app" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" epochtypes "github.com/osmosis-labs/osmosis/x/epochs/types" @@ -88,7 +89,7 @@ func (suite *StargateTestSuite) TestStargateQuerier() { queryrequest := gammv2types.QuerySpotPriceRequest{ //nolint:staticcheck // we're intentionally using this deprecated package for testing PoolId: 1, BaseAssetDenom: "bar", - QuoteAssetDenom: "uosmo", + QuoteAssetDenom: appparams.BaseCoinUnit, } bz, err := proto.Marshal(&queryrequest) suite.Require().NoError(err) @@ -117,7 +118,7 @@ func (suite *StargateTestSuite) TestStargateQuerier() { queryrequest := gammv2types.QuerySpotPriceRequest{ //nolint:staticcheck // we're intentionally using this deprecated package for testing PoolId: 1, BaseAssetDenom: "bar", - QuoteAssetDenom: "uosmo", + QuoteAssetDenom: appparams.BaseCoinUnit, } bz, err := proto.Marshal(&queryrequest) suite.Require().NoError(err) diff --git a/wasmbinding/test/helpers_test.go b/wasmbinding/test/helpers_test.go index 6a7bc990d81..84111ab140f 100644 --- a/wasmbinding/test/helpers_test.go +++ b/wasmbinding/test/helpers_test.go @@ -15,6 +15,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) func CreateTestInput() (*app.OsmosisApp, sdk.Context) { @@ -26,7 +27,7 @@ func CreateTestInput() (*app.OsmosisApp, sdk.Context) { func FundAccount(t *testing.T, ctx sdk.Context, osmosis *app.OsmosisApp, acct sdk.AccAddress) { t.Helper() err := testutil.FundAccount(osmosis.BankKeeper, ctx, acct, sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), )) require.NoError(t, err) } diff --git a/wasmbinding/test/queries_test.go b/wasmbinding/test/queries_test.go index fc1f1b6578b..0be1a610c86 100644 --- a/wasmbinding/test/queries_test.go +++ b/wasmbinding/test/queries_test.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/wasmbinding" ) @@ -94,7 +95,7 @@ func TestDenomAdmin(t *testing.T) { }, { name: "invalid token factory denom", - denom: "uosmo", + denom: appparams.BaseCoinUnit, expectErr: false, expectAdmin: "", }, diff --git a/wasmbinding/test/store_run_test.go b/wasmbinding/test/store_run_test.go index 3e582eb5eae..3cd84683a29 100644 --- a/wasmbinding/test/store_run_test.go +++ b/wasmbinding/test/store_run_test.go @@ -17,6 +17,7 @@ import ( "github.com/osmosis-labs/osmosis/v24/app" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) func TestNoStorageWithoutProposal(t *testing.T) { @@ -107,7 +108,7 @@ func TestInstantiateContract(t *testing.T) { initMsgBz, err := json.Marshal(initMsg) require.NoError(t, err) - funds := sdk.NewInt64Coin("uosmo", 123456) + funds := sdk.NewInt64Coin(appparams.BaseCoinUnit, 123456) _, _, err = contractKeeper.Instantiate(ctx, codeID, instantiator, instantiator, initMsgBz, "demo contract", sdk.Coins{funds}) require.NoError(t, err) } diff --git a/x/concentrated-liquidity/bench_test.go b/x/concentrated-liquidity/bench_test.go index 3a9624efcb6..de391f7eaf6 100644 --- a/x/concentrated-liquidity/bench_test.go +++ b/x/concentrated-liquidity/bench_test.go @@ -12,6 +12,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" clmath "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/math" clmodel "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" @@ -82,7 +83,7 @@ func runBenchmark(b *testing.B, testFunc func(b *testing.B, s *BenchTestSuite, p testutil.FundAccount(s.App.BankKeeper, s.Ctx, acc, sdk.NewCoins( sdk.NewCoin(denom0, maxAmountOfEachToken), sdk.NewCoin(denom1, maxAmountOfEachToken), - sdk.NewCoin("uosmo", maxAmountOfEachToken), + sdk.NewCoin(appparams.BaseCoinUnit, maxAmountOfEachToken), )) } diff --git a/x/concentrated-liquidity/genesis_test.go b/x/concentrated-liquidity/genesis_test.go index 36cce61de6b..b255f28d344 100644 --- a/x/concentrated-liquidity/genesis_test.go +++ b/x/concentrated-liquidity/genesis_test.go @@ -13,6 +13,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/accum" osmoapp "github.com/osmosis-labs/osmosis/v24/app" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" clmodule "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/clmodule" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" @@ -98,7 +99,7 @@ var ( func accumRecordWithDefinedValues(accumRecord accum.Record, numShares osmomath.Dec, initAccumValue, unclaimedRewards osmomath.Int) accum.Record { accumRecord.NumShares = numShares accumRecord.AccumValuePerShare = sdk.NewDecCoins(sdk.NewDecCoin("uion", initAccumValue)) - accumRecord.UnclaimedRewardsTotal = sdk.NewDecCoins(sdk.NewDecCoin("uosmo", unclaimedRewards)) + accumRecord.UnclaimedRewardsTotal = sdk.NewDecCoins(sdk.NewDecCoin(appparams.BaseCoinUnit, unclaimedRewards)) return accumRecord } diff --git a/x/concentrated-liquidity/pool_test.go b/x/concentrated-liquidity/pool_test.go index c1445828c0c..158ac2aec24 100644 --- a/x/concentrated-liquidity/pool_test.go +++ b/x/concentrated-liquidity/pool_test.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" clmodel "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" @@ -559,7 +560,7 @@ func (s *KeeperTestSuite) TestGetTotalPoolLiquidity() { var ( defaultPoolCoinOne = sdk.NewCoin(USDC, osmomath.OneInt()) defaultPoolCoinTwo = sdk.NewCoin(ETH, osmomath.NewInt(2)) - nonPoolCool = sdk.NewCoin("uosmo", osmomath.NewInt(3)) + nonPoolCool = sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(3)) defaultCoins = sdk.NewCoins(defaultPoolCoinOne, defaultPoolCoinTwo) ) @@ -785,7 +786,7 @@ func (s *KeeperTestSuite) TestGetUserUnbondingPositions() { // - Ensure that the position accumulators are updated // - Ensures that the position 1 receives incentives but not position 2 func (s *KeeperTestSuite) TestMigrateAccumulatorToScalingFactor() { - const incentiveDenom = "uosmo" + const incentiveDenom = appparams.BaseCoinUnit var emissionRatePerSecDec = osmomath.OneDec() diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index 917bd2b1813..455c75ff229 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -13,6 +13,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils/accum" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/math" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" @@ -2021,7 +2022,7 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { denom0 = pool.GetToken0() denom1 = pool.GetToken1() rewardsPerSecond = osmomath.NewDec(1000) - incentiveCoin = sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000)) + incentiveCoin = sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000)) ) s.FundAcc(s.TestAccs[0], sdk.NewCoins(incentiveCoin)) @@ -2126,7 +2127,7 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { // Additive tolerance of 1 for each position. ExpectedAdditiveSpreadRewardTolerance: osmomath.OneDec().MulInt64(3), TotalSpreadRewards: expectedTotalSpreadRewards, - TotalIncentives: sdk.NewCoins(sdk.NewCoin("uosmo", expectedTotalIncentiveRewards.Ceil().TruncateInt())), + TotalIncentives: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, expectedTotalIncentiveRewards.Ceil().TruncateInt())), }) }) @@ -2155,7 +2156,7 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { // Additive tolerance of 1 for each position. ExpectedAdditiveSpreadRewardTolerance: osmomath.OneDec().MulInt64(3), TotalSpreadRewards: expectedTotalSpreadRewards, - TotalIncentives: sdk.NewCoins(sdk.NewCoin("uosmo", expectedTotalIncentiveRewards.Ceil().TruncateInt())), + TotalIncentives: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, expectedTotalIncentiveRewards.Ceil().TruncateInt())), }) }) @@ -2184,7 +2185,7 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { // Additive tolerance of 1 for each position. ExpectedAdditiveSpreadRewardTolerance: osmomath.OneDec().MulInt64(3), TotalSpreadRewards: expectedTotalSpreadRewards, - TotalIncentives: sdk.NewCoins(sdk.NewCoin("uosmo", expectedTotalIncentiveRewards.Ceil().TruncateInt())), + TotalIncentives: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, expectedTotalIncentiveRewards.Ceil().TruncateInt())), }) }) @@ -2227,7 +2228,7 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { // Additive tolerance of 1 for each position. ExpectedAdditiveSpreadRewardTolerance: osmomath.OneDec().MulInt64(3), TotalSpreadRewards: expectedTotalSpreadRewards, - TotalIncentives: sdk.NewCoins(sdk.NewCoin("uosmo", expectedTotalIncentiveRewards.Ceil().TruncateInt())), + TotalIncentives: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, expectedTotalIncentiveRewards.Ceil().TruncateInt())), }) }) diff --git a/x/concentrated-liquidity/spread_rewards_test.go b/x/concentrated-liquidity/spread_rewards_test.go index 72a634eff56..c9e732ac3c9 100644 --- a/x/concentrated-liquidity/spread_rewards_test.go +++ b/x/concentrated-liquidity/spread_rewards_test.go @@ -9,6 +9,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils/accum" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" clmath "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/math" clmodel "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" @@ -426,8 +427,8 @@ func (s *KeeperTestSuite) TestGetSpreadRewardGrowthOutside() { } func (s *KeeperTestSuite) TestCalculateSpreadRewardGrowth() { - defaultGeeFrowthGlobal := sdk.NewDecCoins(sdk.NewDecCoin("uosmo", osmomath.NewInt(10))) - defaultGeeFrowthOutside := sdk.NewDecCoins(sdk.NewDecCoin("uosmo", osmomath.NewInt(3))) + defaultGeeFrowthGlobal := sdk.NewDecCoins(sdk.NewDecCoin(appparams.BaseCoinUnit, osmomath.NewInt(10))) + defaultGeeFrowthOutside := sdk.NewDecCoins(sdk.NewDecCoin(appparams.BaseCoinUnit, osmomath.NewInt(3))) defaultSmallerTargetTick := int64(1) defaultCurrentTick := int64(2) diff --git a/x/concentrated-liquidity/types/gov_test.go b/x/concentrated-liquidity/types/gov_test.go index 664fd2fdde1..37b4f967b42 100644 --- a/x/concentrated-liquidity/types/gov_test.go +++ b/x/concentrated-liquidity/types/gov_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" ) @@ -14,19 +15,19 @@ func TestCreateConcentratedLiquidityPoolsProposalMarshalUnmarshal(t *testing.T) records := []types.PoolRecord{ { Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TickSpacing: 100, SpreadFactor: osmomath.MustNewDecFromStr("0.01"), }, { Denom0: "stake", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TickSpacing: 1000, SpreadFactor: osmomath.MustNewDecFromStr("0.02"), }, { Denom0: "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TickSpacing: 10, SpreadFactor: osmomath.MustNewDecFromStr("0.05"), @@ -110,7 +111,7 @@ func TestTickSpacingDecreaseProposalMarshalUnmarshal(t *testing.T) { func TestCreateConcentratedLiquidityPoolsProposal_ValidateBasic(t *testing.T) { baseRecord := types.PoolRecord{ Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TickSpacing: 100, SpreadFactor: osmomath.MustNewDecFromStr("0.01"), } diff --git a/x/concentrated-liquidity/types/params.go b/x/concentrated-liquidity/types/params.go index e74e43613bb..be5b6165212 100644 --- a/x/concentrated-liquidity/types/params.go +++ b/x/concentrated-liquidity/types/params.go @@ -9,6 +9,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) // Parameter store keys. @@ -49,7 +50,7 @@ func DefaultParams() Params { AuthorizedTickSpacing: AuthorizedTickSpacing, AuthorizedSpreadFactors: AuthorizedSpreadFactors, AuthorizedQuoteDenoms: []string{ - "uosmo", + appparams.BaseCoinUnit, "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", // ATOM "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", // DAI "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", // USDC diff --git a/x/cosmwasmpool/cosmwasm/msg/transmuter/transmuter_test.go b/x/cosmwasmpool/cosmwasm/msg/transmuter/transmuter_test.go index 438fff9a44f..ee3aa2a3a90 100644 --- a/x/cosmwasmpool/cosmwasm/msg/transmuter/transmuter_test.go +++ b/x/cosmwasmpool/cosmwasm/msg/transmuter/transmuter_test.go @@ -10,6 +10,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" incentivetypes "github.com/osmosis-labs/osmosis/v24/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" tokenfactorytypes "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types" @@ -29,7 +30,7 @@ var ( defaultPoolId = uint64(1) defaultAmount = osmomath.NewInt(100) initalDefaultSupply = sdk.NewCoins(sdk.NewCoin(denomA, defaultAmount), sdk.NewCoin(denomB, defaultAmount)) - uosmo = "uosmo" + uosmo = appparams.BaseCoinUnit defaultDenoms = []string{denomA, denomB} ) @@ -51,7 +52,7 @@ func (s *TransmuterSuite) TestFunctionalTransmuter() { ) // Set base denom - s.App.IncentivesKeeper.SetParam(s.Ctx, incentivetypes.KeyMinValueForDistr, sdk.NewCoin("uosmo", osmomath.NewInt(10000))) + s.App.IncentivesKeeper.SetParam(s.Ctx, incentivetypes.KeyMinValueForDistr, sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000))) // Create Transmuter pool transmuter := s.PrepareCosmWasmPool() diff --git a/x/gamm/client/cli/cli_test.go b/x/gamm/client/cli/cli_test.go index fe9f05c9f1e..6599a3b6925 100644 --- a/x/gamm/client/cli/cli_test.go +++ b/x/gamm/client/cli/cli_test.go @@ -17,6 +17,8 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) var testAddresses = osmoutils.CreateRandomAccounts(3) @@ -335,7 +337,7 @@ func TestGetCmdSpotPrice(t *testing.T) { Cmd: "1 uosmo ibc/111", ExpectedQuery: &types.QuerySpotPriceRequest{ PoolId: 1, - BaseAssetDenom: "uosmo", + BaseAssetDenom: appparams.BaseCoinUnit, QuoteAssetDenom: "ibc/111", }, }, diff --git a/x/gamm/keeper/gas_test.go b/x/gamm/keeper/gas_test.go index 5d06ec37c70..396d1a0e0d0 100644 --- a/x/gamm/keeper/gas_test.go +++ b/x/gamm/keeper/gas_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -66,7 +67,7 @@ func (s *KeeperTestSuite) TestJoinPoolGas() { // mint some assets to the accounts s.FundAcc(defaultAddr, sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000000)), sdk.NewCoin("foo", osmomath.NewInt(10000000000000000)), sdk.NewCoin("bar", osmomath.NewInt(10000000000000000)), sdk.NewCoin("baz", osmomath.NewInt(10000000000000000)), @@ -93,7 +94,7 @@ var tenInt = osmomath.NewInt(10) func (s *KeeperTestSuite) TestRepeatedJoinPoolDistinctDenom() { // mint some usomo to account s.FundAcc(defaultAddr, sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(1000000000000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000000000000)), )) // number of distinct denom to test diff --git a/x/gamm/keeper/genesis_test.go b/x/gamm/keeper/genesis_test.go index 56db53afed7..6ebdf66a314 100644 --- a/x/gamm/keeper/genesis_test.go +++ b/x/gamm/keeper/genesis_test.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" gammmigration "github.com/osmosis-labs/osmosis/v24/x/gamm/types/migration" @@ -73,7 +74,7 @@ func (s *KeeperTestSuite) TestGammInitGenesis() { liquidity, err := s.App.GAMMKeeper.GetTotalLiquidity(s.Ctx) s.Require().NoError(err) - expectedLiquidity := sdk.NewCoins(sdk.NewInt64Coin("bar", 15000000), sdk.NewInt64Coin("baz", 15000000), sdk.NewInt64Coin("foo", 15000000), sdk.NewInt64Coin("uosmo", 15000000)) + expectedLiquidity := sdk.NewCoins(sdk.NewInt64Coin("bar", 15000000), sdk.NewInt64Coin("baz", 15000000), sdk.NewInt64Coin("foo", 15000000), sdk.NewInt64Coin(appparams.BaseCoinUnit, 15000000)) s.Require().Equal(expectedLiquidity.String(), liquidity.String()) postInitGenMigrationRecords, err := s.App.GAMMKeeper.GetAllMigrationInfo(s.Ctx) @@ -87,7 +88,7 @@ func (s *KeeperTestSuite) TestGammExportGenesis() { acc1 := s.TestAccs[0] err := testutil.FundAccount(s.App.BankKeeper, ctx, acc1, sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewInt64Coin("foo", 100000), sdk.NewInt64Coin("bar", 100000), )) @@ -132,7 +133,7 @@ func (s *KeeperTestSuite) TestMarshalUnmarshalGenesis() { acc1 := s.TestAccs[0] err := testutil.FundAccount(s.App.BankKeeper, ctx, acc1, sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewInt64Coin("foo", 100000), sdk.NewInt64Coin("bar", 100000), )) diff --git a/x/gamm/keeper/grpc_query_test.go b/x/gamm/keeper/grpc_query_test.go index 3ce9e3d9769..e6a70493e6d 100644 --- a/x/gamm/keeper/grpc_query_test.go +++ b/x/gamm/keeper/grpc_query_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -107,25 +108,25 @@ func (s *KeeperTestSuite) TestCalcJoinPoolNoSwapShares() { { "valid uneven multi asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin("uosmo", osmomath.NewInt(5000000))), + sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(5000000))), nil, }, { "valid even multi asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(500000)), sdk.NewCoin("bar", osmomath.NewInt(1000000)), sdk.NewCoin("baz", osmomath.NewInt(1500000)), sdk.NewCoin("uosmo", osmomath.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(500000)), sdk.NewCoin("bar", osmomath.NewInt(1000000)), sdk.NewCoin("baz", osmomath.NewInt(1500000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000000))), nil, }, { "invalid single asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))), errors.New("no-swap joins require LP'ing with all assets in pool"), }, { "pool id does not exist", poolId + 1, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))), types.PoolDoesNotExistError{PoolId: poolId + 1}, }, { @@ -137,7 +138,7 @@ func (s *KeeperTestSuite) TestCalcJoinPoolNoSwapShares() { { "join pool with incorrect amount of assets", poolId, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10000)), sdk.NewCoin("bar", osmomath.NewInt(10000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000)), sdk.NewCoin("bar", osmomath.NewInt(10000))), errors.New("no-swap joins require LP'ing with all assets in pool"), }, } @@ -172,7 +173,7 @@ func (s *KeeperTestSuite) TestCalcJoinPoolNoSwapShares() { func (s *KeeperTestSuite) TestPoolsWithFilter() { var ( defaultAcctFunds sdk.Coins = sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin("foo", osmomath.NewInt(10000000)), sdk.NewCoin("bar", osmomath.NewInt(10000000)), sdk.NewCoin("baz", osmomath.NewInt(10000000)), @@ -371,25 +372,25 @@ func (s *KeeperTestSuite) TestCalcJoinPoolShares() { { "valid uneven multi asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin("uosmo", osmomath.NewInt(5000000))), + sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(5000000))), nil, }, { "valid even multi asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(500000)), sdk.NewCoin("bar", osmomath.NewInt(1000000)), sdk.NewCoin("baz", osmomath.NewInt(1500000)), sdk.NewCoin("uosmo", osmomath.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(500000)), sdk.NewCoin("bar", osmomath.NewInt(1000000)), sdk.NewCoin("baz", osmomath.NewInt(1500000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000000))), nil, }, { "valid single asset join test case", poolId, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))), nil, }, { "pool id does not exist", poolId + 1, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))), types.PoolDoesNotExistError{PoolId: poolId + 1}, }, { @@ -401,7 +402,7 @@ func (s *KeeperTestSuite) TestCalcJoinPoolShares() { { "join pool with incorrect amount of assets", poolId, - sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10000)), sdk.NewCoin("bar", osmomath.NewInt(10000))), + sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000)), sdk.NewCoin("bar", osmomath.NewInt(10000))), errors.New("balancer pool only supports LP'ing with one asset or all assets in pool"), }, } @@ -556,7 +557,7 @@ func (s *KeeperTestSuite) TestQueryTotalPoolLiquidity() { res, err := queryClient.TotalPoolLiquidity(gocontext.Background(), &types.QueryTotalPoolLiquidityRequest{PoolId: poolId}) s.Require().NoError(err) - expectedCoins := sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin("uosmo", osmomath.NewInt(5000000))) + expectedCoins := sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(5000000)), sdk.NewCoin("bar", osmomath.NewInt(5000000)), sdk.NewCoin("baz", osmomath.NewInt(5000000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(5000000))) s.Require().Equal(res.Liquidity, expectedCoins) } diff --git a/x/gamm/keeper/migrate_test.go b/x/gamm/keeper/migrate_test.go index d3d5e4f7237..aca4ed10bf5 100644 --- a/x/gamm/keeper/migrate_test.go +++ b/x/gamm/keeper/migrate_test.go @@ -10,6 +10,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" gammmigration "github.com/osmosis-labs/osmosis/v24/x/gamm/types/migration" poolincentivestypes "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types" @@ -25,7 +26,7 @@ var ( defaultDaiAmount, _ = osmomath.NewIntFromString("73000000000000000000000") defaultDenom0mount = osmomath.NewInt(10000000000) - desiredDenom0 = "uosmo" + desiredDenom0 = appparams.BaseCoinUnit desiredDenom0Coin = sdk.NewCoin(desiredDenom0, defaultDenom0mount) daiCoin = sdk.NewCoin(DAIIBCDenom, defaultDaiAmount) usdcCoin = sdk.NewCoin(USDCIBCDenom, defaultDaiAmount) @@ -398,7 +399,7 @@ func (s *KeeperTestSuite) TestReplaceMigrationRecords() { ClPoolId: 3, }, }, - overwriteBalancerDenom0: "uosmo", + overwriteBalancerDenom0: appparams.BaseCoinUnit, expectErr: true, }, { @@ -409,7 +410,7 @@ func (s *KeeperTestSuite) TestReplaceMigrationRecords() { ClPoolId: 3, }, }, - overwriteBalancerDenom1: "uosmo", + overwriteBalancerDenom1: appparams.BaseCoinUnit, expectErr: true, }, { diff --git a/x/gamm/keeper/msg_server_test.go b/x/gamm/keeper/msg_server_test.go index c3a4b9d6344..cb7f8d09915 100644 --- a/x/gamm/keeper/msg_server_test.go +++ b/x/gamm/keeper/msg_server_test.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/keeper" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" @@ -244,7 +245,7 @@ func (s *KeeperTestSuite) TestJoinPool_Events() { sdk.NewCoin("foo", osmomath.NewInt(tokenInMaxAmount)), sdk.NewCoin("bar", osmomath.NewInt(tokenInMaxAmount)), sdk.NewCoin("baz", osmomath.NewInt(tokenInMaxAmount)), - sdk.NewCoin("uosmo", osmomath.NewInt(tokenInMaxAmount)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(tokenInMaxAmount)), ), expectedAddLiquidityEvents: 1, expectedMessageEvents: 2, // 1 gamm + 1 event emitted by other keeper methods. @@ -338,7 +339,7 @@ func (s *KeeperTestSuite) TestExitPool_Events() { sdk.NewCoin("foo", osmomath.NewInt(int64Max)), sdk.NewCoin("bar", osmomath.NewInt(int64Max)), sdk.NewCoin("baz", osmomath.NewInt(int64Max)), - sdk.NewCoin("uosmo", osmomath.NewInt(int64Max)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(int64Max)), ), }) s.Require().NoError(err) diff --git a/x/gamm/keeper/pool_service_test.go b/x/gamm/keeper/pool_service_test.go index ef701e1c520..59a8a19fbea 100644 --- a/x/gamm/keeper/pool_service_test.go +++ b/x/gamm/keeper/pool_service_test.go @@ -11,6 +11,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" _ "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -41,7 +42,7 @@ var ( sdk.NewCoin("bar", osmomath.NewInt(10000)), ) defaultAcctFunds sdk.Coins = sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin("foo", osmomath.NewInt(10000000)), sdk.NewCoin("bar", osmomath.NewInt(10000000)), sdk.NewCoin("baz", osmomath.NewInt(10000000)), diff --git a/x/gamm/keeper/pool_test.go b/x/gamm/keeper/pool_test.go index 3b2c205751f..05fb9e8d901 100644 --- a/x/gamm/keeper/pool_test.go +++ b/x/gamm/keeper/pool_test.go @@ -41,7 +41,7 @@ var ( // s.Ctx, // acc, // sdk.NewCoins( -// sdk.NewCoin("uosmo", osmomath.NewInt(1000000000)), +// sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000)), // sdk.NewCoin("foo", osmomath.NewInt(1000)), // sdk.NewCoin("bar", osmomath.NewInt(1000)), // sdk.NewCoin("baz", osmomath.NewInt(1000)), @@ -116,7 +116,7 @@ var ( // coins[i] = sdk.Coin{denoms[i], amount} // } // coinOf[acc.String()] = coins -// coins = append(coins, sdk.NewCoin("uosmo", osmomath.NewInt(1000000000))) +// coins = append(coins, sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000))) // s.FundAcc( // s.App.BankKeeper, @@ -160,7 +160,7 @@ var ( // s.Ctx, // acc1, // sdk.NewCoins( -// sdk.NewCoin("uosmo", osmomath.NewInt(1000000000)), +// sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000)), // sdk.NewCoin("foo", osmomath.NewInt(1000)), // sdk.NewCoin("bar", osmomath.NewInt(1000)), // sdk.NewCoin("baz", osmomath.NewInt(1000)), @@ -200,7 +200,7 @@ var ( // s.Ctx, // acc1, // sdk.NewCoins( -// sdk.NewCoin("uosmo", osmomath.NewInt(1000000000)), +// sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000)), // sdk.NewCoin("foo", osmomath.NewInt(1000)), // sdk.NewCoin("bar", osmomath.NewInt(1000)), // sdk.NewCoin("baz", osmomath.NewInt(1000)), diff --git a/x/gamm/pool-models/balancer/pool_suite_test.go b/x/gamm/pool-models/balancer/pool_suite_test.go index 161d4e93b7a..d184457830c 100644 --- a/x/gamm/pool-models/balancer/pool_suite_test.go +++ b/x/gamm/pool-models/balancer/pool_suite_test.go @@ -14,6 +14,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" v10 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v10" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -33,7 +34,7 @@ const ( var ( oneTrillion = osmomath.NewInt(1e12) defaultOsmoPoolAsset = balancer.PoolAsset{ - Token: sdk.NewCoin("uosmo", oneTrillion), + Token: sdk.NewCoin(appparams.BaseCoinUnit, oneTrillion), Weight: osmomath.NewInt(100), } defaultAtomPoolAsset = balancer.PoolAsset{ @@ -83,7 +84,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ name: "single tokensIn - equal weights with zero spread factor", spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(2_499_999_968_750), }, { @@ -104,7 +105,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ name: "single tokensIn - equal weights with 0.01 spread factor", spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(2_487_500_000_000), }, { @@ -125,7 +126,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ name: "single tokensIn - equal weights with 0.99 spread factor", spreadFactor: osmomath.MustNewDecFromStr("0.99"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(1_262_500_000_000), }, { @@ -152,7 +153,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ Weight: osmomath.NewInt(300), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(321_875_000_000), }, { @@ -173,12 +174,12 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.ZeroDec(), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(500), }, defaultAtomPoolAsset, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(4_166_666_649_306), }, { @@ -199,12 +200,12 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(500), }, defaultAtomPoolAsset, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(4_159_722_200_000), }, { @@ -225,7 +226,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(200), }, { @@ -233,7 +234,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ Weight: osmomath.NewInt(1000), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(833_333_315_972), }, { @@ -254,7 +255,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.02"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(200), }, { @@ -262,7 +263,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ Weight: osmomath.NewInt(1000), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(819_444_430_000), }, { @@ -283,7 +284,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 156_736), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 156_736), Weight: osmomath.NewInt(200), }, { @@ -292,7 +293,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ }, }, // 156_736 * 3 / 4 = 117552 - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", (156_736*3)/4)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, (156_736*3)/4)), expectShares: osmomath.NewIntFromUint64(9_775_731_930_496_140_648), }, { @@ -313,7 +314,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.02"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 156_736), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 156_736), Weight: osmomath.NewInt(200), }, { @@ -322,7 +323,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ }, }, // 156_736 / 4 * 3 = 117552 - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 156_736/4*3)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 156_736/4*3)), expectShares: osmomath.NewIntFromUint64(9_644_655_900_000_000_000), }, { @@ -343,7 +344,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 500_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 500_000), Weight: osmomath.NewInt(100), }, { @@ -352,7 +353,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ }, }, // Increasing this by 1 would cause a panic due to pow iteration limit reached - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 499_990)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 499_990)), expectShares: osmomath.NewIntFromUint64(6_504_012_121_638_943_579), }, { @@ -374,7 +375,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 500_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 500_000), Weight: osmomath.NewInt(100), }, { @@ -382,7 +383,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ Weight: osmomath.NewInt(1000), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 499_999)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 499_999)), // pow iteration limit reached expectPanic: true, @@ -397,7 +398,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 500_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 500_000), Weight: osmomath.NewInt(100), }, { @@ -405,7 +406,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ Weight: osmomath.NewInt(1000), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 500_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 500_000)), expectShares: osmomath.NewIntFromUint64(6_504_099_261_800_144_638), expectPanic: true, }, @@ -424,7 +425,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1_000_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1_000_000_000_000), Weight: osmomath.NewInt(100), }, { @@ -433,7 +434,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ }, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), ), expectShares: osmomath.NewInt(50_000_000), }, @@ -444,7 +445,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 10_000_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 10_000_000_000_000), Weight: osmomath.NewInt(100), }, { @@ -453,7 +454,7 @@ var calcSingleAssetJoinTestCases = []calcJoinSharesTestCase{ }, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), ), expectShares: osmomath.NewInt(5_000_000), }, @@ -465,7 +466,7 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), // Raises liquidity perfectly by 25_000 / 1_000_000_000_000. @@ -473,7 +474,7 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ // Expected increase = liquidity_increase_ratio * initial number of pool shares = (25_000 / 1e12) * 10**20 = 2500000000000.0 = 2.5 * 10**12 expectShares: osmomath.NewInt(2.5e12), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), }, @@ -482,12 +483,12 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.001"), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), expectShares: osmomath.NewInt(2500000000000), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), }, @@ -499,7 +500,7 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), Weight: osmomath.NewInt(100), }, { @@ -508,12 +509,12 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ }, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), sdk.NewInt64Coin("uatom", 1), ), expectShares: osmomath.NewInt(1e18).Mul(osmomath.NewInt(100)), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), sdk.NewInt64Coin("uatom", 1), ), }, @@ -524,7 +525,7 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1_000_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1_000_000_000_000), Weight: osmomath.NewInt(100), }, { @@ -533,12 +534,12 @@ var multiAssetExactInputTestCases = []calcJoinSharesTestCase{ }, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), sdk.NewInt64Coin("uatom", 1), ), expectShares: osmomath.NewInt(100_000_000), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1), sdk.NewInt64Coin("uatom", 1), ), }, @@ -567,7 +568,7 @@ var multiAssetUnevenInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.ZeroDec(), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), @@ -595,7 +596,7 @@ var multiAssetUnevenInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), expectShares: osmomath.NewInt(2.5e12 + 1243750000000), @@ -623,13 +624,13 @@ var multiAssetUnevenInputTestCases = []calcJoinSharesTestCase{ spreadFactor: osmomath.MustNewDecFromStr("0.03"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 2_000_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 2_000_000_000_000), Weight: osmomath.NewInt(500), }, defaultAtomPoolAsset, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), expectShares: osmomath.NewInt(1250000000000 + 609374990000), @@ -663,7 +664,7 @@ func (s *KeeperTestSuite) ResetTest() { // This test sets up 2 asset pools, and then checks the spot price on them. // It uses the pools spot price method, rather than the Gamm keepers spot price method. func (s *KeeperTestSuite) TestBalancerSpotPrice() { - baseDenom := "uosmo" + baseDenom := appparams.BaseCoinUnit quoteDenom := "uion" tests := []struct { @@ -748,7 +749,7 @@ func (s *KeeperTestSuite) TestBalancerSpotPrice() { // This test sets up 2 asset pools, and then checks the spot price on them. // It uses the pools spot price method, rather than the Gamm keepers spot price method. func (s *KeeperTestSuite) TestBalancerSpotPriceBounds() { - baseDenom := "uosmo" + baseDenom := appparams.BaseCoinUnit quoteDenom := "uion" defaultFutureGovernor = "" @@ -950,13 +951,13 @@ func (s *KeeperTestSuite) TestJoinPoolNoSwap() { spreadFactor: osmomath.ZeroDec(), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), expectShares: osmomath.NewInt(2.5e12), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), }, @@ -966,13 +967,13 @@ func (s *KeeperTestSuite) TestJoinPoolNoSwap() { spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: oneTrillionEvenPoolAssets, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), expectShares: osmomath.NewInt(2.5e12), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 25_000), ), }, @@ -984,18 +985,18 @@ func (s *KeeperTestSuite) TestJoinPoolNoSwap() { spreadFactor: osmomath.MustNewDecFromStr("0.03"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 2_000_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 2_000_000_000_000), Weight: osmomath.NewInt(500), }, defaultAtomPoolAsset, }, tokensIn: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 50_000), ), expectShares: osmomath.NewInt(1250000000000), expectLiq: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 25_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 25_000), sdk.NewInt64Coin("uatom", 12_500), ), }, diff --git a/x/gamm/pool-models/balancer/pool_test.go b/x/gamm/pool-models/balancer/pool_test.go index 72b4fd53036..24c1d922b9b 100644 --- a/x/gamm/pool-models/balancer/pool_test.go +++ b/x/gamm/pool-models/balancer/pool_test.go @@ -11,6 +11,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/internal/test_helpers" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -54,12 +55,12 @@ func TestUpdateIntermediaryPoolAssetsLiquidity(t *testing.T) { { name: "regular case with multiple pool assets and a subset of newLiquidity to update", newLiquidity: sdk.NewCoins( - sdk.NewInt64Coin("uosmo", 1_000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1_000), sdk.NewInt64Coin("atom", 2_000), sdk.NewInt64Coin("ion", 3_000)), poolAssets: map[string]balancer.PoolAsset{ - "uosmo": { - Token: sdk.NewInt64Coin("uosmo", uosmoValueOriginal), + appparams.BaseCoinUnit: { + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, uosmoValueOriginal), Weight: osmomath.NewInt(weight), }, "atom": { @@ -77,8 +78,8 @@ func TestUpdateIntermediaryPoolAssetsLiquidity(t *testing.T) { name: "new liquidity has no coins", newLiquidity: sdk.NewCoins(), poolAssets: map[string]balancer.PoolAsset{ - "uosmo": { - Token: sdk.NewInt64Coin("uosmo", uosmoValueOriginal), + appparams.BaseCoinUnit: { + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, uosmoValueOriginal), Weight: osmomath.NewInt(weight), }, "atom": { @@ -97,8 +98,8 @@ func TestUpdateIntermediaryPoolAssetsLiquidity(t *testing.T) { newLiquidity: sdk.NewCoins( sdk.NewInt64Coin("juno", 1_000)), poolAssets: map[string]balancer.PoolAsset{ - "uosmo": { - Token: sdk.NewInt64Coin("uosmo", uosmoValueOriginal), + appparams.BaseCoinUnit: { + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, uosmoValueOriginal), Weight: osmomath.NewInt(weight), }, }, @@ -202,7 +203,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { name: "one token in - equal weights with zero spread factor", spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(2_499_999_968_750), }, { @@ -222,7 +223,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { name: "two tokens in - equal weights with zero spread factor", spreadFactor: osmomath.MustNewDecFromStr("0"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000), sdk.NewInt64Coin("uatom", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000), sdk.NewInt64Coin("uatom", 50_000)), expectShares: osmomath.NewInt(2_499_999_968_750 * 2), }, { @@ -244,7 +245,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { name: "one token in - equal weights with spread factor of 0.01", spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000)), expectShares: osmomath.NewInt(2_487_500_000_000), }, { @@ -266,7 +267,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { name: "two tokens in - equal weights with spread factor of 0.01", spreadFactor: osmomath.MustNewDecFromStr("0.01"), poolAssets: oneTrillionEvenPoolAssets, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000), sdk.NewInt64Coin("uatom", 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000), sdk.NewInt64Coin("uatom", 50_000)), expectShares: osmomath.NewInt(2_487_500_000_000 * 2), }, { @@ -310,7 +311,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { spreadFactor: osmomath.MustNewDecFromStr("0.03"), poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 2_000_000_000), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 2_000_000_000), Weight: osmomath.NewInt(500), }, { @@ -318,7 +319,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { Weight: osmomath.NewInt(100), }, }, - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000), sdk.NewInt64Coin("uatom", 100_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000), sdk.NewInt64Coin("uatom", 100_000)), expectShares: osmomath.NewInt(2_072_912_400_000_000 + 1_624_999_900_000), }, { @@ -333,7 +334,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { spreadFactor: osmomath.ZeroDec(), poolAssets: oneTrillionEvenPoolAssets, // Second tokenIn does not exist. - tokensIn: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 50_000), sdk.NewInt64Coin(doesNotExistDenom, 50_000)), + tokensIn: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 50_000), sdk.NewInt64Coin(doesNotExistDenom, 50_000)), expectShares: osmomath.ZeroInt(), expErr: fmt.Errorf(balancer.ErrMsgFormatNoPoolAssetFound, doesNotExistDenom), }, @@ -401,13 +402,13 @@ func TestGetPoolAssetsByDenom(t *testing.T) { name: "one pool asset", poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(100), }, }, expectedPoolAssetsByDenom: map[string]balancer.PoolAsset{ - "uosmo": { - Token: sdk.NewInt64Coin("uosmo", 1e12), + appparams.BaseCoinUnit: { + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(100), }, }, @@ -416,7 +417,7 @@ func TestGetPoolAssetsByDenom(t *testing.T) { name: "two pool assets", poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(100), }, { @@ -425,8 +426,8 @@ func TestGetPoolAssetsByDenom(t *testing.T) { }, }, expectedPoolAssetsByDenom: map[string]balancer.PoolAsset{ - "uosmo": { - Token: sdk.NewInt64Coin("uosmo", 1e12), + appparams.BaseCoinUnit: { + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(100), }, "atom": { @@ -439,15 +440,15 @@ func TestGetPoolAssetsByDenom(t *testing.T) { name: "duplicate pool assets", poolAssets: []balancer.PoolAsset{ { - Token: sdk.NewInt64Coin("uosmo", 1e12), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 1e12), Weight: osmomath.NewInt(100), }, { - Token: sdk.NewInt64Coin("uosmo", 123), + Token: sdk.NewInt64Coin(appparams.BaseCoinUnit, 123), Weight: osmomath.NewInt(400), }, }, - err: fmt.Errorf(balancer.ErrMsgFormatRepeatingPoolAssetsNotAllowed, "uosmo"), + err: fmt.Errorf(balancer.ErrMsgFormatRepeatingPoolAssetsNotAllowed, appparams.BaseCoinUnit), }, } @@ -483,7 +484,7 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat // For every test case in testcases, apply a spread factor in spreadFactorCases. testcases := []testcase{ { - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialPoolOut: 1_000_000_000_000, initialWeightOut: 100, initialCalcOut: 100, @@ -493,7 +494,7 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat initialWeightIn: 100, }, { - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialPoolOut: 1_000, initialWeightOut: 100, initialCalcOut: 100, @@ -503,7 +504,7 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat initialWeightIn: 100, }, { - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialPoolOut: 1_000, initialWeightOut: 100, initialCalcOut: 100, @@ -513,7 +514,7 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat initialWeightIn: 100, }, { - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialPoolOut: 1_000, initialWeightOut: 200, initialCalcOut: 100, @@ -523,7 +524,7 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat initialWeightIn: 50, }, { - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialPoolOut: 1_000_000, initialWeightOut: 200, initialCalcOut: 100000, diff --git a/x/gamm/pool-models/stableswap/amm_test.go b/x/gamm/pool-models/stableswap/amm_test.go index 35b8d02bca5..e86e0b2b0a4 100644 --- a/x/gamm/pool-models/stableswap/amm_test.go +++ b/x/gamm/pool-models/stableswap/amm_test.go @@ -12,6 +12,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" sdkrand "github.com/osmosis-labs/osmosis/v24/simulation/simtypes/random" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/internal/cfmm_common" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/internal/test_helpers" @@ -727,67 +728,67 @@ func (suite *StableSwapTestSuite) Test_StableSwap_CalculateAmountOutAndIn_Invers // two-asset pools "even pool": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000_000)), ), scalingFactors: []uint64{1, 1}, }, "uneven pool (2:1)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(500_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500_000)), ), scalingFactors: []uint64{1, 1}, }, "uneven pool (1_000_000:1)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000)), ), scalingFactors: []uint64{1, 1}, }, "uneven pool (1:1_000_000)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000_000)), ), scalingFactors: []uint64{1, 1}, }, "even pool, uneven scaling factors": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000_000)), ), scalingFactors: []uint64{1, 8}, }, "uneven pool, uneven scaling factors": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(500_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500_000)), ), scalingFactors: []uint64{1, 9}, }, @@ -795,72 +796,72 @@ func (suite *StableSwapTestSuite) Test_StableSwap_CalculateAmountOutAndIn_Invers // multi asset pools "even multi-asset pool": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{1, 1, 1}, }, "uneven multi-asset pool (2:1:2)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(500_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{1, 1, 1}, }, "uneven multi-asset pool (1_000_000:1:1_000_000)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{1, 1, 1}, }, "uneven multi-asset pool (1:1_000_000:1_000_000)": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{1, 1, 1}, }, "even multi-asset pool, uneven scaling factors": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{5, 3, 9}, }, "uneven multi-asset pool (2:1:2), uneven scaling factors": { denomIn: "ion", - denomOut: "uosmo", + denomOut: appparams.BaseCoinUnit, initialCalcOut: 100, poolLiquidity: sdk.NewCoins( sdk.NewCoin("ion", osmomath.NewInt(1_000_000)), - sdk.NewCoin("uosmo", osmomath.NewInt(500_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500_000)), sdk.NewCoin("foo", osmomath.NewInt(1_000_000)), ), scalingFactors: []uint64{100, 76, 33}, diff --git a/x/incentives/client/cli/cli_test.go b/x/incentives/client/cli/cli_test.go index eca71f4aefe..3d63f0787f0 100644 --- a/x/incentives/client/cli/cli_test.go +++ b/x/incentives/client/cli/cli_test.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/osmosis-labs/osmosis/osmoutils/osmocli" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/incentives/types" ) @@ -61,7 +62,7 @@ func TestGetCmdActiveGaugesPerDenom(t *testing.T) { "basic test": { Cmd: "uosmo --offset=2", ExpectedQuery: &types.ActiveGaugesPerDenomRequest{ - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Pagination: &query.PageRequest{Key: []uint8{}, Offset: 2, Limit: 100}, }, }, @@ -88,7 +89,7 @@ func TestGetCmdUpcomingGaugesPerDenom(t *testing.T) { "basic test": { Cmd: "uosmo --offset=2", ExpectedQuery: &types.UpcomingGaugesPerDenomRequest{ - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Pagination: &query.PageRequest{Key: []uint8{}, Offset: 2, Limit: 100}, }, }, diff --git a/x/incentives/keeper/distribute_test.go b/x/incentives/keeper/distribute_test.go index eccb1661841..a29a640f572 100644 --- a/x/incentives/keeper/distribute_test.go +++ b/x/incentives/keeper/distribute_test.go @@ -59,7 +59,7 @@ var ( emptyCoins = sdk.Coins{} defaultVolumeAmount = osmomath.NewInt(300) - defaultCoins = sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100_000_000))) + defaultCoins = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100_000_000))) baseTime = time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC) @@ -2711,7 +2711,7 @@ func (s *KeeperTestSuite) TestSkipSpamGaugeDistribute() { tenCoins := sdk.Coins{sdk.NewInt64Coin(defaultRewardDenom, 10)} oneKCoins := sdk.Coins{sdk.NewInt64Coin(defaultRewardDenom, 1000)} - twoCoinsOneK := sdk.Coins{sdk.NewInt64Coin(defaultRewardDenom, 1000), sdk.NewInt64Coin("uosmo", 1000)} + twoCoinsOneK := sdk.Coins{sdk.NewInt64Coin(defaultRewardDenom, 1000), sdk.NewInt64Coin(appparams.BaseCoinUnit, 1000)} tests := []struct { name string locks []*lockuptypes.PeriodLock diff --git a/x/incentives/keeper/gauge_test.go b/x/incentives/keeper/gauge_test.go index 78cc4c594c6..5f48a512889 100644 --- a/x/incentives/keeper/gauge_test.go +++ b/x/incentives/keeper/gauge_test.go @@ -42,7 +42,7 @@ var ( defaultTime = time.Unix(1, 0).UTC() defaultGaugeCreationCoins = sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(100000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000)), sdk.NewCoin("atom", osmomath.NewInt(99999)), ) @@ -417,7 +417,7 @@ func (s *KeeperTestSuite) TestAddToGaugeRewards() { name: "valid case: valid gauge", owner: s.TestAccs[0], coinsToAdd: sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(100000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000)), sdk.NewCoin("atom", osmomath.NewInt(99999)), ), gaugeId: 1, @@ -429,7 +429,7 @@ func (s *KeeperTestSuite) TestAddToGaugeRewards() { name: "valid case: valid gauge with >4 denoms", owner: s.TestAccs[0], coinsToAdd: sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(100000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000)), sdk.NewCoin("atom", osmomath.NewInt(99999)), sdk.NewCoin("mars", osmomath.NewInt(88888)), sdk.NewCoin("akash", osmomath.NewInt(77777)), @@ -447,7 +447,7 @@ func (s *KeeperTestSuite) TestAddToGaugeRewards() { name: "invalid case: gauge Id is not valid", owner: s.TestAccs[0], coinsToAdd: sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(100000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000)), sdk.NewCoin("atom", osmomath.NewInt(99999)), ), gaugeId: 0, @@ -587,7 +587,7 @@ func (s *KeeperTestSuite) TestCreateGauge_NoLockGauges() { distrTo: lockuptypes.QueryCondition{ LockQueryType: lockuptypes.NoLock, // Note: this is invalid for NoLock gauges - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Duration: time.Nanosecond, }, poolId: concentratedPoolId, diff --git a/x/incentives/keeper/genesis_test.go b/x/incentives/keeper/genesis_test.go index 290eeb6a413..f7291b2e0e4 100644 --- a/x/incentives/keeper/genesis_test.go +++ b/x/incentives/keeper/genesis_test.go @@ -98,7 +98,7 @@ func TestIncentivesExportGenesis(t *testing.T) { // create an address and fund with coins addr := sdk.AccAddress([]byte("addr1---------------")) - coins := sdk.Coins{sdk.NewInt64Coin("stake", 20000), sdk.NewInt64Coin("uosmo", 10000000000)} + coins := sdk.Coins{sdk.NewInt64Coin("stake", 20000), sdk.NewInt64Coin(appparams.BaseCoinUnit, 10000000000)} err := testutil.FundAccount(app.BankKeeper, ctx, addr, coins) require.NoError(t, err) @@ -111,7 +111,7 @@ func TestIncentivesExportGenesis(t *testing.T) { msgCreatePool := model.MsgCreateConcentratedPool{ Sender: addr.String(), Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TickSpacing: 100, SpreadFactor: osmomath.MustNewDecFromStr("0.0005"), } diff --git a/x/incentives/keeper/hooks_test.go b/x/incentives/keeper/hooks_test.go index 46371de3c0c..f83930c0dd6 100644 --- a/x/incentives/keeper/hooks_test.go +++ b/x/incentives/keeper/hooks_test.go @@ -11,6 +11,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils/coinutil" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/incentives/types" ) @@ -20,7 +21,7 @@ var ( ETH = apptesting.ETH BAR = apptesting.BAR FOO = apptesting.FOO - UOSMO = apptesting.UOSMO + UOSMO = appparams.BaseCoinUnit defaultAmount = osmomath.NewInt(100_000_000_000) diff --git a/x/incentives/keeper/msg_server_test.go b/x/incentives/keeper/msg_server_test.go index 91c118eabe0..1443289fec5 100644 --- a/x/incentives/keeper/msg_server_test.go +++ b/x/incentives/keeper/msg_server_test.go @@ -273,19 +273,19 @@ func (s *KeeperTestSuite) TestCreateGroup_Fee() { }{ { name: "user creates a non-perpetual group and fills group with all remaining tokens", - accountBalanceToFund: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), + accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), groupFunds: tenTokens, numEpochsPaidOver: 3, }, { name: "user creates a perpetual group and fills group with all remaining tokens", - accountBalanceToFund: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), + accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), groupFunds: tenTokens, numEpochsPaidOver: 0, }, { name: "user creates a non-perpetual group and fills group with some remaining tokens", - accountBalanceToFund: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(15000000))), + accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(15000000))), groupFunds: tenTokens, numEpochsPaidOver: 3, }, @@ -298,14 +298,14 @@ func (s *KeeperTestSuite) TestCreateGroup_Fee() { }, { name: "user tries to create a non-perpetual group but does not have enough funds to pay for the create group fee", - accountBalanceToFund: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(90000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), + accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(90000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000))), groupFunds: tenTokens, expectErr: true, numEpochsPaidOver: 3, }, { name: "one user tries to create a group, has enough funds to pay for the create group fee but not enough to fill the group funds", - accountBalanceToFund: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(9000000))), + accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(9000000))), groupFunds: tenTokens, expectErr: true, numEpochsPaidOver: 3, diff --git a/x/incentives/keeper/store_test.go b/x/incentives/keeper/store_test.go index 8446beca0b7..c171d87a3e8 100644 --- a/x/incentives/keeper/store_test.go +++ b/x/incentives/keeper/store_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" ) @@ -85,8 +86,8 @@ func (s *KeeperTestSuite) TestGetGroupByGaugeID() { for name, test := range tests { s.Run(name, func() { - s.FundAcc(s.TestAccs[1], sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100_000_000)))) // 1,000 osmo - clPool := s.PrepareConcentratedPool() // gaugeid = 1 + s.FundAcc(s.TestAccs[1], sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100_000_000)))) // 1,000 osmo + clPool := s.PrepareConcentratedPool() // gaugeid = 1 // create 3 internal Gauge var internalGauges []uint64 @@ -95,7 +96,7 @@ func (s *KeeperTestSuite) TestGetGroupByGaugeID() { internalGauges = append(internalGauges, internalGauge) } - _, err := s.App.IncentivesKeeper.CreateGroup(s.Ctx, sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100_000_000))), 1, s.TestAccs[1], internalGauges) // gauge id = 5 + _, err := s.App.IncentivesKeeper.CreateGroup(s.Ctx, sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100_000_000))), 1, s.TestAccs[1], internalGauges) // gauge id = 5 s.Require().NoError(err) record, err := s.App.IncentivesKeeper.GetGroupByGaugeID(s.Ctx, test.groupGaugeId) @@ -112,7 +113,7 @@ func (s *KeeperTestSuite) TestGetAllGroupsWithGauge() { s.overwriteVolumes(groupPoolIds, []osmomath.Int{defaultVolumeAmount, defaultVolumeAmount, defaultVolumeAmount}) expectedStartTime := s.Ctx.BlockTime().UTC() - _, err := s.App.IncentivesKeeper.CreateGroup(s.Ctx, sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100_000_000))), 1, s.TestAccs[0], groupPoolIds) + _, err := s.App.IncentivesKeeper.CreateGroup(s.Ctx, sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100_000_000))), 1, s.TestAccs[0], groupPoolIds) s.Require().NoError(err) // Call GetAllGroupsWithGauge @@ -154,7 +155,7 @@ func (s *KeeperTestSuite) TestGetAllGroupsWithGauge() { Gauge: types.Gauge{ Id: uint64(8), DistributeTo: lockuptypes.QueryCondition{LockQueryType: lockuptypes.ByGroup}, - Coins: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100_000_000))), + Coins: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100_000_000))), StartTime: expectedStartTime, NumEpochsPaidOver: 1, }, diff --git a/x/incentives/keeper/suite_test.go b/x/incentives/keeper/suite_test.go index 3458ce29c33..bbc7a91c155 100644 --- a/x/incentives/keeper/suite_test.go +++ b/x/incentives/keeper/suite_test.go @@ -166,7 +166,6 @@ func (s *KeeperTestSuite) AddToGauge(coins sdk.Coins, gaugeID uint64) uint64 { for _, coin := range coins { s.App.ProtoRevKeeper.SetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, coin.Denom, 9999) } - addr := sdk.AccAddress([]byte("addrx---------------")) s.FundAcc(addr, coins) err := s.App.IncentivesKeeper.AddToGaugeRewards(s.Ctx, addr, coins, gaugeID) diff --git a/x/incentives/types/constants.go b/x/incentives/types/constants.go index 7881b258b0e..5aef15da9b3 100644 --- a/x/incentives/types/constants.go +++ b/x/incentives/types/constants.go @@ -5,6 +5,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) var ( @@ -18,5 +20,5 @@ var ( // for a gauge to be perpetual. For any other number of epochs // other than zero, the gauge is non-perpetual. Zero is invalid. PerpetualNumEpochsPaidOver = uint64(0) - DefaultMinValueForDistr = sdk.NewCoin("uosmo", sdkmath.NewInt(10000)) // 0.01 OSMO + DefaultMinValueForDistr = sdk.NewCoin(appparams.BaseCoinUnit, sdkmath.NewInt(10000)) // 0.01 OSMO ) diff --git a/x/incentives/types/params.go b/x/incentives/types/params.go index 3976f4653b1..9e2d953b083 100644 --- a/x/incentives/types/params.go +++ b/x/incentives/types/params.go @@ -11,6 +11,8 @@ import ( epochtypes "github.com/osmosis-labs/osmosis/x/epochs/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) // Incentives parameters key store. @@ -22,7 +24,7 @@ var ( KeyMinValueForDistr = []byte("MinValueForDistr") // 100 OSMO - DefaultGroupCreationFee = sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(100_000_000))) + DefaultGroupCreationFee = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(100_000_000))) ) // ParamKeyTable returns the key table for the incentive module's parameters. diff --git a/x/lockup/client/cli/cli_test.go b/x/lockup/client/cli/cli_test.go index 325395b4ec4..e740ad8999a 100644 --- a/x/lockup/client/cli/cli_test.go +++ b/x/lockup/client/cli/cli_test.go @@ -8,6 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/osmoutils/osmocli" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/lockup/types" ) @@ -21,7 +22,7 @@ func TestLockTokensCmd(t *testing.T) { ExpectedMsg: &types.MsgLockTokens{ Owner: testAddresses[0].String(), Duration: time.Hour * 24, - Coins: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 201)), + Coins: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 201)), }, }, } @@ -57,7 +58,7 @@ func TestBeginUnlockingByIDCmd(t *testing.T) { ExpectedMsg: &types.MsgBeginUnlocking{ Owner: testAddresses[0].String(), ID: 10, - Coins: sdk.NewCoins(sdk.NewInt64Coin("uosmo", 5)), + Coins: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 5)), }, }, } @@ -122,7 +123,7 @@ func TestCmdTotalLockedByDenom(t *testing.T) { "basic test": { Cmd: "uosmo --min-duration=1s", ExpectedQuery: &types.LockedDenomRequest{ - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Duration: time.Second, }, }, diff --git a/x/lockup/keeper/lock_test.go b/x/lockup/keeper/lock_test.go index d784f3c836c..2a3c1eadb6f 100644 --- a/x/lockup/keeper/lock_test.go +++ b/x/lockup/keeper/lock_test.go @@ -8,6 +8,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" "github.com/osmosis-labs/osmosis/v24/x/lockup/types" @@ -818,7 +819,7 @@ func (s *KeeperTestSuite) TestHasLock() { tokenLocked: sdk.NewInt64Coin("stake", 10), durationLocked: time.Minute, lockAddr: addr1, - denomToQuery: "uosmo", + denomToQuery: appparams.BaseCoinUnit, durationToQuery: time.Minute, expectedHas: false, }, @@ -827,7 +828,7 @@ func (s *KeeperTestSuite) TestHasLock() { tokenLocked: sdk.NewInt64Coin("stake", 10), durationLocked: time.Minute, lockAddr: addr2, - denomToQuery: "uosmo", + denomToQuery: appparams.BaseCoinUnit, durationToQuery: time.Minute, expectedHas: false, }, diff --git a/x/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index 21c803bf5df..9b10a4470c5 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -6,6 +6,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/mint/keeper" "github.com/osmosis-labs/osmosis/v24/x/mint/types" ) @@ -13,7 +14,7 @@ import ( var customGenesis = types.NewGenesisState( types.NewMinter(osmomath.ZeroDec()), types.NewParams( - "uosmo", // denom + appparams.BaseCoinUnit, // denom osmomath.NewDec(200), // epoch provisions "year", // epoch identifier osmomath.NewDecWithPrec(5, 1), // reduction factor @@ -76,7 +77,7 @@ func (s *KeeperTestSuite) TestMintInitGenesis() { }, "custom genesis": { mintGenesis: customGenesis, - mintDenom: "uosmo", + mintDenom: appparams.BaseCoinUnit, expectedEpochProvisions: osmomath.NewDec(200), expectedSupplyOffsetDelta: osmomath.NewInt(keeper.DeveloperVestingAmount).Neg(), diff --git a/x/mint/keeper/keeper_test.go b/x/mint/keeper/keeper_test.go index 07ddb503349..d213cabafbb 100644 --- a/x/mint/keeper/keeper_test.go +++ b/x/mint/keeper/keeper_test.go @@ -17,6 +17,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/mint/keeper" "github.com/osmosis-labs/osmosis/v24/x/mint/types" poolincentivestypes "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types" @@ -119,11 +120,11 @@ func (s *KeeperTestSuite) TestGetProportions() { }, { name: "54617981 * .131/.273osmomath.NewInt(.62", - mintedCoin: sdk.NewCoin("uosmo", osmomath.NewInt(54617981)), + mintedCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(54617981)), ratio: complexRatioDec, // .131/.273 // TODO: Should not be truncated. Remove truncation after rounding errors are addressed and resolved. // Ref: https://github.com/osmosis-osmomath.NewInt(s/issues/1917 - expectedCoin: sdk.NewCoin("uosmo", osmomath.NewInt(54617981).ToLegacyDec().Mul(complexRatioDec).TruncateInt()), + expectedCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(54617981).ToLegacyDec().Mul(complexRatioDec).TruncateInt()), }, { name: "1 * 1 = 1", diff --git a/x/pool-incentives/keeper/genesis_test.go b/x/pool-incentives/keeper/genesis_test.go index 6ad4051bbd0..a2449e3633f 100644 --- a/x/pool-incentives/keeper/genesis_test.go +++ b/x/pool-incentives/keeper/genesis_test.go @@ -21,7 +21,7 @@ var ( now = time.Now().UTC() testGenesis = types.GenesisState{ Params: types.Params{ - MintedDenom: "uosmo", + MintedDenom: appparams.BaseCoinUnit, }, LockableDurations: []time.Duration{ time.Second, diff --git a/x/poolmanager/create_pool_test.go b/x/poolmanager/create_pool_test.go index 0b9f8bf5fa7..ef49619a3bf 100644 --- a/x/poolmanager/create_pool_test.go +++ b/x/poolmanager/create_pool_test.go @@ -8,6 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" clmodel "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model" cwmodel "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/model" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" @@ -312,7 +313,7 @@ func (s *KeeperTestSuite) TestCreatePoolZeroLiquidityNoCreationFee() { // Note: this is necessary for gauge creation in the after pool created hook. // There is a check requiring positive supply existing on-chain. - s.MintCoins(sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.OneInt()))) + s.MintCoins(sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.OneInt()))) pool, err := poolmanagerKeeper.CreateConcentratedPoolAsPoolManager(ctx, tc.msg) diff --git a/x/poolmanager/keeper_test.go b/x/poolmanager/keeper_test.go index 5c6c7e8f3a2..94b3351c8ff 100644 --- a/x/poolmanager/keeper_test.go +++ b/x/poolmanager/keeper_test.go @@ -8,6 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" ) @@ -31,7 +32,7 @@ var ( } testAdminAddresses = []string{"osmo106x8q2nv7xsg7qrec2zgdf3vvq0t3gn49zvaha", "osmo105l5r3rjtynn7lg362r2m9hkpfvmgmjtkglsn9"} testCommunityPoolDenomToSwapNonWhitelistedAssetsTo = "uusdc" - testAuthorizedQuoteDenoms = []string{"uosmo", "uion", "uatom"} + testAuthorizedQuoteDenoms = []string{appparams.BaseCoinUnit, "uion", "uatom"} testPoolRoute = []types.ModuleRoute{ { @@ -45,7 +46,7 @@ var ( } testTakerFeesTracker = types.TakerFeesTracker{ - TakerFeesToStakers: sdk.Coins{sdk.NewCoin("uosmo", sdk.NewInt(1000))}, + TakerFeesToStakers: sdk.Coins{sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000))}, TakerFeesToCommunityPool: sdk.Coins{sdk.NewCoin("uusdc", sdk.NewInt(1000))}, HeightAccountingStartsFrom: 100, } @@ -53,23 +54,23 @@ var ( testPoolVolumes = []*types.PoolVolume{ { PoolId: 1, - PoolVolume: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(10000000))), + PoolVolume: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(10000000))), }, { PoolId: 2, - PoolVolume: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(20000000))), + PoolVolume: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(20000000))), }, } testDenomPairTakerFees = []types.DenomPairTakerFee{ { Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.0016"), }, { Denom0: "uatom", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.002"), }, } @@ -84,9 +85,9 @@ func (s *KeeperTestSuite) SetupTest() { // Set the bond denom to be uosmo to make volume tracking tests more readable. skParams := s.App.StakingKeeper.GetParams(s.Ctx) - skParams.BondDenom = "uosmo" + skParams.BondDenom = appparams.BaseCoinUnit s.App.StakingKeeper.SetParams(s.Ctx, skParams) - s.App.TxFeesKeeper.SetBaseDenom(s.Ctx, "uosmo") + s.App.TxFeesKeeper.SetBaseDenom(s.Ctx, appparams.BaseCoinUnit) poolManagerParams := s.App.PoolManagerKeeper.GetParams(s.Ctx) poolManagerParams.TakerFeeParams.CommunityPoolDenomToSwapNonWhitelistedAssetsTo = "baz" s.App.PoolManagerKeeper.SetParams(s.Ctx, poolManagerParams) diff --git a/x/poolmanager/msg_server_test.go b/x/poolmanager/msg_server_test.go index 47885c49b9e..0424d218d1e 100644 --- a/x/poolmanager/msg_server_test.go +++ b/x/poolmanager/msg_server_test.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" poolmanagerKeeper "github.com/osmosis-labs/osmosis/v24/x/poolmanager" "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" ) @@ -15,7 +16,7 @@ var ( pool1_in = types.SwapAmountInRoute{PoolId: 1, TokenOutDenom: "bar"} pool2_in = types.SwapAmountInRoute{PoolId: 2, TokenOutDenom: "baz"} - pool3_in = types.SwapAmountInRoute{PoolId: 3, TokenOutDenom: "uosmo"} + pool3_in = types.SwapAmountInRoute{PoolId: 3, TokenOutDenom: appparams.BaseCoinUnit} pool4_in = types.SwapAmountInRoute{PoolId: 4, TokenOutDenom: "baz"} pool1_out = types.SwapAmountOutRoute{PoolId: 1, TokenInDenom: "bar"} @@ -135,7 +136,7 @@ func (s *KeeperTestSuite) TestSplitRouteSwapExactAmountOut() { TokenOutAmount: amount, }, }, - tokenOutDenom: "uosmo", + tokenOutDenom: appparams.BaseCoinUnit, tokenoutMaxAmount: max_amount, expectedSplitRouteSwapEvent: 1, diff --git a/x/poolmanager/router_test.go b/x/poolmanager/router_test.go index 67d242f58e4..8ae7caf92b0 100644 --- a/x/poolmanager/router_test.go +++ b/x/poolmanager/router_test.go @@ -13,6 +13,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/tests/mocks" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" @@ -44,7 +45,7 @@ const ( FOO = apptesting.FOO BAR = apptesting.BAR BAZ = apptesting.BAZ - UOSMO = apptesting.UOSMO + UOSMO = appparams.BaseCoinUnit // Not an authorized quote denom // ("abc" ensures its always first lexicographically which simplifies setup) @@ -261,7 +262,7 @@ func (s *KeeperTestSuite) TestRouteGetPoolDenoms() { "valid balancer pool": { preCreatePoolType: types.Balancer, poolId: 1, - expectedDenoms: []string{"bar", "baz", "foo", "uosmo"}, + expectedDenoms: []string{"bar", "baz", "foo", appparams.BaseCoinUnit}, }, "valid stableswap pool": { preCreatePoolType: types.Stableswap, @@ -3124,7 +3125,7 @@ func (s *KeeperTestSuite) TestGetTotalPoolLiquidity() { var ( defaultPoolCoinOne = sdk.NewCoin("usdc", osmomath.OneInt()) defaultPoolCoinTwo = sdk.NewCoin("eth", osmomath.NewInt(2)) - nonPoolCool = sdk.NewCoin("uosmo", osmomath.NewInt(3)) + nonPoolCool = sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(3)) defaultCoins = sdk.NewCoins(defaultPoolCoinOne, defaultPoolCoinTwo) ) diff --git a/x/poolmanager/types/gov_test.go b/x/poolmanager/types/gov_test.go index 197e0a5d6e9..e01dde089de 100644 --- a/x/poolmanager/types/gov_test.go +++ b/x/poolmanager/types/gov_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" ) @@ -14,17 +15,17 @@ func TestDenomPairTakerFeeProposalMarshalUnmarshal(t *testing.T) { records := []types.DenomPairTakerFee{ { Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.0013"), }, { Denom0: "stake", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.0016"), }, { Denom0: "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.0017"), }, } @@ -66,7 +67,7 @@ func TestDenomPairTakerFeeProposalMarshalUnmarshal(t *testing.T) { func TestDenomPairTakerFeeProposal_ValidateBasic(t *testing.T) { baseRecord := types.DenomPairTakerFee{ Denom0: "uion", - Denom1: "uosmo", + Denom1: appparams.BaseCoinUnit, TakerFee: osmomath.MustNewDecFromStr("0.0013"), } diff --git a/x/poolmanager/types/keys_test.go b/x/poolmanager/types/keys_test.go index ff3a0b625de..fc7a82a8f47 100644 --- a/x/poolmanager/types/keys_test.go +++ b/x/poolmanager/types/keys_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" ) @@ -16,13 +17,13 @@ func TestFormatDenomTradePairKey(t *testing.T) { expectedKey string }{ "happy path": { - denom0: "uosmo", + denom0: appparams.BaseCoinUnit, denom1: "uion", expectedKey: "\x04|uion|uosmo", }, "reversed denoms get reordered": { denom0: "uion", - denom1: "uosmo", + denom1: appparams.BaseCoinUnit, expectedKey: "\x04|uion|uosmo", }, } diff --git a/x/poolmanager/types/msgs_test.go b/x/poolmanager/types/msgs_test.go index 2cfc7707b2e..8b5ccc08bfc 100644 --- a/x/poolmanager/types/msgs_test.go +++ b/x/poolmanager/types/msgs_test.go @@ -10,6 +10,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" appParams "github.com/osmosis-labs/osmosis/v24/app/params" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" ) @@ -25,7 +26,7 @@ var ( validSwapExactAmountInRoutes = []types.SwapAmountInRoute{{ PoolId: 1, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, { PoolId: 2, TokenOutDenom: "uatom", @@ -41,7 +42,7 @@ var ( TokenInDenom: "uatom", }, { PoolId: 2, - TokenInDenom: "uosmo", + TokenInDenom: appparams.BaseCoinUnit, }} ) @@ -575,12 +576,12 @@ func TestMsgSetDenomPairTakerFee(t *testing.T) { Sender: addr1, DenomPairTakerFee: []types.DenomPairTakerFee{ { - Denom0: "uosmo", + Denom0: appparams.BaseCoinUnit, Denom1: "uatom", TakerFee: osmomath.MustNewDecFromStr("0.003"), }, { - Denom0: "uosmo", + Denom0: appparams.BaseCoinUnit, Denom1: "uion", TakerFee: osmomath.MustNewDecFromStr("0.006"), }, diff --git a/x/poolmanager/types/params.go b/x/poolmanager/types/params.go index 202b66435f0..e9c1ca82958 100644 --- a/x/poolmanager/types/params.go +++ b/x/poolmanager/types/params.go @@ -65,7 +65,7 @@ func DefaultParams() Params { ReducedFeeWhitelist: []string{}, }, AuthorizedQuoteDenoms: []string{ - "uosmo", + appparams.BaseCoinUnit, "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", // ATOM "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", // DAI "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", // USDC diff --git a/x/poolmanager/types/routes_test.go b/x/poolmanager/types/routes_test.go index 3236a0a7a20..b50b10861db 100644 --- a/x/poolmanager/types/routes_test.go +++ b/x/poolmanager/types/routes_test.go @@ -6,13 +6,14 @@ import ( "github.com/stretchr/testify/require" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) const ( foo = "foo" bar = "bar" baz = "baz" - uosmo = "uosmo" + uosmo = appparams.BaseCoinUnit ) var ( diff --git a/x/protorev/keeper/emit_test.go b/x/protorev/keeper/emit_test.go index 1fab61d96f0..0b15f981aa6 100644 --- a/x/protorev/keeper/emit_test.go +++ b/x/protorev/keeper/emit_test.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/protorev/keeper" "github.com/osmosis-labs/osmosis/v24/x/protorev/types" ) @@ -25,14 +26,14 @@ func (s *KeeperTestSuite) TestBackRunEvent() { "basic valid": { pool: keeper.SwapToBackrun{ PoolId: 1, - TokenInDenom: "uosmo", + TokenInDenom: appparams.BaseCoinUnit, TokenOutDenom: "uatom", }, remainingTxPoolPoints: 100, remainingBlockPoolPoints: 100, profit: osmomath.NewInt(100), tokenOutAmount: osmomath.NewInt(100), - inputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(100)), + inputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100)), }, } diff --git a/x/protorev/keeper/epoch_hook_test.go b/x/protorev/keeper/epoch_hook_test.go index 7be7cc3df4f..58df171a179 100644 --- a/x/protorev/keeper/epoch_hook_test.go +++ b/x/protorev/keeper/epoch_hook_test.go @@ -10,6 +10,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/protorev/keeper" "github.com/osmosis-labs/osmosis/v24/x/protorev/types" ) @@ -202,16 +203,16 @@ func (s *KeeperTestSuite) TestAfterEpochEnd() { }{ { name: "osmo denom only", - arbProfits: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000))), + arbProfits: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000))), }, { name: "osmo denom and another base denom", - arbProfits: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), + arbProfits: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin("juno", osmomath.NewInt(100000000))), }, { name: "osmo denom, another base denom, and a non base denom", - arbProfits: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)), + arbProfits: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000)), sdk.NewCoin("juno", osmomath.NewInt(100000000)), sdk.NewCoin("eth", osmomath.NewInt(100000000))), }, diff --git a/x/protorev/keeper/grpc_query_test.go b/x/protorev/keeper/grpc_query_test.go index d246bb4cca7..568e77cb57a 100644 --- a/x/protorev/keeper/grpc_query_test.go +++ b/x/protorev/keeper/grpc_query_test.go @@ -7,6 +7,7 @@ import ( "github.com/osmosis-labs/osmosis/v24/app/apptesting" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/protorev/types" ) @@ -370,7 +371,7 @@ func (s *KeeperTestSuite) TestGetProtoRevPool() { s.SetupPoolsTest() // Request without setting pool for the base denom and other denom should return an error req := &types.QueryGetProtoRevPoolRequest{ - BaseDenom: "uosmo", + BaseDenom: appparams.BaseCoinUnit, OtherDenom: "atom", } res, err := s.queryClient.GetProtoRevPool(sdk.WrapSDKContext(s.Ctx), req) diff --git a/x/protorev/keeper/hooks_test.go b/x/protorev/keeper/hooks_test.go index fddac9076dd..b21118cb89e 100644 --- a/x/protorev/keeper/hooks_test.go +++ b/x/protorev/keeper/hooks_test.go @@ -2,7 +2,9 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" @@ -109,7 +111,7 @@ func (s *KeeperTestSuite) TestSwapping() { expectedTrades: []types.Trade{ { Pool: 50, - TokenIn: "uosmo", + TokenIn: appparams.BaseCoinUnit, TokenOut: "epochTwo", }, }, @@ -117,7 +119,7 @@ func (s *KeeperTestSuite) TestSwapping() { route := []poolmanagertypes.SwapAmountInRoute{{PoolId: 50, TokenOutDenom: "epochTwo"}} - _, err := s.App.PoolManagerKeeper.RouteExactAmountIn(s.Ctx, s.TestAccs[0], route, sdk.NewCoin("uosmo", osmomath.NewInt(10)), osmomath.NewInt(1)) + _, err := s.App.PoolManagerKeeper.RouteExactAmountIn(s.Ctx, s.TestAccs[0], route, sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), osmomath.NewInt(1)) s.Require().NoError(err) }, }, @@ -295,7 +297,7 @@ func (s *KeeperTestSuite) TestPoolCreation() { param: param{ matchDenom: "hookCL", executePoolCreation: func() uint64 { - clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hookCL", "uosmo") + clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hookCL", appparams.BaseCoinUnit) return clPool.GetId() }, }, @@ -313,7 +315,7 @@ func (s *KeeperTestSuite) TestPoolCreation() { Weight: osmomath.NewInt(1), }, { - Token: sdk.NewCoin("uosmo", osmomath.NewInt(1)), + Token: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1)), Weight: osmomath.NewInt(1), }, }, @@ -322,13 +324,13 @@ func (s *KeeperTestSuite) TestPoolCreation() { ) // Ensure that the balancer pool is stored since no other pool exists for the denom pair - setPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "hook") + setPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "hook") s.Require().NoError(err) s.Require().Equal(balancerPoolId, setPoolId) // Create Concentrated Liquidity pool with the same denom pair and more liquidity // The returned pool id should be what is finally stored in the protorev keeper - clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hook", "uosmo") + clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hook", appparams.BaseCoinUnit) return clPool.GetId() }, }, @@ -340,10 +342,10 @@ func (s *KeeperTestSuite) TestPoolCreation() { matchDenom: "hook", executePoolCreation: func() uint64 { // Create Concentrated Liquidity pool with a denom pair not already stored - clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hook", "uosmo") + clPool := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("hook", appparams.BaseCoinUnit) // Ensure that the concentrated pool is stored since no other pool exists for the denom pair - setPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "hook") + setPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "hook") s.Require().NoError(err) s.Require().Equal(clPool.GetId(), setPoolId) @@ -426,7 +428,7 @@ func (s *KeeperTestSuite) TestStoreSwap() { param: param{ expectedSwap: types.Trade{ Pool: 2, - TokenIn: "uosmo", + TokenIn: appparams.BaseCoinUnit, TokenOut: "test", }, prepareState: func() { @@ -483,7 +485,7 @@ func (s *KeeperTestSuite) TestGetComparablePoolLiquidity() { name: "Get Balancer Pool Comparable Liquidity", param: param{ executePoolCreation: func() uint64 { - return s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10)), sdk.NewCoin("juno", osmomath.NewInt(10))) + return s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("juno", osmomath.NewInt(10))) }, expectedComparableLiquidity: osmomath.NewInt(100), }, @@ -495,7 +497,7 @@ func (s *KeeperTestSuite) TestGetComparablePoolLiquidity() { executePoolCreation: func() uint64 { return s.createStableswapPool( sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("juno", osmomath.NewInt(10)), ), stableswap.PoolParams{ @@ -531,7 +533,7 @@ func (s *KeeperTestSuite) TestGetComparablePoolLiquidity() { param: param{ executePoolCreation: func() uint64 { return s.PrepareBalancerPoolWithCoins( - sdk.NewCoin("uosmo", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), sdk.NewCoin("juno", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999")))) }, expectedComparableLiquidity: osmomath.Int{}, @@ -607,7 +609,7 @@ func (s *KeeperTestSuite) TestStoreJoinExitPoolSwaps() { name: "Non-Gamm Pool, Return Early Do Not Store Any Swaps", param: param{ poolId: 50, - denom: "uosmo", + denom: appparams.BaseCoinUnit, isJoin: true, expectedSwap: types.Trade{}, }, @@ -653,14 +655,14 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Nothing Stored, Store Balancer", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "juno", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a balancer pool with coins - poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10)), sdk.NewCoin("juno", osmomath.NewInt(10))) + poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("juno", osmomath.NewInt(10))) // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) return poolId, poolId }, @@ -670,14 +672,14 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Nothing Stored, Store Concentrated Liquidity Pool w/ Coins", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a concentrated liquidity pool with coins - poolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("uosmo", "stake").GetId() + poolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition(appparams.BaseCoinUnit, "stake").GetId() // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) return poolId, poolId }, @@ -687,17 +689,17 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Balancer Previously Stored w/ Less liquidity, Compare Concentrated Liquidity Pool w/ More liqudidity, Ensure CL Gets Stored", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Create a concentrated liquidity pool with more liquidity - clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("uosmo", "stake").GetId() + clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition(appparams.BaseCoinUnit, "stake").GetId() // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) - preparedPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) - storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "stake") + preparedPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) + storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "stake") s.Require().NoError(err) s.Require().Equal(preparedPoolId, storedPoolId) @@ -710,18 +712,18 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Balancer Previously Stored w/ More liquidity, Compare Concentrated Liquidity Pool w/ Less liqudidity, Ensure Balancer Stays Stored", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Create a concentrated liquidity pool with more liquidity - clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("uosmo", "stake").GetId() + clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition(appparams.BaseCoinUnit, "stake").GetId() // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) // Prepare a balancer pool with more liquidity - balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(2000000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) - storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "stake") + balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) + storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "stake") s.Require().NoError(err) s.Require().Equal(balancerPoolId, storedPoolId) @@ -734,18 +736,18 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Concentrated Liquidity Previously Stored w/ Less liquidity, Compare Balancer Pool w/ More liqudidity, Ensure Balancer Gets Stored", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a balancer pool with more liquidity - balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(2000000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) + balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) // Prepare a concentrated liquidity pool with less liquidity, should be stored since nothing is stored - clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("uosmo", "stake").GetId() - storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "stake") + clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition(appparams.BaseCoinUnit, "stake").GetId() + storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "stake") s.Require().NoError(err) s.Require().Equal(clPoolId, storedPoolId) @@ -758,18 +760,18 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Concentrated Liquidity Previously Stored w/ More liquidity, Compare Balancer Pool w/ Less liqudidity, Ensure CL Stays Stored", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a balancer pool with less liquidity - balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(500000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) + balancerPoolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(500000000000000000)), sdk.NewCoin("stake", osmomath.NewInt(1000000000000000000))) // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) // Prepare a concentrated liquidity pool with less liquidity, should be stored since nothing is stored - clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("uosmo", "stake").GetId() - storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, "uosmo", "stake") + clPoolId := s.PrepareConcentratedPoolWithCoinsAndFullRangePosition(appparams.BaseCoinUnit, "stake").GetId() + storedPoolId, err := s.App.ProtoRevKeeper.GetPoolForDenomPair(s.Ctx, appparams.BaseCoinUnit, "stake") s.Require().NoError(err) s.Require().Equal(clPoolId, storedPoolId) @@ -782,19 +784,19 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Catch overflow error when getting newPoolLiquidity - Ensure test doesn't panic", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a balancer pool with liquidity levels that will overflow when multiplied overflowPoolId := s.PrepareBalancerPoolWithCoins( - sdk.NewCoin("uosmo", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), sdk.NewCoin("stake", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999")))) // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) // Prepare a balancer pool with normal liquidity - poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) + poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) // The normal liquidity pool should be stored since the function will return early when catching the overflow error return poolId, overflowPoolId @@ -805,18 +807,18 @@ func (s *KeeperTestSuite) TestCompareAndStorePool() { { name: "Catch overflow error when getting storedPoolLiquidity - Ensure test doesn't panic", param: param{ - baseDenom: "uosmo", + baseDenom: appparams.BaseCoinUnit, matchDenom: "stake", prepareStateAndGetPoolIdToCompare: func() (uint64, uint64) { // Prepare a balancer pool with normal liquidity - poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) + poolId := s.PrepareBalancerPoolWithCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10)), sdk.NewCoin("stake", osmomath.NewInt(10))) // Delete all pools for the base denom uosmo so that all tests start with a clean slate - s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, "uosmo") + s.App.ProtoRevKeeper.DeleteAllPoolsForBaseDenom(s.Ctx, appparams.BaseCoinUnit) // Prepare a balancer pool with liquidity levels that will overflow when multiplied overflowPoolId := s.PrepareBalancerPoolWithCoins( - sdk.NewCoin("uosmo", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999"))), sdk.NewCoin("stake", osmomath.Int(osmomath.NewUintFromString("999999999999999999999999999999999999999")))) // The overflow pool should be stored since the function will return early when catching the overflow error diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index d1fae074e1e..ced317e1b10 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -19,6 +19,7 @@ import ( "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" osmosisapp "github.com/osmosis-labs/osmosis/v24/app" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) type KeeperTestSuite struct { @@ -620,7 +621,7 @@ func (s *KeeperTestSuite) setUpPools() { { // Pool 29 PoolAssets: []balancer.PoolAsset{ { - Token: sdk.NewCoin("uosmo", osmomath.NewInt(1000000000)), + Token: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000)), Weight: osmomath.NewInt(1), }, { @@ -635,7 +636,7 @@ func (s *KeeperTestSuite) setUpPools() { { // Pool 30 PoolAssets: []balancer.PoolAsset{ { - Token: sdk.NewCoin("uosmo", osmomath.NewInt(1000000000)), + Token: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000)), Weight: osmomath.NewInt(1), }, { @@ -868,7 +869,7 @@ func (s *KeeperTestSuite) setUpPools() { { // Pool 46 - Used for epoch_hook UpdateHighestLiquidityPool testing initialLiquidity: sdk.NewCoins( sdk.NewCoin("epochOne", osmomath.NewInt(1000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000)), ), poolParams: stableswap.PoolParams{ SwapFee: osmomath.NewDecWithPrec(1, 4), @@ -879,7 +880,7 @@ func (s *KeeperTestSuite) setUpPools() { { // Pool 47 - Used for epoch_hook UpdateHighestLiquidityPool testing initialLiquidity: sdk.NewCoins( sdk.NewCoin("epochOne", osmomath.NewInt(1000)), - sdk.NewCoin("uosmo", osmomath.NewInt(2000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(2000)), ), poolParams: stableswap.PoolParams{ SwapFee: osmomath.NewDecWithPrec(1, 4), @@ -890,7 +891,7 @@ func (s *KeeperTestSuite) setUpPools() { { // Pool 48 - Used for epoch_hook UpdateHighestLiquidityPool testing initialLiquidity: sdk.NewCoins( sdk.NewCoin("epochTwo", osmomath.NewInt(1000)), - sdk.NewCoin("uosmo", osmomath.NewInt(1000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000)), ), poolParams: stableswap.PoolParams{ SwapFee: osmomath.NewDecWithPrec(1, 4), @@ -900,7 +901,7 @@ func (s *KeeperTestSuite) setUpPools() { }, { // Pool 49 - Used for CL testing initialLiquidity: sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(10_000_000_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin("epochTwo", osmomath.NewInt(8_000_000_000_000)), ), poolParams: stableswap.PoolParams{ @@ -917,7 +918,7 @@ func (s *KeeperTestSuite) setUpPools() { // Create a concentrated liquidity pool for epoch_hook testing // Pool 50 - s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("epochTwo", "uosmo") + s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("epochTwo", appparams.BaseCoinUnit) // Create a cosmwasm pool for testing // Pool 51 @@ -1023,16 +1024,16 @@ func (s *KeeperTestSuite) setUpPools() { // Create a concentrated liquidity pool for range testing // Pool 58 // Create the CL pool - clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "epochTwo", "uosmo", apptesting.DefaultTickSpacing, osmomath.ZeroDec()) - fundCoins := sdk.NewCoins(sdk.NewCoin("epochTwo", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin("uosmo", osmomath.NewInt(10_000_000_000_000))) + clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "epochTwo", appparams.BaseCoinUnit, apptesting.DefaultTickSpacing, osmomath.ZeroDec()) + fundCoins := sdk.NewCoins(sdk.NewCoin("epochTwo", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10_000_000_000_000))) s.FundAcc(s.TestAccs[0], fundCoins) s.CreateFullRangePosition(clPool, fundCoins) // Create a concentrated liquidity pool for range testing // Pool 59 // Create the CL pool - clPool = s.PrepareCustomConcentratedPool(s.TestAccs[0], "epochTwo", "uosmo", apptesting.DefaultTickSpacing, osmomath.ZeroDec()) - fundCoins = sdk.NewCoins(sdk.NewCoin("epochTwo", osmomath.NewInt(2_000_000_000)), sdk.NewCoin("uosmo", osmomath.NewInt(1_000_000_000))) + clPool = s.PrepareCustomConcentratedPool(s.TestAccs[0], "epochTwo", appparams.BaseCoinUnit, apptesting.DefaultTickSpacing, osmomath.ZeroDec()) + fundCoins = sdk.NewCoins(sdk.NewCoin("epochTwo", osmomath.NewInt(2_000_000_000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1_000_000_000))) s.FundAcc(s.TestAccs[0], fundCoins) s.CreateFullRangePosition(clPool, fundCoins) @@ -1043,12 +1044,12 @@ func (s *KeeperTestSuite) setUpPools() { func (s *KeeperTestSuite) CreateCLPoolAndArbRouteWith_28000_Ticks() { // Create the CL pool - clPool := s.PrepareCustomConcentratedPool(s.TestAccs[2], "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", "uosmo", 100, osmomath.NewDecWithPrec(2, 3)) - fundCoins := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000000000000000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", osmomath.NewInt(1000000000000000000))) + clPool := s.PrepareCustomConcentratedPool(s.TestAccs[2], "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", appparams.BaseCoinUnit, 100, osmomath.NewDecWithPrec(2, 3)) + fundCoins := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000000000000000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", osmomath.NewInt(1000000000000000000))) s.FundAcc(s.TestAccs[2], fundCoins) // Create 28000 ticks in the CL pool, 14000 on each side - tokensProvided := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", osmomath.NewInt(100000))) + tokensProvided := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000)), sdk.NewCoin("ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", osmomath.NewInt(100000))) amount0Min := osmomath.NewInt(0) amount1Min := osmomath.NewInt(0) lowerTick := int64(0) @@ -1062,7 +1063,7 @@ func (s *KeeperTestSuite) CreateCLPoolAndArbRouteWith_28000_Ticks() { // Set 2-pool hot route between new CL pool and respective Balancer s.App.ProtoRevKeeper.SetTokenPairArbRoutes( s.Ctx, - "uosmo", + appparams.BaseCoinUnit, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", types.NewTokenPairArbRoutes( []types.Route{ @@ -1070,19 +1071,19 @@ func (s *KeeperTestSuite) CreateCLPoolAndArbRouteWith_28000_Ticks() { Trades: []types.Trade{ { Pool: 38, - TokenIn: "uosmo", + TokenIn: appparams.BaseCoinUnit, TokenOut: "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", }, { Pool: 0, TokenIn: "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", - TokenOut: "uosmo", + TokenOut: appparams.BaseCoinUnit, }, }, StepSize: osmomath.NewInt(100000), }, }, - "uosmo", + appparams.BaseCoinUnit, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", ), ) diff --git a/x/protorev/keeper/posthandler_test.go b/x/protorev/keeper/posthandler_test.go index efeee3c1537..13e708043fb 100644 --- a/x/protorev/keeper/posthandler_test.go +++ b/x/protorev/keeper/posthandler_test.go @@ -14,6 +14,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" "github.com/osmosis-labs/osmosis/v24/x/protorev/keeper" "github.com/osmosis-labs/osmosis/v24/x/protorev/types" @@ -361,7 +362,7 @@ func (s *KeeperTestSuite) TestPostHandle() { s.Ctx = s.Ctx.WithMinGasPrices(sdk.NewDecCoins()) gasLimit := uint64(500000) - txFee := sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(10000))) + txFee := sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000))) privs, accNums, accSeqs := []cryptotypes.PrivKey{priv0}, []uint64{0}, []uint64{0} signerData := authsigning.SignerData{ @@ -525,7 +526,7 @@ func (s *KeeperTestSuite) TestExtractSwappedPools() { { PoolId: 22, TokenOutDenom: "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", - TokenInDenom: "uosmo", + TokenInDenom: appparams.BaseCoinUnit, }, }, }, diff --git a/x/protorev/keeper/rebalance_test.go b/x/protorev/keeper/rebalance_test.go index a366f49af36..73cb2971d28 100644 --- a/x/protorev/keeper/rebalance_test.go +++ b/x/protorev/keeper/rebalance_test.go @@ -7,6 +7,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" "github.com/osmosis-labs/osmosis/v24/x/protorev/keeper" @@ -28,7 +29,7 @@ var routeTwoAssetSameWeight = poolmanagertypes.SwapAmountInRoutes{ }, poolmanagertypes.SwapAmountInRoute{ PoolId: 24, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, } @@ -46,7 +47,7 @@ var routeMultiAssetSameWeight = poolmanagertypes.SwapAmountInRoutes{ }, poolmanagertypes.SwapAmountInRoute{ PoolId: 27, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, } @@ -64,7 +65,7 @@ var routeMostProfitable = poolmanagertypes.SwapAmountInRoutes{ }, poolmanagertypes.SwapAmountInRoute{ PoolId: 27, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, } @@ -100,7 +101,7 @@ var routeNoArb = poolmanagertypes.SwapAmountInRoutes{ }, poolmanagertypes.SwapAmountInRoute{ PoolId: 8, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, } @@ -118,7 +119,7 @@ var routeStableSwap = poolmanagertypes.SwapAmountInRoutes{ }, poolmanagertypes.SwapAmountInRoute{ PoolId: 30, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, } @@ -174,7 +175,7 @@ var extendedRangeRoute = poolmanagertypes.SwapAmountInRoutes{ var clPoolRouteExtended = poolmanagertypes.SwapAmountInRoutes{ poolmanagertypes.SwapAmountInRoute{ PoolId: 49, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, poolmanagertypes.SwapAmountInRoute{ PoolId: 50, @@ -186,7 +187,7 @@ var clPoolRouteExtended = poolmanagertypes.SwapAmountInRoutes{ var clPoolRouteMulti = poolmanagertypes.SwapAmountInRoutes{ poolmanagertypes.SwapAmountInRoute{ PoolId: 57, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, poolmanagertypes.SwapAmountInRoute{ PoolId: 58, @@ -198,7 +199,7 @@ var clPoolRouteMulti = poolmanagertypes.SwapAmountInRoutes{ var clPoolRoute = poolmanagertypes.SwapAmountInRoutes{ poolmanagertypes.SwapAmountInRoute{ PoolId: 49, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, poolmanagertypes.SwapAmountInRoute{ PoolId: 57, @@ -441,7 +442,7 @@ func (s *KeeperTestSuite) TestExecuteTrade() { name: "Mainnet Arb Route", param: param{ route: routeTwoAssetSameWeight, - inputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(10100000)), + inputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10100000)), expectedProfit: osmomath.NewInt(24852), }, arbDenom: types.OsmosisDenomination, @@ -452,7 +453,7 @@ func (s *KeeperTestSuite) TestExecuteTrade() { name: "No arbitrage opportunity - expect error at multihopswap due to profitability invariant", param: param{ route: routeNoArb, - inputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(1000000)), + inputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000)), expectedProfit: osmomath.NewInt(0), }, arbDenom: types.OsmosisDenomination, @@ -462,7 +463,7 @@ func (s *KeeperTestSuite) TestExecuteTrade() { name: "0 input amount - expect error at multihopswap due to amount needing to be positive", param: param{ route: routeNoArb, - inputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(0)), + inputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(0)), expectedProfit: osmomath.NewInt(0), }, arbDenom: types.OsmosisDenomination, @@ -602,7 +603,7 @@ func (s *KeeperTestSuite) TestIterateRoutes() { params: paramm{ routes: []poolmanagertypes.SwapAmountInRoutes{routeTwoAssetSameWeight}, expectedMaxProfitAmount: osmomath.NewInt(24848), - expectedMaxProfitInputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(10000000)), + expectedMaxProfitInputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000)), expectedOptimalRoute: routeTwoAssetSameWeight, arbDenom: types.OsmosisDenomination, }, @@ -613,7 +614,7 @@ func (s *KeeperTestSuite) TestIterateRoutes() { params: paramm{ routes: []poolmanagertypes.SwapAmountInRoutes{routeMultiAssetSameWeight, routeTwoAssetSameWeight}, expectedMaxProfitAmount: osmomath.NewInt(24848), - expectedMaxProfitInputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(10000000)), + expectedMaxProfitInputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000)), expectedOptimalRoute: routeTwoAssetSameWeight, arbDenom: types.OsmosisDenomination, }, @@ -624,7 +625,7 @@ func (s *KeeperTestSuite) TestIterateRoutes() { params: paramm{ routes: []poolmanagertypes.SwapAmountInRoutes{routeMostProfitable, routeMultiAssetSameWeight, routeTwoAssetSameWeight}, expectedMaxProfitAmount: osmomath.NewInt(67511675), - expectedMaxProfitInputCoin: sdk.NewCoin("uosmo", osmomath.NewInt(520000000)), + expectedMaxProfitInputCoin: sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(520000000)), expectedOptimalRoute: routeMostProfitable, arbDenom: types.OsmosisDenomination, }, @@ -829,13 +830,13 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { s.Run("Extended search on CL pools", func() { // Create two massive CL pools with a massive arb - clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "atom", "uosmo", apptesting.DefaultTickSpacing, osmomath.ZeroDec()) - fundCoins := sdk.NewCoins(sdk.NewCoin("atom", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin("uosmo", osmomath.NewInt(10_000_000_000_000))) + clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "atom", appparams.BaseCoinUnit, apptesting.DefaultTickSpacing, osmomath.ZeroDec()) + fundCoins := sdk.NewCoins(sdk.NewCoin("atom", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10_000_000_000_000))) s.FundAcc(s.TestAccs[0], fundCoins) s.CreateFullRangePosition(clPool, fundCoins) - clPool2 := s.PrepareCustomConcentratedPool(s.TestAccs[0], "atom", "uosmo", apptesting.DefaultTickSpacing, osmomath.ZeroDec()) - fundCoins = sdk.NewCoins(sdk.NewCoin("atom", osmomath.NewInt(20_000_000_000_000)), sdk.NewCoin("uosmo", osmomath.NewInt(10_000_000_000_000))) + clPool2 := s.PrepareCustomConcentratedPool(s.TestAccs[0], "atom", appparams.BaseCoinUnit, apptesting.DefaultTickSpacing, osmomath.ZeroDec()) + fundCoins = sdk.NewCoins(sdk.NewCoin("atom", osmomath.NewInt(20_000_000_000_000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10_000_000_000_000))) s.FundAcc(s.TestAccs[0], fundCoins) s.CreateFullRangePosition(clPool2, fundCoins) @@ -843,7 +844,7 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { Route: poolmanagertypes.SwapAmountInRoutes{ poolmanagertypes.SwapAmountInRoute{ PoolId: clPool.GetId(), - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, poolmanagertypes.SwapAmountInRoute{ PoolId: clPool2.GetId(), @@ -868,7 +869,7 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { s.Run("Reduced search on CL pools", func() { stablePool := s.createStableswapPool( sdk.NewCoins( - sdk.NewCoin("uosmo", osmomath.NewInt(25_000_000_000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(25_000_000_000)), sdk.NewCoin("eth", osmomath.NewInt(20_000_000_000)), ), stableswap.PoolParams{ @@ -879,8 +880,8 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { ) // Create two massive CL pools with a massive arb - clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "eth", "uosmo", apptesting.DefaultTickSpacing, osmomath.ZeroDec()) - fundCoins := sdk.NewCoins(sdk.NewCoin("eth", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin("uosmo", osmomath.NewInt(10_000_000_000_000))) + clPool := s.PrepareCustomConcentratedPool(s.TestAccs[0], "eth", appparams.BaseCoinUnit, apptesting.DefaultTickSpacing, osmomath.ZeroDec()) + fundCoins := sdk.NewCoins(sdk.NewCoin("eth", osmomath.NewInt(10_000_000_000_000)), sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10_000_000_000_000))) s.FundAcc(s.TestAccs[0], fundCoins) s.CreateFullRangePosition(clPool, fundCoins) @@ -892,7 +893,7 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { }, poolmanagertypes.SwapAmountInRoute{ PoolId: clPool.GetId(), - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, }, StepSize: osmomath.NewInt(1_000_000), @@ -901,7 +902,7 @@ func (s *KeeperTestSuite) TestUpdateSearchRangeIfNeeded() { curLeft, curRight, err := s.App.ProtoRevKeeper.UpdateSearchRangeIfNeeded( s.Ctx, route, - "uosmo", + appparams.BaseCoinUnit, osmomath.OneInt(), types.MaxInputAmount, ) diff --git a/x/protorev/types/constants.go b/x/protorev/types/constants.go index 149fc5b5163..2a7350b85b5 100644 --- a/x/protorev/types/constants.go +++ b/x/protorev/types/constants.go @@ -1,9 +1,12 @@ package types -import "github.com/osmosis-labs/osmosis/osmomath" +import ( + "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" +) // OsmosisDenomination stores the native denom name for Osmosis on chain used for route building -var OsmosisDenomination string = "uosmo" +var OsmosisDenomination string = appparams.BaseCoinUnit // ----------------- Module Execution Time Constants ----------------- // diff --git a/x/smart-account/authenticator/base_test.go b/x/smart-account/authenticator/base_test.go index f83d1b25127..fb9fdc1248d 100644 --- a/x/smart-account/authenticator/base_test.go +++ b/x/smart-account/authenticator/base_test.go @@ -21,6 +21,7 @@ import ( "github.com/osmosis-labs/osmosis/v24/app" "github.com/osmosis-labs/osmosis/v24/app/params" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) type BaseAuthenticatorSuite struct { @@ -100,7 +101,7 @@ func (s *BaseAuthenticatorSuite) GenSimpleTx(msgs []sdk.Msg, signers []cryptotyp func (s *BaseAuthenticatorSuite) GenSimpleTxWithSelectedAuthenticators(msgs []sdk.Msg, signers []cryptotypes.PrivKey, selectedAuthenticators []uint64) (sdk.Tx, error) { txconfig := app.MakeEncodingConfig().TxConfig - feeCoins := sdk.Coins{sdk.NewInt64Coin("uosmo", 2500)} + feeCoins := sdk.Coins{sdk.NewInt64Coin(appparams.BaseCoinUnit, 2500)} var accNums []uint64 var accSeqs []uint64 diff --git a/x/smart-account/authenticator/spend_limits_test.go b/x/smart-account/authenticator/spend_limits_test.go index d26ce0ba6ff..44c62c96bcb 100644 --- a/x/smart-account/authenticator/spend_limits_test.go +++ b/x/smart-account/authenticator/spend_limits_test.go @@ -3,11 +3,13 @@ package authenticator_test import ( "encoding/json" "fmt" - txfeeskeeper "github.com/osmosis-labs/osmosis/v24/x/txfees/keeper" "os" "testing" "time" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" + txfeeskeeper "github.com/osmosis-labs/osmosis/v24/x/txfees/keeper" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -122,7 +124,7 @@ func (s *SpendLimitAuthenticatorTest) TestSpendLimit() { }, { Weight: sdk.NewInt(100000), - Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000000)), + Token: sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000000)), }, }, ) @@ -141,7 +143,7 @@ func (s *SpendLimitAuthenticatorTest) TestSpendLimit() { }, TrackedDenoms: []TrackedDenom{ { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, SwapRoutes: []SwapAmountInRoute{ { PoolID: fmt.Sprintf("%d", usdcOsmoPoolId), @@ -197,7 +199,7 @@ func (s *SpendLimitAuthenticatorTest) TestSpendLimit() { // fund acc s.FundAcc(authAcc, sdk.NewCoins(sdk.NewCoin(UUSDC, sdk.NewInt(200000000000)))) - s.FundAcc(authAcc, sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(200000000000)))) + s.FundAcc(authAcc, sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(200000000000)))) // a hack for setting fee payer selfSend := banktypes.MsgSend{ @@ -210,7 +212,7 @@ func (s *SpendLimitAuthenticatorTest) TestSpendLimit() { swapMsg := poolmanagertypes.MsgSwapExactAmountIn{ Sender: authAcc.String(), Routes: []poolmanagertypes.SwapAmountInRoute{{PoolId: usdcOsmoPoolId, TokenOutDenom: UUSDC}}, - TokenIn: sdk.NewCoin("uosmo", sdk.NewInt(3333333333)), // ~ 4,999,999,999 uusdc + TokenIn: sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(3333333333)), // ~ 4,999,999,999 uusdc TokenOutMinAmount: sdk.OneInt(), } @@ -234,7 +236,7 @@ func (s *SpendLimitAuthenticatorTest) TestSpendLimit() { // swap over the limit swapMsg = poolmanagertypes.MsgSwapExactAmountIn{ Sender: authAcc.String(), - Routes: []poolmanagertypes.SwapAmountInRoute{{PoolId: usdcOsmoPoolId, TokenOutDenom: "uosmo"}}, + Routes: []poolmanagertypes.SwapAmountInRoute{{PoolId: usdcOsmoPoolId, TokenOutDenom: appparams.BaseCoinUnit}}, TokenIn: sdk.NewCoin(UUSDC, sdk.NewInt(2)), TokenOutMinAmount: sdk.OneInt(), } diff --git a/x/superfluid/keeper/epoch_test.go b/x/superfluid/keeper/epoch_test.go index 940b880649a..2e88ed4ef38 100644 --- a/x/superfluid/keeper/epoch_test.go +++ b/x/superfluid/keeper/epoch_test.go @@ -142,13 +142,13 @@ type distributionTestCase struct { var ( // distributed coin when there is one account receiving from one gauge // since val tokens is 11000000 and reward is 20000, we get 18181stake - defaultSingleLockDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin("stake", 18181)) + defaultSingleLockDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin(STAKE, 18181)) // distributed coins when there is two account receiving from one gauge // since val tokens is 2100000 and reward is 20000, we get 9523stake - defaultTwoLockDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin("stake", 9523)) + defaultTwoLockDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin(STAKE, 9523)) // distributed coins when there is one account receiving from two gauge // two lock distribution * 2 - defaultTwoGaugeDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin("stake", 19046)) + defaultTwoGaugeDistributedCoins = sdk.NewCoins(sdk.NewInt64Coin(STAKE, 19046)) distributionTestCases = []distributionTestCase{ { "happy path with single validator and delegator", diff --git a/x/superfluid/keeper/grpc_query_test.go b/x/superfluid/keeper/grpc_query_test.go index 217f118cf38..569fd8c28ee 100644 --- a/x/superfluid/keeper/grpc_query_test.go +++ b/x/superfluid/keeper/grpc_query_test.go @@ -8,6 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" "github.com/osmosis-labs/osmosis/v24/x/superfluid/types" ) @@ -167,8 +168,8 @@ func (s *KeeperTestSuite) TestGRPCQuerySuperfluidDelegations() { sdk.NewInt64Coin(denoms[0], 1000000), sdk.NewInt64Coin(denoms[1], 1000000), ))) - s.Require().True(res.SuperfluidDelegationRecords[0].EquivalentStakedAmount.IsEqual(sdk.NewCoin("uosmo", expectAmount0.RoundInt()))) - s.Require().True(res.SuperfluidDelegationRecords[1].EquivalentStakedAmount.IsEqual(sdk.NewCoin("uosmo", expectAmount1.RoundInt()))) + s.Require().True(res.SuperfluidDelegationRecords[0].EquivalentStakedAmount.IsEqual(sdk.NewCoin(appparams.BaseCoinUnit, expectAmount0.RoundInt()))) + s.Require().True(res.SuperfluidDelegationRecords[1].EquivalentStakedAmount.IsEqual(sdk.NewCoin(appparams.BaseCoinUnit, expectAmount1.RoundInt()))) } // for each validator denom pair, make sure they have 1 delegations @@ -280,7 +281,7 @@ func (s *KeeperTestSuite) TestUserConcentratedSuperfluidPositionsBondedAndUnbond // Set staking parameters (needed since stake is not a valid quote denom). stakingParams := s.App.StakingKeeper.GetParams(s.Ctx) - stakingParams.BondDenom = "uosmo" + stakingParams.BondDenom = appparams.BaseCoinUnit s.App.StakingKeeper.SetParams(s.Ctx, stakingParams) coins := sdk.NewCoins(sdk.NewCoin("token0", osmomath.NewInt(1000000000000)), sdk.NewCoin(s.App.StakingKeeper.BondDenom(s.Ctx), osmomath.NewInt(1000000000000))) @@ -461,10 +462,10 @@ func (s *KeeperTestSuite) TestGRPCQueryTotalDelegationByDelegator() { s.Require().True(res.TotalDelegatedCoins.IsEqual(sdk.NewCoins( sdk.NewInt64Coin(denoms[0], 1000000), sdk.NewInt64Coin(denoms[1], 1000000), - sdk.NewInt64Coin("uosmo", 18000000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 18000000), ))) - total_osmo_equivalent := sdk.NewCoin("uosmo", expectAmount0.RoundInt().Add(expectAmount1.RoundInt()).Add(osmomath.NewInt(18000000))) + total_osmo_equivalent := sdk.NewCoin(appparams.BaseCoinUnit, expectAmount0.RoundInt().Add(expectAmount1.RoundInt()).Add(osmomath.NewInt(18000000))) s.Require().True(res.TotalEquivalentStakedAmount.IsEqual(total_osmo_equivalent)) } diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index 11edcd8b50e..61128826b13 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -34,7 +34,7 @@ func (s *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { // delegation rewards are calculated using the equation (current period cumulative reward ratio - last period cumulative reward ratio) * asset amount // in this test case, the calculation for expected reward would be the following (0.99999 - 0) * 11_000_000 // thus we expect 909_900 stake as rewards - []sdk.Coins{{sdk.NewCoin("stake", osmomath.NewInt(909090))}}, + []sdk.Coins{{sdk.NewCoin(STAKE, osmomath.NewInt(909090))}}, }, { "happy path with two validator and delegator each", @@ -47,7 +47,7 @@ func (s *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { // This would be the first block propsed by the second validator, current period cumulative reward ratio being 999_86.66684, // last period cumulative reward ratio being 0 // Thus as rewards, we expect 999986stake, calculated using the following equation: (0.117647) * 7_500_000 - []sdk.Coins{{sdk.NewCoin("stake", osmomath.NewInt(909090))}, {sdk.NewCoin("stake", osmomath.NewInt(882352))}}, + []sdk.Coins{{sdk.NewCoin(STAKE, osmomath.NewInt(909090))}, {sdk.NewCoin(STAKE, osmomath.NewInt(882352))}}, }, } diff --git a/x/superfluid/keeper/slash_test.go b/x/superfluid/keeper/slash_test.go index 05081d99fe6..2a60309d8e5 100644 --- a/x/superfluid/keeper/slash_test.go +++ b/x/superfluid/keeper/slash_test.go @@ -5,6 +5,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils/accum" "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cl "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" @@ -238,7 +239,7 @@ func (s *KeeperTestSuite) TestPrepareConcentratedLockForSlash() { s.Run(tc.name, func() { s.SetupTest() - clPool, concentratedLockId, positionId := s.PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition("uosmo", apptesting.USDC) + clPool, concentratedLockId, positionId := s.PrepareConcentratedPoolWithCoinsAndLockedFullRangePosition(appparams.BaseCoinUnit, apptesting.USDC) clPoolId := clPool.GetId() lock, err := s.App.LockupKeeper.GetLockByID(s.Ctx, concentratedLockId) diff --git a/x/superfluid/keeper/stake_test.go b/x/superfluid/keeper/stake_test.go index 4f253a9adef..225de550706 100644 --- a/x/superfluid/keeper/stake_test.go +++ b/x/superfluid/keeper/stake_test.go @@ -7,6 +7,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" cltypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v24/x/gamm/types" @@ -193,12 +194,12 @@ func (s *KeeperTestSuite) TestValidateLockForSFDelegate() { name: "invalid lock - not superfluid asset", lock: &lockuptypes.PeriodLock{ Owner: lockOwner.String(), - Coins: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100))), + Coins: sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100))), Duration: time.Hour * 24 * 21, ID: 1, }, superfluidAssetToSet: types.SuperfluidAsset{Denom: DefaultGammAsset, AssetType: types.SuperfluidAssetTypeLPShare}, - expectedErr: errorsmod.Wrapf(types.ErrNonSuperfluidAsset, "denom: %s", "uosmo"), + expectedErr: errorsmod.Wrapf(types.ErrNonSuperfluidAsset, "denom: %s", appparams.BaseCoinUnit), }, { name: "invalid lock - unbonding lockup not supported", @@ -1104,7 +1105,7 @@ func (s *KeeperTestSuite) TestUnbondConvertAndStake() { } // only test with test related denoms - balanceBeforeConvertLockToStake := osmoutils.FilterDenoms(s.App.BankKeeper.GetAllBalances(s.Ctx, sender), []string{"foo", "stake", "uosmo"}) + balanceBeforeConvertLockToStake := osmoutils.FilterDenoms(s.App.BankKeeper.GetAllBalances(s.Ctx, sender), []string{"foo", "stake", appparams.BaseCoinUnit}) // system under test totalAmtConverted, err := s.App.SuperfluidKeeper.UnbondConvertAndStake(s.Ctx, lockId, sender.String(), valAddr.String(), minAmountToStake, sharesToConvert) @@ -1119,7 +1120,7 @@ func (s *KeeperTestSuite) TestUnbondConvertAndStake() { s.delegationCheck(sender, originalValAddr, valAddr, totalAmtConverted) // Bank check - balanceAfterConvertLockToStake := osmoutils.FilterDenoms(s.App.BankKeeper.GetAllBalances(s.Ctx, sender), []string{"foo", "stake", "uosmo"}) + balanceAfterConvertLockToStake := osmoutils.FilterDenoms(s.App.BankKeeper.GetAllBalances(s.Ctx, sender), []string{"foo", "stake", appparams.BaseCoinUnit}) s.Require().True(balanceBeforeConvertLockToStake.IsEqual(balanceAfterConvertLockToStake)) // if unlocked, no need to check locks since there is no lock existing diff --git a/x/superfluid/keeper/unpool_test.go b/x/superfluid/keeper/unpool_test.go index 4eb04eb6f34..f8a9d9249ce 100644 --- a/x/superfluid/keeper/unpool_test.go +++ b/x/superfluid/keeper/unpool_test.go @@ -10,6 +10,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v24/x/gamm/types" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" @@ -32,7 +33,7 @@ var ( defaultPoolAssets []balancer.PoolAsset = []balancer.PoolAsset{defaultFooAsset, defaultBondDenomAsset} defaultAcctFunds sdk.Coins = sdk.NewCoins( sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000000)), - sdk.NewCoin("uosmo", osmomath.NewInt(10000000000)), + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(10000000000)), sdk.NewCoin("foo", osmomath.NewInt(10000000)), sdk.NewCoin("bar", osmomath.NewInt(10000000)), sdk.NewCoin("baz", osmomath.NewInt(10000000)), diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index 4b6bfb36150..1ddaf25e38b 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types" ) @@ -133,7 +134,7 @@ func (s *KeeperTestSuite) TestMintDenom() { desc: "error: try minting non-tokenfactory denom", mintMsg: *types.NewMsgMintTo( s.TestAccs[0].String(), - sdk.NewInt64Coin("uosmo", 10), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 10), s.TestAccs[1].String(), ), expectPass: false, @@ -230,7 +231,7 @@ func (s *KeeperTestSuite) TestBurnDenom() { desc: "fail case - burn non-tokenfactory denom", burnMsg: *types.NewMsgBurnFrom( s.TestAccs[0].String(), - sdk.NewInt64Coin("uosmo", 10), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 10), moduleAdress.String(), ), expectPass: false, @@ -442,12 +443,12 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { Exponent: 0, }, { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 6, }, }, Base: s.defaultDenom, - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), @@ -463,12 +464,12 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { Exponent: 0, }, { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 6, }, }, Base: fmt.Sprintf("factory/%s/litecoin", s.TestAccs[0].String()), - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), @@ -480,7 +481,7 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { Description: "yeehaw", DenomUnits: []*banktypes.DenomUnit{ { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 0, }, { @@ -488,7 +489,7 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { Exponent: 6, }, }, - Base: "uosmo", + Base: appparams.BaseCoinUnit, Display: "uosmoo", Name: "OSMO", Symbol: "OSMO", @@ -505,12 +506,12 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { Exponent: 0, }, { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 6, }, }, Base: s.defaultDenom, - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), @@ -527,7 +528,7 @@ func (s *KeeperTestSuite) TestSetDenomMetaData() { }, }, Base: s.defaultDenom, - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go index 6ef9c1302da..82108ae127a 100644 --- a/x/tokenfactory/keeper/createdenom_test.go +++ b/x/tokenfactory/keeper/createdenom_test.go @@ -8,6 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types" ) @@ -15,7 +16,7 @@ func (s *KeeperTestSuite) TestMsgCreateDenom() { var ( tokenFactoryKeeper = s.App.TokenFactoryKeeper bankKeeper = s.App.BankKeeper - denomCreationFee = sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(1000000))) + denomCreationFee = sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(1000000))) ) // Set the denom creation fee. It is currently turned off in favor @@ -76,7 +77,7 @@ func (s *KeeperTestSuite) TestMsgCreateDenom() { func (s *KeeperTestSuite) TestCreateDenom() { var ( - primaryDenom = "uosmo" + primaryDenom = appparams.BaseCoinUnit secondaryDenom = apptesting.SecondaryDenom defaultDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, osmomath.NewInt(50000000)))} twoDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, osmomath.NewInt(50000000)), sdk.NewCoin(secondaryDenom, osmomath.NewInt(50000000)))} diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index 28d44ac1dd5..509ad1bb9bd 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types" ) @@ -55,7 +56,7 @@ func (s *KeeperTestSuite) TestGenesis() { tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(s.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) s.Require().Nil(tokenfactoryModuleAccount) - app.TokenFactoryKeeper.SetParams(s.Ctx, types.Params{DenomCreationFee: sdk.Coins{sdk.NewInt64Coin("uosmo", 100)}}) + app.TokenFactoryKeeper.SetParams(s.Ctx, types.Params{DenomCreationFee: sdk.Coins{sdk.NewInt64Coin(appparams.BaseCoinUnit, 100)}}) app.TokenFactoryKeeper.InitGenesis(s.Ctx, genesisState) // check that the module account is now initialized diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 6d40cd51600..e79d247b101 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -7,6 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + appparams "github.com/osmosis-labs/osmosis/v24/app/params" ) // TestMintDenomMsg tests TypeMsgMint message is emitted on a successful mint @@ -217,12 +219,12 @@ func (s *KeeperTestSuite) TestSetDenomMetaDataMsg() { Exponent: 0, }, { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 6, }, }, Base: s.defaultDenom, - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), @@ -239,12 +241,12 @@ func (s *KeeperTestSuite) TestSetDenomMetaDataMsg() { Exponent: 0, }, { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, Exponent: 6, }, }, Base: fmt.Sprintf("factory/%s/litecoin", s.TestAccs[0].String()), - Display: "uosmo", + Display: appparams.BaseCoinUnit, Name: "OSMO", Symbol: "OSMO", }), diff --git a/x/txfees/client/cli/query_test.go b/x/txfees/client/cli/query_test.go index 84c7377d32b..0406e7d5e75 100644 --- a/x/txfees/client/cli/query_test.go +++ b/x/txfees/client/cli/query_test.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/txfees/types" ) @@ -23,7 +24,7 @@ func (s *QueryTestSuite) SetupSuite() { // set up pool poolAssets := []sdk.Coin{ - sdk.NewInt64Coin("uosmo", 1000000), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 1000000), sdk.NewInt64Coin("stake", 120000000), } s.PrepareBalancerPoolWithCoins(poolAssets...) @@ -34,7 +35,7 @@ func (s *QueryTestSuite) SetupSuite() { "test", []types.FeeToken{ { - Denom: "uosmo", + Denom: appparams.BaseCoinUnit, PoolID: 1, }, }, @@ -61,13 +62,13 @@ func (s *QueryTestSuite) TestQueriesNeverAlterState() { { "Query poolID by denom", "/osmosis.txfees.v1beta1.Query/DenomPoolId", - &types.QueryDenomPoolIdRequest{Denom: "uosmo"}, + &types.QueryDenomPoolIdRequest{Denom: appparams.BaseCoinUnit}, &types.QueryDenomPoolIdResponse{}, }, { "Query spot price by denom", "/osmosis.txfees.v1beta1.Query/DenomSpotPrice", - &types.QueryDenomSpotPriceRequest{Denom: "uosmo"}, + &types.QueryDenomSpotPriceRequest{Denom: appparams.BaseCoinUnit}, &types.QueryDenomSpotPriceResponse{}, }, { diff --git a/x/txfees/keeper/feedecorator.go b/x/txfees/keeper/feedecorator.go index 5c6941f4896..b6bbad40074 100644 --- a/x/txfees/keeper/feedecorator.go +++ b/x/txfees/keeper/feedecorator.go @@ -9,6 +9,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" mempool1559 "github.com/osmosis-labs/osmosis/v24/x/txfees/keeper/mempool-1559" "github.com/osmosis-labs/osmosis/v24/x/txfees/keeper/txfee_filters" "github.com/osmosis-labs/osmosis/v24/x/txfees/types" @@ -251,7 +252,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo // if we are simulating, set the fees to 1 uosmo as they don't matter. // set it as coming from the burn addr if simulate && fees.IsZero() { - fees = sdk.NewCoins(sdk.NewInt64Coin("uosmo", 1)) + fees = sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 1)) burnAcctAddr, _ := sdk.AccAddressFromBech32("osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmcn030") // were doing 1 extra get account call alas burnAcct := dfd.ak.GetAccount(ctx, burnAcctAddr) diff --git a/x/txfees/keeper/feedecorator_test.go b/x/txfees/keeper/feedecorator_test.go index 57be29cc67e..c9f607d88e8 100644 --- a/x/txfees/keeper/feedecorator_test.go +++ b/x/txfees/keeper/feedecorator_test.go @@ -7,6 +7,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/osmosis-labs/osmosis/osmomath" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/txfees/types" ) @@ -148,7 +149,7 @@ func (s *KeeperTestSuite) TestFeeDecorator() { s.SetupTest(false) s.Run(tc.name, func() { // See DeductFeeDecorator AnteHandler for how this is used - s.FundAcc(sdk.MustAccAddressFromBech32("osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmcn030"), sdk.NewCoins(sdk.NewInt64Coin("uosmo", 1))) + s.FundAcc(sdk.MustAccAddressFromBech32("osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmcn030"), sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 1))) err := s.SetupTxFeeAnteHandlerAndChargeFee(s.clientCtx, tc.minGasPrices, tc.gasRequested, tc.isCheckTx, tc.isSimulate, tc.txFee) if tc.expectPass { diff --git a/x/txfees/keeper/genesis_test.go b/x/txfees/keeper/genesis_test.go index 569917d9b72..fdb4c5f306e 100644 --- a/x/txfees/keeper/genesis_test.go +++ b/x/txfees/keeper/genesis_test.go @@ -3,11 +3,12 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/txfees/types" ) var ( - testBaseDenom = "uosmo" + testBaseDenom = appparams.BaseCoinUnit testFeeTokens = []types.FeeToken{ { Denom: "uion", @@ -23,8 +24,8 @@ var ( func (s *KeeperTestSuite) TestInitGenesis() { s.SetupTest(false) - s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000000000000000)), sdk.NewCoin("uion", sdk.NewInt(1000000000000000000)))...) - s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000000000000000)), sdk.NewCoin("wbtc", sdk.NewInt(1000000000000000000)))...) + s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000000000000000)), sdk.NewCoin("uion", sdk.NewInt(1000000000000000000)))...) + s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000000000000000)), sdk.NewCoin("wbtc", sdk.NewInt(1000000000000000000)))...) s.App.TxFeesKeeper.InitGenesis(s.Ctx, types.GenesisState{ Basedenom: testBaseDenom, @@ -45,8 +46,8 @@ func (s *KeeperTestSuite) TestInitGenesis() { func (s *KeeperTestSuite) TestExportGenesis() { s.SetupTest(false) - s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000000000000000)), sdk.NewCoin("uion", sdk.NewInt(1000000000000000000)))...) - s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000000000000000)), sdk.NewCoin("wbtc", sdk.NewInt(1000000000000000000)))...) + s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000000000000000)), sdk.NewCoin("uion", sdk.NewInt(1000000000000000000)))...) + s.PrepareBalancerPoolWithCoins(sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(1000000000000000000)), sdk.NewCoin("wbtc", sdk.NewInt(1000000000000000000)))...) s.App.TxFeesKeeper.InitGenesis(s.Ctx, types.GenesisState{ Basedenom: testBaseDenom, diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 194bbece810..89dbdf8a6ab 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -12,6 +12,7 @@ import ( osmosisapp "github.com/osmosis-labs/osmosis/v24/app" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" protorevtypes "github.com/osmosis-labs/osmosis/v24/x/protorev/types" "github.com/osmosis-labs/osmosis/v24/x/txfees/types" ) @@ -58,7 +59,7 @@ func (s *KeeperTestSuite) SetupTest(isCheckTx bool) { s.FundAcc(acc, sdk.NewCoins( sdk.NewCoin(sdk.DefaultBondDenom, osmomath.NewInt(10000000000)), - sdk.NewCoin("uosmo", osmomath.NewInt(100000000000000000)), // Needed for pool creation fee + sdk.NewCoin(appparams.BaseCoinUnit, osmomath.NewInt(100000000000000000)), // Needed for pool creation fee sdk.NewCoin("uion", osmomath.NewInt(10000000)), sdk.NewCoin("atom", osmomath.NewInt(10000000)), sdk.NewCoin("ust", osmomath.NewInt(10000000)), diff --git a/x/txfees/keeper/txfee_filters/arb_tx_test.go b/x/txfees/keeper/txfee_filters/arb_tx_test.go index 88be1d48c03..7c12a2e71a5 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx_test.go +++ b/x/txfees/keeper/txfee_filters/arb_tx_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/osmosis-labs/osmosis/v24/app/apptesting" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" "github.com/osmosis-labs/osmosis/v24/x/gamm/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types" "github.com/osmosis-labs/osmosis/v24/x/txfees/keeper/txfee_filters" @@ -31,7 +32,7 @@ func (suite *KeeperTestSuite) TestIsArbTxLooseAuthz_AffiliateSwapMsg() { Routes: []poolmanagertypes.SwapAmountInRoute{ { PoolId: 1221, - TokenOutDenom: "uosmo", + TokenOutDenom: appparams.BaseCoinUnit, }, { PoolId: 3, diff --git a/x/valset-pref/keeper_test.go b/x/valset-pref/keeper_test.go index 6c59b7e4a7b..7f556ed6f8d 100644 --- a/x/valset-pref/keeper_test.go +++ b/x/valset-pref/keeper_test.go @@ -14,6 +14,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v24/app/apptesting" appParams "github.com/osmosis-labs/osmosis/v24/app/params" + appparams "github.com/osmosis-labs/osmosis/v24/app/params" lockuptypes "github.com/osmosis-labs/osmosis/v24/x/lockup/types" "github.com/osmosis-labs/osmosis/v24/x/valset-pref/types" @@ -467,7 +468,7 @@ func (s *KeeperTestSuite) SetupLocks(delegator sdk.AccAddress) []lockuptypes.Per syntheticLocks, err := s.App.LockupKeeper.CreateLock(s.Ctx, delegator, osmoToLock, twoWeekDuration) s.Require().NoError(err) - err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, syntheticLocks.ID, "uosmo", time.Minute, true) + err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, syntheticLocks.ID, appparams.BaseCoinUnit, time.Minute, true) s.Require().NoError(err) locks = append(locks, syntheticLocks)