-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #680 from UnUniFi/develop
v3.2.1 for mainnet
- Loading branch information
Showing
7 changed files
with
599 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v3_2_1 | ||
|
||
import ( | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" | ||
buildertypes "github.com/skip-mev/pob/x/builder/types" | ||
|
||
"github.com/UnUniFi/chain/app/upgrades" | ||
nftfactorytypes "github.com/UnUniFi/chain/x/nftfactory/types" | ||
) | ||
|
||
const UpgradeName string = "v3_2_1" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{nftfactorytypes.StoreKey, buildertypes.StoreKey, ibchookstypes.StoreKey}, | ||
Deleted: []string{}, | ||
}, | ||
} |
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,48 @@ | ||
package v3_2_1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
|
||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
|
||
"github.com/UnUniFi/chain/app/keepers" | ||
"github.com/UnUniFi/chain/app/upgrades" | ||
yieldaggregatortypes "github.com/UnUniFi/chain/x/yieldaggregator/types" | ||
) | ||
|
||
func CreateUpgradeHandler(mm *module.Manager, | ||
configurator module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
keepers *keepers.AppKeepers) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
ctx.Logger().Info(fmt.Sprintf("update start:%s", UpgradeName)) | ||
|
||
iyaParams := yieldaggregatortypes.Params{} | ||
paramtypes.NewKeyTable().RegisterParamSet(&yieldaggregatortypes.Params{}) | ||
keepers.GetSubspace(yieldaggregatortypes.ModuleName).WithKeyTable(yieldaggregatortypes.ParamKeyTable()).GetParamSet(ctx, &iyaParams) | ||
|
||
vm, err := mm.RunMigrations(ctx, configurator, vm) | ||
if err != nil { | ||
return vm, err | ||
} | ||
|
||
factoryParam, err := keepers.NftfactoryKeeper.GetParams(ctx) | ||
if err != nil { | ||
return vm, err | ||
} | ||
factoryParam.ClassCreationFee = []sdk.Coin{} | ||
factoryParam.FeeCollectorAddress = "" | ||
_ = keepers.NftfactoryKeeper.SetParams(ctx, factoryParam) | ||
|
||
iyaParams.FeeCollectorAddress = keepers.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName).GetAddress().String() | ||
_ = keepers.YieldaggregatorKeeper.SetParams(ctx, &iyaParams) | ||
|
||
return vm, nil | ||
} | ||
} |
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,45 @@ | ||
package types | ||
|
||
import ( | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" | ||
) | ||
|
||
const ( | ||
// ProposalTypeAddStrategy defines the type for a ProposalAddStrategy | ||
ProposalTypeAddStrategy = "AddStrategy" | ||
) | ||
|
||
func init() { | ||
govtypes.RegisterProposalType(ProposalTypeAddStrategy) | ||
} | ||
|
||
// Assert ProposalAddStrategy implements govtypes.Content at compile-time | ||
var _ govtypes.Content = &ProposalAddStrategy{} | ||
|
||
// Deprecated: Just for backward compatibility | ||
func NewProposalAddStrategy(title, description string, denom, contractAddr, name, gitUrl string) *ProposalAddStrategy { | ||
return &ProposalAddStrategy{ | ||
Title: title, | ||
Description: description, | ||
Denom: denom, | ||
ContractAddress: contractAddr, | ||
Name: name, | ||
GitUrl: gitUrl, | ||
} | ||
} | ||
|
||
// ProposalRoute returns the routing key of a parameter change proposal. | ||
func (p *ProposalAddStrategy) ProposalRoute() string { return RouterKey } | ||
|
||
// ProposalType returns the type of a parameter change proposal. | ||
func (p *ProposalAddStrategy) ProposalType() string { return ProposalTypeAddStrategy } | ||
|
||
// ValidateBasic validates the parameter change proposal | ||
func (p *ProposalAddStrategy) ValidateBasic() error { | ||
err := govtypes.ValidateAbstract(p) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.