Skip to content

Commit

Permalink
refactor: change name convention
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Apr 18, 2024
1 parent 34343f5 commit 13f953e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ import (
customstaking "github.com/notional-labs/composable/v6/custom/staking"
"github.com/spf13/cast"

router "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"
pfm "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"

custombankmodule "github.com/notional-labs/composable/v6/custom/bank"

Expand Down Expand Up @@ -201,7 +201,7 @@ var (
tendermint.AppModuleBasic{},
mint.AppModuleBasic{},
wasm.AppModuleBasic{},
router.AppModuleBasic{},
pfm.AppModuleBasic{},
ica.AppModuleBasic{},
ibc_hooks.AppModuleBasic{},
transfermiddleware.AppModuleBasic{},
Expand Down Expand Up @@ -342,7 +342,7 @@ func NewComposableApp(

// transferModule := transfer.NewAppModule(app.TransferKeeper)
transferModule := customibctransfer.NewAppModule(appCodec, app.TransferKeeper, app.BankKeeper)
routerModule := router.NewAppModule(app.RouterKeeper, app.GetSubspace(routertypes.ModuleName))
pfmModule := pfm.NewAppModule(app.PfmKeeper, app.GetSubspace(pfmtypes.ModuleName))
transfermiddlewareModule := transfermiddleware.NewAppModule(&app.TransferMiddlewareKeeper)
txBoundaryModule := txBoundary.NewAppModule(appCodec, app.TxBoundaryKeepper)
ratelimitModule := ratelimitmodule.NewAppModule(&app.RatelimitKeeper)
Expand Down Expand Up @@ -389,7 +389,7 @@ func NewComposableApp(
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
wasm08.NewAppModule(app.Wasm08Keeper),
routerModule,
pfmModule,
transfermiddlewareModule,
txBoundaryModule,
icaModule,
Expand Down Expand Up @@ -421,7 +421,7 @@ func NewComposableApp(
vestingtypes.ModuleName,
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
routertypes.ModuleName,
pfmtypes.ModuleName,
transfermiddlewaretypes.ModuleName,
txBoundaryTypes.ModuleName,
ratelimitmoduletypes.ModuleName,
Expand Down Expand Up @@ -465,7 +465,7 @@ func NewComposableApp(
group.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
routertypes.ModuleName,
pfmtypes.ModuleName,
transfermiddlewaretypes.ModuleName,
txBoundaryTypes.ModuleName,
ratelimitmoduletypes.ModuleName,
Expand Down Expand Up @@ -505,7 +505,7 @@ func NewComposableApp(
upgradetypes.ModuleName,
ibctransfertypes.ModuleName,
icqtypes.ModuleName,
routertypes.ModuleName,
pfmtypes.ModuleName,
transfermiddlewaretypes.ModuleName,
txBoundaryTypes.ModuleName,
ratelimitmoduletypes.ModuleName,
Expand Down
30 changes: 15 additions & 15 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ import (

custombankkeeper "github.com/notional-labs/composable/v6/custom/bank/keeper"

router "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
routerkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"
pfm "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
pfmkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"

transfermiddleware "github.com/notional-labs/composable/v6/x/transfermiddleware"
transfermiddlewarekeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
Expand Down Expand Up @@ -165,7 +165,7 @@ type AppKeepers struct {
// this line is used by starport scaffolding # stargate/app/keeperDeclaration
TransferMiddlewareKeeper transfermiddlewarekeeper.Keeper
TxBoundaryKeepper txBoundaryKeeper.Keeper
RouterKeeper *routerkeeper.Keeper
PfmKeeper *pfmkeeper.Keeper
RatelimitKeeper ratelimitmodulekeeper.Keeper
StakingMiddlewareKeeper stakingmiddleware.Keeper
IbcTransferMiddlewareKeeper ibctransfermiddleware.Keeper
Expand Down Expand Up @@ -330,9 +330,9 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
authorityAddress,
)

appKeepers.RouterKeeper = routerkeeper.NewKeeper(
appKeepers.PfmKeeper = pfmkeeper.NewKeeper(
appCodec,
appKeepers.keys[routertypes.StoreKey],
appKeepers.keys[pfmtypes.StoreKey],
appKeepers.TransferKeeper.Keeper,
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.DistrKeeper,
Expand All @@ -354,7 +354,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
&appKeepers.IbcTransferMiddlewareKeeper,
govModAddress,
)
appKeepers.RouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper)
appKeepers.PfmKeeper.SetTransferKeeper(appKeepers.TransferKeeper)

appKeepers.RatelimitKeeper = *ratelimitmodulekeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -383,12 +383,12 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.TransferMiddlewareKeeper,
)

ibcMiddlewareStack := router.NewIBCMiddleware(
ibcMiddlewareStack := pfm.NewIBCMiddleware(
transfermiddlewareStack,
appKeepers.RouterKeeper,
appKeepers.PfmKeeper,
0,
routerkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
routerkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
pfmkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)
ratelimitMiddlewareStack := ratelimitmodule.NewIBCMiddleware(appKeepers.RatelimitKeeper, ibcMiddlewareStack)
hooksTransferMiddleware := ibc_hooks.NewIBCMiddleware(ratelimitMiddlewareStack, &appKeepers.HooksICS4Wrapper)
Expand All @@ -397,7 +397,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(appKeepers.keys[evidencetypes.StoreKey]), appKeepers.StakingKeeper, appKeepers.SlashingKeeper, appKeepers.AccountKeeper.AddressCodec(), runtime.ProvideCometInfoService(),
)
// If evidence needs to be handled for the app, set routes in router here and seal
// If evidence needs to be handled for the app, set routes in pfm here and seal
appKeepers.EvidenceKeeper = *evidenceKeeper

wasmDir := filepath.Join(homePath, "wasm")
Expand Down Expand Up @@ -499,7 +499,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
ibcRouter.AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(appKeepers.WasmKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.ChannelKeeper))
ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostStack)

// this line is used by starport scaffolding # ibc/app/router
// this line is used by starport scaffolding # ibc/app/pfm
appKeepers.IBCKeeper.SetRouter(ibcRouter)
}

Expand Down Expand Up @@ -552,8 +552,8 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac
paramsKeeper.Subspace(stakingtypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(routertypes.ModuleName).WithKeyTable(routertypes.ParamKeyTable()) // TODO:
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable()) //nolint:staticcheck
paramsKeeper.Subspace(pfmtypes.ModuleName).WithKeyTable(pfmtypes.ParamKeyTable()) // TODO:
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable()) //nolint:staticcheck
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ratelimitmoduletypes.ModuleName)
Expand Down

0 comments on commit 13f953e

Please sign in to comment.