Merge PR #4953: Remove distr keeper from staking app module

This commit is contained in:
Federico Kunze 2019-08-26 16:57:21 +02:00 committed by Alexander Bezobchuk
parent 450c8ced2c
commit 1d824d15a6
2 changed files with 7 additions and 10 deletions

View File

@ -184,7 +184,7 @@ func NewSimApp(
gov.NewAppModule(app.GovKeeper, app.SupplyKeeper), gov.NewAppModule(app.GovKeeper, app.SupplyKeeper),
mint.NewAppModule(app.MintKeeper), mint.NewAppModule(app.MintKeeper),
slashing.NewAppModule(app.SlashingKeeper, app.StakingKeeper), slashing.NewAppModule(app.SlashingKeeper, app.StakingKeeper),
staking.NewAppModule(app.StakingKeeper, app.DistrKeeper, app.AccountKeeper, app.SupplyKeeper), staking.NewAppModule(app.StakingKeeper, app.AccountKeeper, app.SupplyKeeper),
) )
// During begin block slashing happens after distr.BeginBlocker so that // During begin block slashing happens after distr.BeginBlocker so that

View File

@ -112,22 +112,19 @@ type AppModule struct {
AppModuleBasic AppModuleBasic
AppModuleSimulation AppModuleSimulation
keeper Keeper keeper Keeper
distrKeeper types.DistributionKeeper accountKeeper types.AccountKeeper
accKeeper types.AccountKeeper supplyKeeper types.SupplyKeeper
supplyKeeper types.SupplyKeeper
} }
// NewAppModule creates a new AppModule object // NewAppModule creates a new AppModule object
func NewAppModule(keeper Keeper, distrKeeper types.DistributionKeeper, accKeeper types.AccountKeeper, func NewAppModule(keeper Keeper, accountKeeper types.AccountKeeper, supplyKeeper types.SupplyKeeper) AppModule {
supplyKeeper types.SupplyKeeper) AppModule {
return AppModule{ return AppModule{
AppModuleBasic: AppModuleBasic{}, AppModuleBasic: AppModuleBasic{},
AppModuleSimulation: AppModuleSimulation{}, AppModuleSimulation: AppModuleSimulation{},
keeper: keeper, keeper: keeper,
distrKeeper: distrKeeper, accountKeeper: accountKeeper,
accKeeper: accKeeper,
supplyKeeper: supplyKeeper, supplyKeeper: supplyKeeper,
} }
} }
@ -167,7 +164,7 @@ func (am AppModule) NewQuerierHandler() sdk.Querier {
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate { func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState var genesisState GenesisState
ModuleCdc.MustUnmarshalJSON(data, &genesisState) ModuleCdc.MustUnmarshalJSON(data, &genesisState)
return InitGenesis(ctx, am.keeper, am.accKeeper, am.supplyKeeper, genesisState) return InitGenesis(ctx, am.keeper, am.accountKeeper, am.supplyKeeper, genesisState)
} }
// ExportGenesis returns the exported genesis state as raw bytes for the staking // ExportGenesis returns the exported genesis state as raw bytes for the staking