Skip to content

Commit

Permalink
chore: moved expected package to keeper
Browse files Browse the repository at this point in the history
  • Loading branch information
ironman0x7b2 committed Feb 13, 2025
1 parent 3b4974f commit e2a815d
Show file tree
Hide file tree
Showing 21 changed files with 78 additions and 89 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
5 changes: 2 additions & 3 deletions x/deposit/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/deposit/expected"
"github.com/sentinel-official/hub/v12/x/deposit/types"
)

type Keeper struct {
key storetypes.StoreKey
cdc codec.BinaryCodec

bank expected.BankKeeper
bank BankKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey) Keeper {
Expand All @@ -27,7 +26,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey) Keeper {
}
}

func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper) {
func (k *Keeper) WithBankKeeper(keeper BankKeeper) {
k.bank = keeper
}

Expand Down
2 changes: 1 addition & 1 deletion x/lease/expected/keeper.go → x/lease/keeper/expected.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
21 changes: 10 additions & 11 deletions x/lease/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/lease/expected"
"github.com/sentinel-official/hub/v12/x/lease/types"
)

Expand All @@ -21,11 +20,11 @@ type Keeper struct {
key storetypes.StoreKey
router *baseapp.MsgServiceRouter

deposit expected.DepositKeeper
node expected.NodeKeeper
oracle expected.OracleKeeper
plan expected.PlanKeeper
provider expected.ProviderKeeper
deposit DepositKeeper
node NodeKeeper
oracle OracleKeeper
plan PlanKeeper
provider ProviderKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter, authority, feeCollectorName string) Keeper {
Expand All @@ -38,23 +37,23 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.M
}
}

func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper) {
func (k *Keeper) WithDepositKeeper(keeper DepositKeeper) {
k.deposit = keeper
}

func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper) {
func (k *Keeper) WithNodeKeeper(keeper NodeKeeper) {
k.node = keeper
}

func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper) {
func (k *Keeper) WithOracleKeeper(keeper OracleKeeper) {
k.oracle = keeper
}

func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper) {
func (k *Keeper) WithPlanKeeper(keeper PlanKeeper) {
k.plan = keeper
}

func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper) {
func (k *Keeper) WithProviderKeeper(keeper ProviderKeeper) {
k.provider = keeper
}

Expand Down
2 changes: 1 addition & 1 deletion x/mint/expected/keeper.go → x/mint/keeper/expected.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
5 changes: 2 additions & 3 deletions x/mint/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/mint/expected"
"github.com/sentinel-official/hub/v12/x/mint/types"
)

type Keeper struct {
cdc codec.BinaryCodec
key storetypes.StoreKey

mint expected.MintKeeper
mint MintKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, mint expected.MintKeeper) Keeper {
func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, mint MintKeeper) Keeper {
return Keeper{
cdc: cdc,
key: key,
Expand Down
2 changes: 1 addition & 1 deletion x/node/expected/keeper.go → x/node/keeper/expected.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
"time"
Expand Down
21 changes: 10 additions & 11 deletions x/node/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/node/expected"
"github.com/sentinel-official/hub/v12/x/node/types"
)

Expand All @@ -21,11 +20,11 @@ type Keeper struct {
key storetypes.StoreKey
router *baseapp.MsgServiceRouter

deposit expected.DepositKeeper
distribution expected.DistributionKeeper
lease expected.LeaseKeeper
oracle expected.OracleKeeper
session expected.SessionKeeper
deposit DepositKeeper
distribution DistributionKeeper
lease LeaseKeeper
oracle OracleKeeper
session SessionKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter, authority, feeCollectorName string) Keeper {
Expand All @@ -38,23 +37,23 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.M
}
}

