Merge PR #190: Bump SDK version to latest master
This commit is contained in:
committed by
GitHub
parent
c48202e1aa
commit
a88a62bde2
31
app/app.go
31
app/app.go
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/bank"
|
||||
"github.com/cosmos/cosmos-sdk/x/crisis"
|
||||
distr "github.com/cosmos/cosmos-sdk/x/distribution"
|
||||
"github.com/cosmos/cosmos-sdk/x/evidence"
|
||||
"github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
@@ -54,6 +55,7 @@ var (
|
||||
crisis.AppModuleBasic{},
|
||||
slashing.AppModuleBasic{},
|
||||
supply.AppModuleBasic{},
|
||||
evidence.AppModuleBasic{},
|
||||
)
|
||||
|
||||
// module account permissions
|
||||
@@ -90,7 +92,7 @@ type GaiaApp struct {
|
||||
|
||||
// keys to access the substores
|
||||
keys map[string]*sdk.KVStoreKey
|
||||
tkeys map[string]*sdk.TransientStoreKey
|
||||
tKeys map[string]*sdk.TransientStoreKey
|
||||
|
||||
// keepers
|
||||
accountKeeper auth.AccountKeeper
|
||||
@@ -103,6 +105,7 @@ type GaiaApp struct {
|
||||
govKeeper gov.Keeper
|
||||
crisisKeeper crisis.Keeper
|
||||
paramsKeeper params.Keeper
|
||||
evidenceKeeper *evidence.Keeper
|
||||
|
||||
// the module manager
|
||||
mm *module.Manager
|
||||
@@ -124,22 +127,22 @@ func NewGaiaApp(
|
||||
bApp.SetAppVersion(version.Version)
|
||||
|
||||
keys := sdk.NewKVStoreKeys(
|
||||
bam.MainStoreKey, auth.StoreKey, staking.StoreKey,
|
||||
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
|
||||
gov.StoreKey, params.StoreKey,
|
||||
bam.MainStoreKey, auth.StoreKey, staking.StoreKey, supply.StoreKey,
|
||||
mint.StoreKey, distr.StoreKey, slashing.StoreKey, gov.StoreKey,
|
||||
params.StoreKey, evidence.StoreKey,
|
||||
)
|
||||
tkeys := sdk.NewTransientStoreKeys(staking.TStoreKey, params.TStoreKey)
|
||||
tKeys := sdk.NewTransientStoreKeys(staking.TStoreKey, params.TStoreKey)
|
||||
|
||||
app := &GaiaApp{
|
||||
BaseApp: bApp,
|
||||
cdc: cdc,
|
||||
invCheckPeriod: invCheckPeriod,
|
||||
keys: keys,
|
||||
tkeys: tkeys,
|
||||
tKeys: tKeys,
|
||||
}
|
||||
|
||||
// init params keeper and subspaces
|
||||
app.paramsKeeper = params.NewKeeper(app.cdc, keys[params.StoreKey], tkeys[params.TStoreKey], params.DefaultCodespace)
|
||||
app.paramsKeeper = params.NewKeeper(app.cdc, keys[params.StoreKey], tKeys[params.TStoreKey], params.DefaultCodespace)
|
||||
authSubspace := app.paramsKeeper.Subspace(auth.DefaultParamspace)
|
||||
bankSubspace := app.paramsKeeper.Subspace(bank.DefaultParamspace)
|
||||
stakingSubspace := app.paramsKeeper.Subspace(staking.DefaultParamspace)
|
||||
@@ -148,6 +151,7 @@ func NewGaiaApp(
|
||||
slashingSubspace := app.paramsKeeper.Subspace(slashing.DefaultParamspace)
|
||||
govSubspace := app.paramsKeeper.Subspace(gov.DefaultParamspace).WithKeyTable(gov.ParamKeyTable())
|
||||
crisisSubspace := app.paramsKeeper.Subspace(crisis.DefaultParamspace)
|
||||
evidenceSubspace := app.paramsKeeper.Subspace(evidence.DefaultParamspace)
|
||||
|
||||
// add keepers
|
||||
app.accountKeeper = auth.NewAccountKeeper(app.cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
|
||||
@@ -164,6 +168,14 @@ func NewGaiaApp(
|
||||
)
|
||||
app.crisisKeeper = crisis.NewKeeper(crisisSubspace, invCheckPeriod, app.supplyKeeper, auth.FeeCollectorName)
|
||||
|
||||
// create evidence keeper with evidence router
|
||||
app.evidenceKeeper = evidence.NewKeeper(
|
||||
app.cdc, keys[evidence.StoreKey], evidenceSubspace, evidence.DefaultCodespace,
|
||||
)
|
||||
evidenceRouter := evidence.NewRouter()
|
||||
// TODO: Register evidence routes.
|
||||
app.evidenceKeeper.SetRouter(evidenceRouter)
|
||||
|
||||
// register the proposal types
|
||||
govRouter := gov.NewRouter()
|
||||
govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler).
|
||||
@@ -193,6 +205,7 @@ func NewGaiaApp(
|
||||
mint.NewAppModule(app.mintKeeper),
|
||||
slashing.NewAppModule(app.slashingKeeper, app.stakingKeeper),
|
||||
staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.supplyKeeper),
|
||||
evidence.NewAppModule(*app.evidenceKeeper),
|
||||
)
|
||||
|
||||
// During begin block slashing happens after distr.BeginBlocker so that
|
||||
@@ -207,7 +220,7 @@ func NewGaiaApp(
|
||||
app.mm.SetOrderInitGenesis(
|
||||
distr.ModuleName, staking.ModuleName, auth.ModuleName, bank.ModuleName,
|
||||
slashing.ModuleName, gov.ModuleName, mint.ModuleName, supply.ModuleName,
|
||||
crisis.ModuleName, genutil.ModuleName,
|
||||
crisis.ModuleName, genutil.ModuleName, evidence.ModuleName,
|
||||
)
|
||||
|
||||
app.mm.RegisterInvariants(&app.crisisKeeper)
|
||||
@@ -232,7 +245,7 @@ func NewGaiaApp(
|
||||
|
||||
// initialize stores
|
||||
app.MountKVStores(keys)
|
||||
app.MountTransientStores(tkeys)
|
||||
app.MountTransientStores(tKeys)
|
||||
|
||||
// initialize BaseApp
|
||||
app.SetInitChainer(app.InitChainer)
|
||||
|
||||
Reference in New Issue
Block a user