Skip to content

Commit

Permalink
Update app for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
phamminh0811 committed Sep 17, 2024
1 parent 458984a commit 8bda247
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ import (
v7_1 "github.com/classic-terra/core/v3/app/upgrades/v7_1"
v8 "github.com/classic-terra/core/v3/app/upgrades/v8"
v8_1 "github.com/classic-terra/core/v3/app/upgrades/v8_1"
v8_2 "github.com/classic-terra/core/v3/app/upgrades/v8_2"
v9 "github.com/classic-terra/core/v3/app/upgrades/v9"
v9_1 "github.com/classic-terra/core/v3/app/upgrades/v9_1"

customante "github.com/classic-terra/core/v3/custom/auth/ante"
custompost "github.com/classic-terra/core/v3/custom/auth/post"
Expand Down Expand Up @@ -89,6 +91,8 @@ var (
v8.Upgrade,
v8_1.Upgrade,
v9.Upgrade,
v8_2.Upgrade,
v9_1.Upgrade,
}

// Forks defines forks to be applied to the network
Expand Down
13 changes: 13 additions & 0 deletions app/upgrades/v8_2/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//nolint:revive
package v8_2

import (
"github.com/classic-terra/core/v3/app/upgrades"
)

const UpgradeName = "v8_2"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV82UpgradeHandler,
}
24 changes: 24 additions & 0 deletions app/upgrades/v8_2/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//nolint:revive
package v8_2

import (
"github.com/classic-terra/core/v3/app/keepers"
"github.com/classic-terra/core/v3/app/upgrades"
treasurytypes "github.com/classic-terra/core/v3/x/treasury/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV82UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// set default oracle split
keepers.TreasuryKeeper.SetOracleSplitRate(ctx, treasurytypes.DefaultOracleSplit)
return mm.RunMigrations(ctx, cfg, fromVM)
}
}
12 changes: 12 additions & 0 deletions app/upgrades/v9_1/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package v91

import (
"github.com/classic-terra/core/v3/app/upgrades"
)

const UpgradeName = "v9_1"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV91UpgradeHandler,
}
31 changes: 31 additions & 0 deletions app/upgrades/v9_1/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package v91

import (
"github.com/classic-terra/core/v3/app/keepers"
"github.com/classic-terra/core/v3/app/upgrades"
tax2gastypes "github.com/classic-terra/core/v3/x/tax2gas/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV91UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// set default oracle split
keepers.TreasuryKeeper.SetTaxRate(ctx, sdk.ZeroDec())

tax2gasParams := tax2gastypes.DefaultParams()
tax2gasParams.GasPrices = sdk.NewDecCoins(
sdk.NewDecCoinFromDec("uluna", sdk.NewDecWithPrec(28325, 3)),
sdk.NewDecCoinFromDec("uusd", sdk.NewDecWithPrec(75, 2)),
)
tax2gasParams.MaxTotalBypassMinFeeMsgGasUsage = 200000
keepers.Tax2gasKeeper.SetParams(ctx, tax2gasParams)
return mm.RunMigrations(ctx, cfg, fromVM)
}
}

0 comments on commit 8bda247

Please sign in to comment.