func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper) {
func (k *Keeper) WithDepositKeeper(keeper DepositKeeper) {
k.deposit = keeper
}

func (k *Keeper) WithDistributionKeeper(keeper expected.DistributionKeeper) {
func (k *Keeper) WithDistributionKeeper(keeper DistributionKeeper) {
k.distribution = keeper
}

func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper) {
func (k *Keeper) WithLeaseKeeper(keeper LeaseKeeper) {
k.lease = keeper
}

func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper) {
func (k *Keeper) WithOracleKeeper(keeper OracleKeeper) {
k.oracle = keeper
}

func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper) {
func (k *Keeper) WithSessionKeeper(keeper SessionKeeper) {
k.session = keeper
}

Expand Down
2 changes: 1 addition & 1 deletion x/plan/expected/keeper.go → x/plan/keeper/expected.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
21 changes: 10 additions & 11 deletions x/plan/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/plan/expected"
"github.com/sentinel-official/hub/v12/x/plan/types"
)

Expand All @@ -19,11 +18,11 @@ type Keeper struct {
key storetypes.StoreKey
router *baseapp.MsgServiceRouter

lease expected.LeaseKeeper
node expected.NodeKeeper
provider expected.ProviderKeeper
session expected.SessionKeeper
subscription expected.SubscriptionKeeper
lease LeaseKeeper
node NodeKeeper
provider ProviderKeeper
session SessionKeeper
subscription SubscriptionKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter) Keeper {
Expand All @@ -34,23 +33,23 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.M
}
}

func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper) {
func (k *Keeper) WithLeaseKeeper(keeper LeaseKeeper) {
k.lease = keeper
}

func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper) {
func (k *Keeper) WithNodeKeeper(keeper NodeKeeper) {
k.node = keeper
}

func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper) {
func (k *Keeper) WithProviderKeeper(keeper ProviderKeeper) {
k.provider = keeper
}

func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper) {
func (k *Keeper) WithSessionKeeper(keeper SessionKeeper) {
k.session = keeper
}

func (k *Keeper) WithSubscriptionKeeper(keeper expected.SubscriptionKeeper) {
func (k *Keeper) WithSubscriptionKeeper(keeper SubscriptionKeeper) {
k.subscription = keeper
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
13 changes: 6 additions & 7 deletions x/provider/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/provider/expected"
"github.com/sentinel-official/hub/v12/x/provider/types"
)

Expand All @@ -20,9 +19,9 @@ type Keeper struct {
key storetypes.StoreKey
router *baseapp.MsgServiceRouter

distribution expected.DistributionKeeper
plan expected.PlanKeeper
lease expected.LeaseKeeper
distribution DistributionKeeper
plan PlanKeeper
lease LeaseKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter, authority string) Keeper {
Expand All @@ -34,15 +33,15 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.M
}
}

func (k *Keeper) WithDistributionKeeper(keeper expected.DistributionKeeper) {
func (k *Keeper) WithDistributionKeeper(keeper DistributionKeeper) {
k.distribution = keeper
}

func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper) {
func (k *Keeper) WithPlanKeeper(keeper PlanKeeper) {
k.plan = keeper
}

func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper) {
func (k *Keeper) WithLeaseKeeper(keeper LeaseKeeper) {
k.lease = keeper
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
sdkmath "cosmossdk.io/math"
Expand Down
17 changes: 8 additions & 9 deletions x/session/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sentinel-official/hub/v12/x/session/expected"
"github.com/sentinel-official/hub/v12/x/session/types"
)

Expand All @@ -21,10 +20,10 @@ type Keeper struct {
key storetypes.StoreKey
router *baseapp.MsgServiceRouter

account expected.AccountKeeper
deposit expected.DepositKeeper
node expected.NodeKeeper
subscription expected.SubscriptionKeeper
account AccountKeeper
deposit DepositKeeper
node NodeKeeper
subscription SubscriptionKeeper
}

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter, authority, feeCollectorName string) Keeper {
Expand All @@ -37,19 +36,19 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.M
}
}

func (k *Keeper) WithAccountKeeper(keeper expected.AccountKeeper) {
func (k *Keeper) WithAccountKeeper(keeper AccountKeeper) {
k.account = keeper
}

func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper) {
func (k *Keeper) WithDepositKeeper(keeper DepositKeeper) {
k.deposit = keeper
}

func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper) {
func (k *Keeper) WithNodeKeeper(keeper NodeKeeper) {
k.node = keeper
}

func (k *Keeper) WithSubscriptionKeeper(keeper expected.SubscriptionKeeper) {
func (k *Keeper) WithSubscriptionKeeper(keeper SubscriptionKeeper) {
k.subscription = keeper
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package expected
package keeper

import (
"time"
Expand Down
Loading

0 comments on commit e2a815d

Please sign in to comment.