Skip to content

Commit

Permalink
remove airdrop module, migrate module account and IncentiveSpend mess…
Browse files Browse the repository at this point in the history
…age type to x/supply
  • Loading branch information
joe-bowman committed Jan 27, 2025
1 parent 166c496 commit 3abb96b
Show file tree
Hide file tree
Showing 74 changed files with 453 additions and 13,562 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (

"github.com/quicksilver-zone/quicksilver/app/keepers"
"github.com/quicksilver-zone/quicksilver/docs"
airdroptypes "github.com/quicksilver-zone/quicksilver/x/airdrop/types"
interchainstakingtypes "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types"
supplytypes "github.com/quicksilver-zone/quicksilver/x/supply/types"
)

func Init() {
Expand All @@ -64,7 +64,7 @@ var (
allowedReceivingModAcc = map[string]bool{
distrtypes.ModuleName: true,
interchainstakingtypes.ModuleName: true,
airdroptypes.ModuleName: true,
supplytypes.AirdropAccount: true,
}
)

Expand Down
21 changes: 1 addition & 20 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ import (

appconfig "github.com/quicksilver-zone/quicksilver/cmd/config"
"github.com/quicksilver-zone/quicksilver/utils"
airdropkeeper "github.com/quicksilver-zone/quicksilver/x/airdrop/keeper"
airdroptypes "github.com/quicksilver-zone/quicksilver/x/airdrop/types"
claimsmanagerkeeper "github.com/quicksilver-zone/quicksilver/x/claimsmanager/keeper"
claimsmanagertypes "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types"
epochskeeper "github.com/quicksilver-zone/quicksilver/x/epochs/keeper"
Expand Down Expand Up @@ -111,7 +109,6 @@ type AppKeepers struct {
InterchainstakingKeeper *interchainstakingkeeper.Keeper
InterchainQueryKeeper interchainquerykeeper.Keeper
ParticipationRewardsKeeper *participationrewardskeeper.Keeper
AirdropKeeper *airdropkeeper.Keeper
SupplyKeeper supplykeeper.Keeper

// IBC keepers
Expand Down Expand Up @@ -334,6 +331,7 @@ func (appKeepers *AppKeepers) InitKeepers(
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
utils.Keys[[]string](maccPerms),
supplyEndpointEnabled,
)
Expand Down Expand Up @@ -489,22 +487,6 @@ func (appKeepers *AppKeepers) InitKeepers(
govConfig,
)

appKeepers.AirdropKeeper = airdropkeeper.NewKeeper(
appCodec,
appKeepers.keys[airdroptypes.StoreKey],
appKeepers.GetSubspace(airdroptypes.ModuleName),
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
appKeepers.GovKeeper,
appKeepers.IBCKeeper,
appKeepers.InterchainstakingKeeper,
appKeepers.ParticipationRewardsKeeper,
proofOpsFn,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
// airdropModule := airdrop.NewAppModule(appCodec, appKeepers.AirdropKeeper)

appKeepers.ScopedIBCKeeper = scopedIBCKeeper
appKeepers.ScopedTransferKeeper = scopedTransferKeeper
appKeepers.ScopedICAControllerKeeper = scopedICAControllerKeeper
Expand Down Expand Up @@ -536,7 +518,6 @@ func (*AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *cod
paramsKeeper.Subspace(interchainstakingtypes.ModuleName)
paramsKeeper.Subspace(interchainquerytypes.ModuleName)
paramsKeeper.Subspace(participationrewardstypes.ModuleName)
paramsKeeper.Subspace(airdroptypes.ModuleName)

return paramsKeeper
}
Expand Down
2 changes: 0 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"

airdroptypes "github.com/quicksilver-zone/quicksilver/x/airdrop/types"
claimsmanagertypes "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types"
epochstypes "github.com/quicksilver-zone/quicksilver/x/epochs/types"
interchainquerytypes "github.com/quicksilver-zone/quicksilver/x/interchainquery/types"
Expand Down Expand Up @@ -62,7 +61,6 @@ func KVStoreKeys() []string {
interchainstakingtypes.StoreKey,
interchainquerytypes.StoreKey,
participationrewardstypes.StoreKey,
airdroptypes.StoreKey,
supplytypes.StoreKey,
}
}
Expand Down
10 changes: 1 addition & 9 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ import (
ibcclientclient "github.com/cosmos/ibc-go/v6/modules/core/02-client/client"
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"

"github.com/quicksilver-zone/quicksilver/x/airdrop"
airdroptypes "github.com/quicksilver-zone/quicksilver/x/airdrop/types"
"github.com/quicksilver-zone/quicksilver/x/claimsmanager"
claimsmanagertypes "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types"
"github.com/quicksilver-zone/quicksilver/x/epochs"
Expand Down Expand Up @@ -105,7 +103,6 @@ var (
interchainstaking.AppModuleBasic{},
interchainquery.AppModuleBasic{},
participationrewards.AppModuleBasic{},
airdrop.AppModuleBasic{},
supply.AppModuleBasic{},
)

Expand All @@ -124,7 +121,7 @@ var (
interchainstakingtypes.EscrowModuleAccount: {authtypes.Burner},
interchainquerytypes.ModuleName: nil,
participationrewardstypes.ModuleName: nil,
airdroptypes.ModuleName: nil,
supplytypes.AirdropAccount: nil,
packetforwardtypes.ModuleName: nil,
}
)
Expand Down Expand Up @@ -170,7 +167,6 @@ func appModules(
interchainstaking.NewAppModule(appCodec, app.InterchainstakingKeeper),
interchainquery.NewAppModule(appCodec, app.InterchainQueryKeeper),
participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
supply.NewAppModule(appCodec, app.SupplyKeeper),
}
}
Expand Down Expand Up @@ -208,7 +204,6 @@ func simulationModules(
interchainstaking.NewAppModule(appCodec, app.InterchainstakingKeeper),
interchainquery.NewAppModule(appCodec, app.InterchainQueryKeeper),
participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
// supply.NewAppModule(appCodec, app.SupplyKeeper),
}
}
Expand Down Expand Up @@ -244,7 +239,6 @@ func orderBeginBlockers() []string {
packetforwardtypes.ModuleName,
claimsmanagertypes.ModuleName,
participationrewardstypes.ModuleName,
airdroptypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
Expand Down Expand Up @@ -295,7 +289,6 @@ func orderEndBlockers() []string {
claimsmanagertypes.ModuleName,
interchainstakingtypes.ModuleName,
participationrewardstypes.ModuleName,
airdroptypes.ModuleName,
supplytypes.ModuleName,
// currently no-op.
}
Expand Down Expand Up @@ -337,7 +330,6 @@ func orderInitBlockers() []string {
interchainstakingtypes.ModuleName,
interchainquerytypes.ModuleName,
participationrewardstypes.ModuleName,
airdroptypes.ModuleName,
supplytypes.ModuleName,
// NOTE: crisis module must go at the end to check for invariants on each module
crisistypes.ModuleName,
Expand Down
9 changes: 7 additions & 2 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import (
)

const (
wasmModuleName = "wasm"
tfModuleName = "tokenfactory"
wasmModuleName = "wasm"
tfModuleName = "tokenfactory"
airdropModuleName = "airdrop"
)

func (app *Quicksilver) setUpgradeHandlers() {
Expand Down Expand Up @@ -76,6 +77,10 @@ func (app *Quicksilver) setUpgradeStoreLoaders() {
storeUpgrades = &storetypes.StoreUpgrades{
Deleted: []string{wasmModuleName, tfModuleName},
}
case upgrades.V010706UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Deleted: []string{airdropModuleName},
}
default:
// no-op
}
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (
V010702UpgradeName = "v1.7.2"
V010704UpgradeName = "v1.7.4"
V010705UpgradeName = "v1.7.5"
V010706UpgradeName = "v1.7.6"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func Upgrades() []Upgrade {
{UpgradeName: V010702UpgradeName, CreateUpgradeHandler: V010702UpgradeHandler},
{UpgradeName: V010704UpgradeName, CreateUpgradeHandler: V010704UpgradeHandler},
{UpgradeName: V010705UpgradeName, CreateUpgradeHandler: V010705UpgradeHandler},
{UpgradeName: V010706UpgradeName, CreateUpgradeHandler: V010706UpgradeHandler},
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/upgrades/v1_7.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,13 @@ func V010705UpgradeHandler(
return mm.RunMigrations(ctx, configurator, fromVM)
}
}

func V010706UpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
appKeepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, fromVM)
}
}
Loading

0 comments on commit 3abb96b

Please sign in to comment.