Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kvstore delegationplan #98

Merged
merged 13 commits into from
Jun 7, 2022
53 changes: 46 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ import (
"github.com/ingenuity-build/quicksilver/x/interchainquery"
interchainquerykeeper "github.com/ingenuity-build/quicksilver/x/interchainquery/keeper"
interchainquerytypes "github.com/ingenuity-build/quicksilver/x/interchainquery/types"

"github.com/ingenuity-build/quicksilver/x/participationrewards"
participationrewardskeeper "github.com/ingenuity-build/quicksilver/x/participationrewards/keeper"
participationrewardstypes "github.com/ingenuity-build/quicksilver/x/participationrewards/types"
)

func init() {
Expand Down Expand Up @@ -164,6 +168,7 @@ var (
epochs.AppModuleBasic{},
interchainstaking.AppModuleBasic{},
interchainquery.AppModuleBasic{},
participationrewards.AppModuleBasic{},
)

// module account permissions
Expand All @@ -179,6 +184,8 @@ var (
icatypes.ModuleName: nil,
interchainstakingtypes.ModuleName: {authtypes.Minter, authtypes.Burner},
interchainquerytypes.ModuleName: nil,
// TODO: Remove Burner from participationrewards - for dev/test only;
participationrewardstypes.ModuleName: {authtypes.Burner},
}

// module accounts that are allowed to receive tokens
Expand Down Expand Up @@ -231,9 +238,10 @@ type Quicksilver struct {
TransferKeeper ibctransferkeeper.Keeper

// Quicksilver keepers
EpochsKeeper epochskeeper.Keeper
InterchainstakingKeeper interchainstakingkeeper.Keeper
InterchainQueryKeeper interchainquerykeeper.Keeper
EpochsKeeper epochskeeper.Keeper
InterchainstakingKeeper interchainstakingkeeper.Keeper
InterchainQueryKeeper interchainquerykeeper.Keeper
ParticipationRewardsKeeper participationrewardskeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -286,7 +294,7 @@ func NewQuicksilver(
keys := sdk.NewKVStoreKeys(
// SDK keys
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
distrtypes.StoreKey, minttypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, capabilitytypes.StoreKey,
feegrant.StoreKey, authzkeeper.StoreKey,
Expand All @@ -298,6 +306,7 @@ func NewQuicksilver(
epochstypes.StoreKey,
interchainstakingtypes.StoreKey,
interchainquerytypes.StoreKey,
participationrewardstypes.StoreKey,
)

// Add the transient store key
Expand Down Expand Up @@ -417,19 +426,44 @@ func NewQuicksilver(
app.InterchainQueryKeeper = interchainquerykeeper.NewKeeper(appCodec, keys[interchainquerytypes.StoreKey], app.IBCKeeper)
interchainQueryModule := interchainquery.NewAppModule(appCodec, app.InterchainQueryKeeper)

app.InterchainstakingKeeper = interchainstakingkeeper.NewKeeper(appCodec, keys[interchainstakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.ICAControllerKeeper, scopedInterchainStakingKeeper, app.InterchainQueryKeeper, *app.IBCKeeper, app.GetSubspace(interchainstakingtypes.ModuleName))
app.InterchainstakingKeeper = interchainstakingkeeper.NewKeeper(
appCodec,
keys[interchainstakingtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.ICAControllerKeeper,
scopedInterchainStakingKeeper,
app.InterchainQueryKeeper,
*app.IBCKeeper,
app.GetSubspace(interchainstakingtypes.ModuleName),
)
interchainstakingModule := interchainstaking.NewAppModule(appCodec, app.InterchainstakingKeeper)

interchainstakingIBCModule := interchainstaking.NewIBCModule(app.InterchainstakingKeeper)

app.InterchainQueryKeeper.SetCallbackHandler(interchainstakingtypes.ModuleName, app.InterchainstakingKeeper.CallbackHandler())

app.ParticipationRewardsKeeper = participationrewardskeeper.NewKeeper(
appCodec,
keys[participationrewardstypes.StoreKey],
app.GetSubspace(participationrewardstypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.InterchainQueryKeeper,
app.InterchainstakingKeeper,
authtypes.FeeCollectorName,
)
participationrewardsModule := participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper)

app.InterchainQueryKeeper.SetCallbackHandler(participationrewardstypes.ModuleName, app.ParticipationRewardsKeeper.CallbackHandler())

// Quicksilver Keepers
epochsKeeper := epochskeeper.NewKeeper(appCodec, keys[epochstypes.StoreKey])
app.EpochsKeeper = *epochsKeeper.SetHooks(
epochstypes.NewMultiEpochHooks(
app.MintKeeper.Hooks(),
app.InterchainstakingKeeper.Hooks(),
app.ParticipationRewardsKeeper.Hooks(),
),
)

Expand Down Expand Up @@ -489,6 +523,7 @@ func NewQuicksilver(
epochs.NewAppModule(appCodec, app.EpochsKeeper),
interchainstakingModule,
interchainQueryModule,
participationrewardsModule,
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -502,8 +537,8 @@ func NewQuicksilver(
capabilitytypes.ModuleName,
// Note: epochs' begin should be "real" start of epochs, we keep epochs beginblock at the beginning
epochstypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
minttypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
Expand All @@ -513,6 +548,7 @@ func NewQuicksilver(
// no-op modules
ibctransfertypes.ModuleName,
icatypes.ModuleName,
participationrewardstypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
Expand Down Expand Up @@ -550,6 +586,7 @@ func NewQuicksilver(
upgradetypes.ModuleName,
vestingtypes.ModuleName,
interchainstakingtypes.ModuleName,
participationrewardstypes.ModuleName,
// currently no-op.
)

Expand Down Expand Up @@ -582,6 +619,7 @@ func NewQuicksilver(
epochstypes.ModuleName,
interchainstakingtypes.ModuleName,
interchainquerytypes.ModuleName,
participationrewardstypes.ModuleName,
// NOTE: crisis module must go at the end to check for invariants on each module
crisistypes.ModuleName,
)
Expand Down Expand Up @@ -877,8 +915,8 @@ func initParamsKeeper(
paramsKeeper.Subspace(authtypes.ModuleName)
paramsKeeper.Subspace(banktypes.ModuleName)
paramsKeeper.Subspace(stakingtypes.ModuleName)
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
Expand All @@ -890,5 +928,6 @@ func initParamsKeeper(
// quicksilver subspaces
paramsKeeper.Subspace(interchainstakingtypes.ModuleName)
paramsKeeper.Subspace(interchainquerytypes.ModuleName)
paramsKeeper.Subspace(participationrewardstypes.ModuleName)
return paramsKeeper
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
context: .
dockerfile: Dockerfile.hermes
icq:
image: quicksilverzone/interchain-queries:v0.2.0
image: quicksilverzone/interchain-queries:v0.2.1
volumes:
- ./data/icq:/icq/.icq
command:
Expand Down
Loading