Skip to content
Permalink
Browse files
App module init changed (stakingKeeper pointer) (#184)
  • Loading branch information
Mikhail Kornilov committed Aug 5, 2020
1 parent 89b6c8b commit bbf0da0358b83584b6fa021aae49af0534a13be0
Showing 1 changed file with 27 additions and 27 deletions.
@@ -122,9 +122,9 @@ type DnServiceApp struct {
supplyKeeper supply.Keeper
stakingKeeper staking.Keeper
mintKeeper mint.Keeper
evidenceKeeper evidence.Keeper
distrKeeper distribution.Keeper
slashingKeeper slashing.Keeper
evidenceKeeper evidence.Keeper
ccKeeper currencies.Keeper
poaKeeper poa.Keeper
msKeeper multisig.Keeper
@@ -325,39 +325,17 @@ func NewDnServiceApp(logger log.Logger, db dbm.DB, config *config.VMConfig, invC
app.mintKeeper = mint.NewKeeper(
cdc, keys[mint.StoreKey],
app.paramsKeeper.Subspace(mint.DefaultParamspace),
stakingKeeper,
&stakingKeeper,
app.supplyKeeper,
auth.FeeCollectorName,
)

// EvidenceKeeper catchs double sign and provide evidence to confirm Byzantine validators.
evidenceKeeper := evidence.NewKeeper(
cdc,
keys[evidence.StoreKey],
app.paramsKeeper.Subspace(evidence.DefaultParamspace),
stakingKeeper,
app.slashingKeeper,
)
evidenceRouter := evidence.NewRouter()
evidenceKeeper.SetRouter(evidenceRouter)
app.evidenceKeeper = *evidenceKeeper

// Initialize currency keeper.
app.ccKeeper = currencies.NewKeeper(
cdc,
keys[currencies.StoreKey],
app.bankKeeper,
app.supplyKeeper,
app.ccsKeeper,
appModulePerms(currencies.AvailablePermissions),
)

// DistributionKeeper distributes rewards between Proof-of-Stake validators and delegators.
app.distrKeeper = distribution.NewKeeper(
cdc,
keys[distribution.StoreKey],
app.paramsKeeper.Subspace(distribution.DefaultParamspace),
stakingKeeper,
&stakingKeeper,
app.supplyKeeper,
auth.FeeCollectorName,
app.ModuleAccountAddrs(),
@@ -367,10 +345,22 @@ func NewDnServiceApp(logger log.Logger, db dbm.DB, config *config.VMConfig, invC
app.slashingKeeper = slashing.NewKeeper(
cdc,
keys[slashing.StoreKey],
stakingKeeper,
&stakingKeeper,
app.paramsKeeper.Subspace(slashing.DefaultParamspace),
)

// EvidenceKeeper catchs double sign and provide evidence to confirm Byzantine validators.
evidenceKeeper := evidence.NewKeeper(
cdc,
keys[evidence.StoreKey],
app.paramsKeeper.Subspace(evidence.DefaultParamspace),
&stakingKeeper,
app.slashingKeeper,
)
evidenceRouter := evidence.NewRouter()
evidenceKeeper.SetRouter(evidenceRouter)
app.evidenceKeeper = *evidenceKeeper

// Initialize StakingKeeper.
app.stakingKeeper = *stakingKeeper.SetHooks(
staking.NewMultiStakingHooks(
@@ -379,6 +369,16 @@ func NewDnServiceApp(logger log.Logger, db dbm.DB, config *config.VMConfig, invC
),
)

// Initialize currency keeper.
app.ccKeeper = currencies.NewKeeper(
cdc,
keys[currencies.StoreKey],
app.bankKeeper,
app.supplyKeeper,
app.ccsKeeper,
appModulePerms(currencies.AvailablePermissions),
)

// PoaKeeper stores list of Proof-of-Authority validators used by multisig system.
app.poaKeeper = poa.NewKeeper(
cdc,
@@ -521,14 +521,14 @@ func NewDnServiceApp(logger log.Logger, db dbm.DB, config *config.VMConfig, invC
mint.ModuleName,
evidence.ModuleName,
supply.ModuleName,
crisis.ModuleName,
poa.ModuleName,
multisig.ModuleName,
currencies.ModuleName,
oracle.ModuleName,
markets.ModuleName,
orders.ModuleName,
orderbook.ModuleName,
crisis.ModuleName,
genutil.ModuleName,
)

0 comments on commit bbf0da0

Please sign in to comment.