Skip to content

Commit

Permalink
chore: don't use hardcoded "uosmo" string (#8141)
Browse files Browse the repository at this point in the history
* use uosmo var

* fix lint

* tidy
  • Loading branch information
czarcas7ic authored Apr 25, 2024
1 parent b3ce7cb commit c25e4e0
Show file tree
Hide file tree
Showing 98 changed files with 558 additions and 463 deletions.
12 changes: 7 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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 {
Expand All @@ -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),
Expand Down
3 changes: 2 additions & 1 deletion app/apptesting/concentrated_liquidity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

Expand Down
8 changes: 4 additions & 4 deletions app/apptesting/gamm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)),
Expand All @@ -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)),
},
}

Expand Down Expand Up @@ -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)
}
Expand Down
9 changes: 5 additions & 4 deletions app/upgrades/v15/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)),
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down
5 changes: 3 additions & 2 deletions app/upgrades/v16/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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,
Expand Down
17 changes: 9 additions & 8 deletions app/upgrades/v16/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v17/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,7 +33,7 @@ var Upgrade = upgrades.Upgrade{
}

const (
OSMO = "uosmo"
OSMO = appparams.BaseCoinUnit
TickSpacing = 100
)

Expand Down
25 changes: 13 additions & 12 deletions app/upgrades/v17/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v18/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v21/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit c25e4e0

Please sign in to comment.