Skip to content

Commit

Permalink
Merge branch 'main' into issues/7/supplier_unstake_base
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Oct 10, 2023
2 parents e255cf4 + 55e6e91 commit d7a83b7
Show file tree
Hide file tree
Showing 55 changed files with 1,986 additions and 22 deletions.
49 changes: 36 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ import (
pocketmodulekeeper "pocket/x/pocket/keeper"
pocketmoduletypes "pocket/x/pocket/types"

servicemodule "pocket/x/service"
servicemodulekeeper "pocket/x/service/keeper"
servicemoduletypes "pocket/x/service/types"

sessionmodule "pocket/x/session"
sessionmodulekeeper "pocket/x/session/keeper"
sessionmoduletypes "pocket/x/session/types"
Expand Down Expand Up @@ -188,9 +192,10 @@ var (
vesting.AppModuleBasic{},
consensus.AppModuleBasic{},
pocketmodule.AppModuleBasic{},
suppliermodule.AppModuleBasic{},
servicemodule.AppModuleBasic{},
sessionmodule.AppModuleBasic{},
applicationmodule.AppModuleBasic{},
suppliermodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand All @@ -205,6 +210,7 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
suppliermoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
servicemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
applicationmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
// this line is used by starport scaffolding # stargate/app/maccPerms
}
Expand Down Expand Up @@ -269,9 +275,10 @@ type App struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper

PocketKeeper pocketmodulekeeper.Keeper
SupplierKeeper suppliermodulekeeper.Keeper
ServiceKeeper servicemodulekeeper.Keeper
SessionKeeper sessionmodulekeeper.Keeper
ApplicationKeeper applicationmodulekeeper.Keeper
SupplierKeeper suppliermodulekeeper.Keeper

// this line is used by starport scaffolding # stargate/app/keeperDeclaration

Expand Down Expand Up @@ -320,9 +327,10 @@ func New(
feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, icahosttypes.StoreKey,
capabilitytypes.StoreKey, group.StoreKey, icacontrollertypes.StoreKey, consensusparamtypes.StoreKey,
pocketmoduletypes.StoreKey,
suppliermoduletypes.StoreKey,
servicemoduletypes.StoreKey,
sessionmoduletypes.StoreKey,
applicationmoduletypes.StoreKey,
suppliermoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -553,15 +561,15 @@ func New(
)
pocketModule := pocketmodule.NewAppModule(appCodec, app.PocketKeeper, app.AccountKeeper, app.BankKeeper)

app.SupplierKeeper = *suppliermodulekeeper.NewKeeper(
app.ServiceKeeper = *servicemodulekeeper.NewKeeper(
appCodec,
keys[suppliermoduletypes.StoreKey],
keys[suppliermoduletypes.MemStoreKey],
app.GetSubspace(suppliermoduletypes.ModuleName),
keys[servicemoduletypes.StoreKey],
keys[servicemoduletypes.MemStoreKey],
app.GetSubspace(servicemoduletypes.ModuleName),

app.BankKeeper,
)
supplierModule := suppliermodule.NewAppModule(appCodec, app.SupplierKeeper, app.AccountKeeper, app.BankKeeper)
serviceModule := servicemodule.NewAppModule(appCodec, app.ServiceKeeper, app.AccountKeeper, app.BankKeeper)

app.SessionKeeper = *sessionmodulekeeper.NewKeeper(
appCodec,
Expand All @@ -581,6 +589,16 @@ func New(
)
applicationModule := applicationmodule.NewAppModule(appCodec, app.ApplicationKeeper, app.AccountKeeper, app.BankKeeper)

app.SupplierKeeper = *suppliermodulekeeper.NewKeeper(
appCodec,
keys[suppliermoduletypes.StoreKey],
keys[suppliermoduletypes.MemStoreKey],
app.GetSubspace(suppliermoduletypes.ModuleName),

app.BankKeeper,
)
supplierModule := suppliermodule.NewAppModule(appCodec, app.SupplierKeeper, app.AccountKeeper, app.BankKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition

/**** IBC Routing ****/
Expand Down Expand Up @@ -643,9 +661,10 @@ func New(
transferModule,
icaModule,
pocketModule,
supplierModule,
serviceModule,
sessionModule,
applicationModule,
supplierModule,
// this line is used by starport scaffolding # stargate/app/appModule

crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
Expand Down Expand Up @@ -679,9 +698,10 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
pocketmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
servicemoduletypes.ModuleName,
sessionmoduletypes.ModuleName,
applicationmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand All @@ -708,9 +728,10 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
pocketmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
servicemoduletypes.ModuleName,
sessionmoduletypes.ModuleName,
applicationmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -742,9 +763,10 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
pocketmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
servicemoduletypes.ModuleName,
sessionmoduletypes.ModuleName,
applicationmoduletypes.ModuleName,
suppliermoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -970,9 +992,10 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(pocketmoduletypes.ModuleName)
paramsKeeper.Subspace(suppliermoduletypes.ModuleName)
paramsKeeper.Subspace(servicemoduletypes.ModuleName)
paramsKeeper.Subspace(sessionmoduletypes.ModuleName)
paramsKeeper.Subspace(applicationmoduletypes.ModuleName)
paramsKeeper.Subspace(suppliermoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
Loading

0 comments on commit d7a83b7

Please sign in to comment.