-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry Pick for Testnet
v0.5.0
(#159)
Co-authored-by: Jack Zampolin <[email protected]> Co-authored-by: Andrew Gouin <[email protected]>
- Loading branch information
1 parent
d3e0a66
commit e0d0952
Showing
7 changed files
with
463 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package radon | ||
|
||
const ( | ||
// UpgradeName is the shared upgrade plan name for mainnet | ||
UpgradeName = "radon" | ||
// UpgradeInfo defines the binaries that will be used for the upgrade | ||
UpgradeInfo = "Noble Radon Upgrade" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package radon | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
|
||
paramauthoritykeeper "github.com/strangelove-ventures/paramauthority/x/params/keeper" | ||
|
||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
fiattokenfactorykeeper "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" | ||
globalfeetypes "github.com/strangelove-ventures/noble/x/globalfee/types" | ||
|
||
tarifftypes "github.com/strangelove-ventures/noble/x/tariff/types" | ||
) | ||
|
||
func CreateRadonUpgradeHandler( | ||
mm *module.Manager, | ||
cfg module.Configurator, | ||
paramauthoritykeeper paramauthoritykeeper.Keeper, | ||
fiatTFKeeper *fiattokenfactorykeeper.Keeper, | ||
|
||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
|
||
// New modules run AFTER the migrations, so to set the correct params after the default | ||
// becasuse RunMigrations runs `InitGenesis` on new modules`. | ||
versionMap, err := mm.RunMigrations(ctx, cfg, vm) | ||
|
||
// -- globalfee params -- | ||
minGasPrices := sdk.DecCoins{ | ||
sdk.NewDecCoinFromDec("udrachma", sdk.NewDecWithPrec(1, 2)), | ||
} | ||
globlaFeeParamsSubspace, ok := paramauthoritykeeper.GetSubspace(globalfeetypes.ModuleName) | ||
if !ok { | ||
panic("global fee params subspace not found") | ||
} | ||
globlaFeeParamsSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices) | ||
// -- -- | ||
|
||
// -- tariff params -- | ||
tariffParamsSubspace, ok := paramauthoritykeeper.GetSubspace(tarifftypes.ModuleName) | ||
if !ok { | ||
panic("tariff params subspace not found") | ||
} | ||
paramAuth := paramauthoritykeeper.GetAuthority(ctx) | ||
distributionEntities := []tarifftypes.DistributionEntity{ | ||
{ | ||
Address: paramAuth, | ||
Share: sdk.NewDec(1), | ||
}, | ||
} | ||
feeDenom := fiatTFKeeper.GetMintingDenom(ctx) | ||
tariffParams := tarifftypes.Params{ | ||
Share: sdk.NewDecWithPrec(8, 1), | ||
DistributionEntities: distributionEntities, | ||
TransferFeeBps: sdk.OneInt(), | ||
TransferFeeMax: sdk.NewInt(5000000), | ||
TransferFeeDenom: feeDenom.Denom, | ||
} | ||
tariffParamsSubspace.SetParamSet(ctx, &tariffParams) | ||
// -- -- | ||
|
||
return versionMap, err | ||
} | ||
} |
Oops, something went wrong.