Skip to content

Commit

Permalink
Lots of breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
njmurarka committed Mar 31, 2020
1 parent 30d8a38 commit ce04b48
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/supply"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
"github.com/cosmos/modules/incubator/faucet"
"github.com/spf13/viper"
Expand Down Expand Up @@ -71,6 +71,7 @@ var (
params.AppModuleBasic{},
slashing.AppModuleBasic{},
supply.AppModuleBasic{},
upgrade.AppModuleBasic{},
crud.AppModule{},
faucet.AppModule{},
)
Expand Down Expand Up @@ -126,6 +127,7 @@ type CRUDApp struct {
govKeeper gov.Keeper
supplyKeeper supply.Keeper
paramsKeeper params.Keeper
upgradeKeeper upgrade.Keeper
crudKeeper crud.Keeper
faucetKeeper faucet.Keeper

Expand All @@ -134,7 +136,7 @@ type CRUDApp struct {
}

func NewCRUDApp(
logger log.Logger, db dbm.DB, baseAppOptions ...func(*bam.BaseApp),
logger log.Logger, db dbm.DB, skipUpgradeHeights map[int64]bool, home string, baseAppOptions ...func(*bam.BaseApp),
) *CRUDApp {

// First define the top level codec that will be shared by the different modules
Expand All @@ -145,7 +147,7 @@ func NewCRUDApp(

bApp.SetAppVersion(version.Version)

keys := sdk.NewKVStoreKeys(bam.MainStoreKey, auth.StoreKey, staking.StoreKey, supply.StoreKey, distr.StoreKey, slashing.StoreKey, gov.StoreKey, params.StoreKey, crud.StoreKey, faucet.StoreKey, crud.LeaseKey)
keys := sdk.NewKVStoreKeys(bam.MainStoreKey, auth.StoreKey, staking.StoreKey, supply.StoreKey, distr.StoreKey, slashing.StoreKey, gov.StoreKey, params.StoreKey, crud.StoreKey, faucet.StoreKey, upgrade.StoreKey, crud.LeaseKey)

tkeys := sdk.NewTransientStoreKeys(staking.TStoreKey, params.TStoreKey)

Expand Down Expand Up @@ -191,25 +193,24 @@ func NewCRUDApp(
maccPerms,
)

// The staking keeper
stakingKeeper := staking.NewKeeper(
app.cdc,
keys[staking.StoreKey],
app.supplyKeeper,
stakingSubspace,
)

// Register the proposal types
govRouter := gov.NewRouter()
govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
AddRoute(distr.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)).
AddRoute(upgrade.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper))
app.govKeeper = gov.NewKeeper(
appCodec, keys[gov.StoreKey], govSubspace,
app.cdc, keys[gov.StoreKey], govSubspace,
app.supplyKeeper, &stakingKeeper, govRouter,
)

// The staking keeper
stakingKeeper := staking.NewKeeper(
app.cdc,
keys[staking.StoreKey],
app.supplyKeeper,
stakingSubspace,
)

app.distrKeeper = distr.NewKeeper(
app.cdc,
keys[distr.StoreKey],
Expand All @@ -227,6 +228,8 @@ func NewCRUDApp(
slashingSubspace,
)

app.upgradeKeeper = upgrade.NewKeeper(skipUpgradeHeights, keys[upgrade.StoreKey], app.cdc)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.stakingKeeper = *stakingKeeper.SetHooks(
Expand Down

0 comments on commit ce04b48

Please sign in to comment.