Skip to content

Commit

Permalink
chore: remove unused keeper in resource
Browse files Browse the repository at this point in the history
  • Loading branch information
whalelephant committed Sep 7, 2023
1 parent 52c1f37 commit 3e4c5d3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 25 deletions.
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,8 @@ func New(
app.resourceKeeper = *resourcekeeper.NewKeeper(
appCodec, keys[resourcetypes.StoreKey],
app.GetSubspace(resourcetypes.ModuleName),
&app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
scopedResourceKeeper,
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
)

// create the resource IBC stack
Expand Down
4 changes: 1 addition & 3 deletions app/migrations/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ func NewMigrationContext(
didSubspace didtypes.ParamSubspace,
resourceStoreKey *storetypes.KVStoreKey,
resourceSubspace resourcetypes.ParamSubspace,
channelKeeper *channelkeeper.Keeper,
portKeeper *portkeeper.Keeper,
scopedKeeper exported.ScopedKeeper,
ibcfeekeeper ibcfeekeeper.Keeper,
) MigrationContext {
return MigrationContext{
codec: codec,
Expand All @@ -76,6 +74,6 @@ func NewMigrationContext(

resourceStoreKey: resourceStoreKey,
resourceKeeperOld: resourcekeeperv1.NewKeeper(codec, resourceStoreKey),
resourceKeeperNew: resourcekeeper.NewKeeper(codec, resourceStoreKey, resourceSubspace, channelKeeper, portKeeper, scopedKeeper, ibcfeekeeper),
resourceKeeperNew: resourcekeeper.NewKeeper(codec, resourceStoreKey, resourceSubspace, portKeeper, scopedKeeper),
}
}
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/cheqd/cosmos-sdk v0.46.10-barberry h1:ZTp4EvHZw0CLAhvb8nYXIJAo9/Bcq/2KcMt9aDv2eUY=
github.com/cheqd/cosmos-sdk v0.46.10-barberry/go.mod h1:ZFL/yjcIZq67H8FiWoLCnnaChkXnbRRYEEhGrFq8fzE=
github.com/cheqd/iavl v0.19.5-cheqd h1:GRiKnoDKMnuTRUuEZmSihY2MtBtbVz87Edzny0o4TL8=
github.com/cheqd/iavl v0.19.5-cheqd/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
Expand Down Expand Up @@ -1151,8 +1153,6 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/whalelephant/cosmos-sdk v0.0.0-20230906130404-fde27c0060e4 h1:hi5M/6rvWDm0sL3NtI7gZu+nZIrJHAiyiCD/K2/DwHE=
github.com/whalelephant/cosmos-sdk v0.0.0-20230906130404-fde27c0060e4/go.mod h1:ZFL/yjcIZq67H8FiWoLCnnaChkXnbRRYEEhGrFq8fzE=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
Expand Down
1 change: 0 additions & 1 deletion x/resource/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package resource

import (
"encoding/json"
"log"

resourceKeeper "github.com/cheqd/cheqd-node/x/resource/keeper"
resourcetypes "github.com/cheqd/cheqd-node/x/resource/types"
Expand Down
27 changes: 11 additions & 16 deletions x/resource/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,25 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"
"github.com/cosmos/ibc-go/v6/modules/core/exported"
"github.com/tendermint/tendermint/libs/log"
)

type Keeper struct {
cdc codec.BinaryCodec
storeKey storetypes.StoreKey
paramSpace types.ParamSubspace
channelKeeper types.ChannelKeeper
portKeeper types.PortKeeper
scopedKeeper exported.ScopedKeeper
ics4Wrapper porttypes.ICS4Wrapper
cdc codec.BinaryCodec
storeKey storetypes.StoreKey
paramSpace types.ParamSubspace
portKeeper types.PortKeeper
scopedKeeper exported.ScopedKeeper
}

func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace types.ParamSubspace, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, scopedKeeper exported.ScopedKeeper, ics4Wrapper porttypes.ICS4Wrapper) *Keeper {
func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace types.ParamSubspace, portKeeper types.PortKeeper, scopedKeeper exported.ScopedKeeper) *Keeper {
return &Keeper{
cdc: cdc,
storeKey: storeKey,
paramSpace: paramSpace,
channelKeeper: channelKeeper,
portKeeper: portKeeper,
scopedKeeper: scopedKeeper,
ics4Wrapper: ics4Wrapper,
cdc: cdc,
storeKey: storeKey,
paramSpace: paramSpace,
portKeeper: portKeeper,
scopedKeeper: scopedKeeper,
}
}

Expand Down
1 change: 0 additions & 1 deletion x/resource/keeper/keeper_ibc_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
host "github.com/cosmos/ibc-go/v6/modules/core/24-host"
"log"
)

// GetPort returns the portID for the resource module. Used in ExportGenesis
Expand Down

0 comments on commit 3e4c5d3

Please sign in to comment.