Skip to content

Commit

Permalink
chore: add gateway keeper dep
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Feb 19, 2025
1 parent 10208dc commit 49ee23f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions testutil/integration/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap
authority.String(),
accountKeeper,
bankKeeper,
gatewayKeeper,
applicationKeeper,
supplierKeeper,
)
Expand Down
9 changes: 9 additions & 0 deletions testutil/keeper/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) {

mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl)

mockGatewayKeeper := mocks.NewMockGatewayKeeper(ctrl)
mockGatewayKeeper.EXPECT().
GetGateway(gomock.Any(), gomock.Any()).
AnyTimes()
mockGatewayKeeper.EXPECT().
SetGateway(gomock.Any(), gomock.Any()).
AnyTimes()

mockAppKeeper := mocks.NewMockApplicationKeeper(ctrl)
mockAppKeeper.EXPECT().
GetApplication(gomock.Any(), gomock.Any()).
Expand All @@ -84,6 +92,7 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) {
authority.String(),
mockAccountKeeper,
mockBankKeeper,
mockGatewayKeeper,
mockAppKeeper,
mockSupplierKeeper,
)
Expand Down
1 change: 1 addition & 0 deletions testutil/keeper/tokenomics.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ func NewTokenomicsModuleKeepers(
authority.String(),
accountKeeper,
bankKeeper,
gatewayKeeper,
appKeeper,
supplierKeeper,
)
Expand Down
3 changes: 3 additions & 0 deletions x/migration/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type (

accountKeeper types.AccountKeeper
bankKeeper types.BankKeeper
gatewayKeeper types.GatewayKeeper
appKeeper types.ApplicationKeeper
supplierKeeper types.SupplierKeeper
}
Expand All @@ -35,6 +36,7 @@ func NewKeeper(
authority string,
accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
gatewayKeeper types.GatewayKeeper,
appKeeper types.ApplicationKeeper,
supplierKeeper types.SupplierKeeper,
) Keeper {
Expand All @@ -49,6 +51,7 @@ func NewKeeper(
logger: logger,
accountKeeper: accountKeeper,
bankKeeper: bankKeeper,
gatewayKeeper: gatewayKeeper,
appKeeper: appKeeper,
supplierKeeper: supplierKeeper,
}
Expand Down
2 changes: 2 additions & 0 deletions x/migration/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ type ModuleInputs struct {

AccountKeeper types.AccountKeeper
BankKeeper types.BankKeeper
GatewayKeeper types.GatewayKeeper
ApplicationKeeper types.ApplicationKeeper
SupplierKeeper types.SupplierKeeper
}
Expand All @@ -212,6 +213,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
authority.String(),
in.AccountKeeper,
in.BankKeeper,
in.GatewayKeeper,
in.ApplicationKeeper,
in.SupplierKeeper,
)
Expand Down
8 changes: 7 additions & 1 deletion x/migration/types/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,ApplicationKeeper,SupplierKeeper
//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,GatewayKeeper,ApplicationKeeper,SupplierKeeper

package types

Expand All @@ -8,6 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

apptypes "github.com/pokt-network/poktroll/x/application/types"
"github.com/pokt-network/poktroll/x/gateway/types"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand All @@ -25,6 +26,11 @@ type BankKeeper interface {
// Methods imported from bank should be defined here
}

type GatewayKeeper interface {
GetGateway(ctx context.Context, address string) (gateway types.Gateway, found bool)
SetGateway(ctx context.Context, gateway types.Gateway)
}

type ApplicationKeeper interface {
GetApplication(ctx context.Context, appAddr string) (app apptypes.Application, found bool)
SetApplication(ctx context.Context, application apptypes.Application)
Expand Down

0 comments on commit 49ee23f

Please sign in to comment.