Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNS-169 implement module subscription #329

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/consensus_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ jobs:
- name: lava plans unit Tests
run: go test ./x/plans/ ./x/plans/keeper ./x/plans/types -v

- name: lava subscription unit Tests
run: go test ./x/subscription/... -v
44 changes: 34 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ import (
pairingmodule "github.com/lavanet/lava/x/pairing"
pairingmodulekeeper "github.com/lavanet/lava/x/pairing/keeper"
pairingmoduletypes "github.com/lavanet/lava/x/pairing/types"
plans "github.com/lavanet/lava/x/plans"
plansmodule "github.com/lavanet/lava/x/plans"
plansmoduleclient "github.com/lavanet/lava/x/plans/client"
plansmodulekeeper "github.com/lavanet/lava/x/plans/keeper"
plansmoduletypes "github.com/lavanet/lava/x/plans/types"
"github.com/lavanet/lava/x/spec"
specmodule "github.com/lavanet/lava/x/spec"
specmoduleclient "github.com/lavanet/lava/x/spec/client"
specmodulekeeper "github.com/lavanet/lava/x/spec/keeper"
specmoduletypes "github.com/lavanet/lava/x/spec/types"
subscriptionmodule "github.com/lavanet/lava/x/subscription"
subscriptionmodulekeeper "github.com/lavanet/lava/x/subscription/keeper"
subscriptionmoduletypes "github.com/lavanet/lava/x/subscription/types"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
Expand Down Expand Up @@ -182,11 +185,12 @@ var (
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
spec.AppModuleBasic{},
specmodule.AppModuleBasic{},
epochstoragemodule.AppModuleBasic{},
subscriptionmodule.AppModuleBasic{},
pairingmodule.AppModuleBasic{},
conflictmodule.AppModuleBasic{},
plans.AppModuleBasic{},
plansmodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand All @@ -200,6 +204,7 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
epochstoragemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
subscriptionmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
pairingmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
conflictmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
// this line is used by starport scaffolding # stargate/app/maccPerms
Expand Down Expand Up @@ -281,6 +286,7 @@ func New(
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
specmoduletypes.StoreKey,
epochstoragemoduletypes.StoreKey,
subscriptionmoduletypes.StoreKey,
pairingmoduletypes.StoreKey,
conflictmoduletypes.StoreKey,
plansmoduletypes.StoreKey,
Expand Down Expand Up @@ -358,15 +364,14 @@ func New(
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
)

//
// Initialize SpecKeeper prior to govRouter (order is critical)
app.SpecKeeper = *specmodulekeeper.NewKeeper(
appCodec,
keys[specmoduletypes.StoreKey],
keys[specmoduletypes.MemStoreKey],
app.GetSubspace(specmoduletypes.ModuleName),
)
specModule := spec.NewAppModule(appCodec, app.SpecKeeper, app.AccountKeeper, app.BankKeeper)
specModule := specmodule.NewAppModule(appCodec, app.SpecKeeper, app.AccountKeeper, app.BankKeeper)

// Initialize PackagesKeeper prior to govRouter (order is critical)
app.PlansKeeper = *plansmodulekeeper.NewKeeper(
Expand All @@ -375,18 +380,18 @@ func New(
keys[plansmoduletypes.MemStoreKey],
app.GetSubspace(plansmoduletypes.ModuleName),
)
plansModule := plans.NewAppModule(appCodec, app.PlansKeeper)
plansModule := plansmodule.NewAppModule(appCodec, app.PlansKeeper)

// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
//
// user defined
AddRoute(specmoduletypes.ProposalsRouterKey, spec.NewSpecProposalsHandler(app.SpecKeeper)).
AddRoute(specmoduletypes.ProposalsRouterKey, specmodule.NewSpecProposalsHandler(app.SpecKeeper)).
// copied the code from param and changed the handler to enable functionality
AddRoute(paramproposal.RouterKey, spec.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(paramproposal.RouterKey, specmodule.NewParamChangeProposalHandler(app.ParamsKeeper)).
// user defined
AddRoute(plansmoduletypes.ProposalsRouterKey, plans.NewPlansProposalsHandler(app.PlansKeeper)).
AddRoute(plansmoduletypes.ProposalsRouterKey, plansmodule.NewPlansProposalsHandler(app.PlansKeeper)).

//
// default
Expand Down Expand Up @@ -440,6 +445,19 @@ func New(
)
pairingModule := pairingmodule.NewAppModule(appCodec, app.PairingKeeper, app.AccountKeeper, app.BankKeeper)

app.SubscriptionKeeper = *subscriptionmodulekeeper.NewKeeper(
appCodec,
keys[subscriptionmoduletypes.StoreKey],
keys[subscriptionmoduletypes.MemStoreKey],
app.GetSubspace(subscriptionmoduletypes.ModuleName),

app.BankKeeper,
app.AccountKeeper,
&app.EpochstorageKeeper,
app.PlansKeeper,
)
subscriptionModule := subscriptionmodule.NewAppModule(appCodec, app.SubscriptionKeeper, app.AccountKeeper, app.BankKeeper)

app.ConflictKeeper = *conflictmodulekeeper.NewKeeper(
appCodec,
keys[conflictmoduletypes.StoreKey],
Expand Down Expand Up @@ -495,6 +513,7 @@ func New(
transferModule,
specModule,
epochstorageModule,
subscriptionModule,
pairingModule,
conflictModule,
plansModule,
Expand All @@ -521,6 +540,7 @@ func New(
ibctransfertypes.ModuleName,
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName,
subscriptionmoduletypes.ModuleName,
conflictmoduletypes.ModuleName, // conflict needs to change state before pairing changes stakes
pairingmoduletypes.ModuleName,
plansmoduletypes.ModuleName,
Expand All @@ -545,6 +565,7 @@ func New(
ibctransfertypes.ModuleName,
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName,
subscriptionmoduletypes.ModuleName,
conflictmoduletypes.ModuleName,
pairingmoduletypes.ModuleName,
plansmoduletypes.ModuleName,
Expand Down Expand Up @@ -574,6 +595,7 @@ func New(
ibctransfertypes.ModuleName,
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName, // epochStyorage end block must come before pairing for proper epoch handling
subscriptionmoduletypes.ModuleName,
pairingmoduletypes.ModuleName,
plansmoduletypes.ModuleName,
vestingtypes.ModuleName,
Expand Down Expand Up @@ -609,6 +631,7 @@ func New(
transferModule,
specModule,
epochstorageModule,
subscriptionModule,
pairingModule,
conflictModule,
plansModule,
Expand Down Expand Up @@ -828,6 +851,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(specmoduletypes.ModuleName)
paramsKeeper.Subspace(epochstoragemoduletypes.ModuleName)
paramsKeeper.Subspace(subscriptionmoduletypes.ModuleName)
paramsKeeper.Subspace(pairingmoduletypes.ModuleName)
paramsKeeper.Subspace(conflictmoduletypes.ModuleName)
paramsKeeper.Subspace(plansmoduletypes.ModuleName)
Expand Down
2 changes: 2 additions & 0 deletions app/keepers/lavaKeepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
pairingmodulekeeper "github.com/lavanet/lava/x/pairing/keeper"
plansmodulekeeper "github.com/lavanet/lava/x/plans/keeper"
specmodulekeeper "github.com/lavanet/lava/x/spec/keeper"
subscriptionmodulekeeper "github.com/lavanet/lava/x/subscription/keeper"
// this line is used by starport scaffolding # stargate/app/moduleImport
)

Expand Down Expand Up @@ -48,6 +49,7 @@ type LavaKeepers struct {

// Special Keepers
SpecKeeper specmodulekeeper.Keeper
SubscriptionKeeper subscriptionmodulekeeper.Keeper
EpochstorageKeeper epochstoragemodulekeeper.Keeper
PairingKeeper pairingmodulekeeper.Keeper
ConflictKeeper conflictmodulekeeper.Keeper
Expand Down
2 changes: 2 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56136,6 +56136,8 @@ definitions:
type: array
items:
type: string
lavanet.lava.subscription.MsgSubscribeResponse:
type: object
lavanet.lava.subscription.Params:
type: object
description: Params defines the parameters for the module.
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.23
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -48,6 +48,8 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/tools v0.2.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -781,6 +783,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
Expand Down Expand Up @@ -1988,6 +1992,8 @@ google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148 h1:muK+gVBJBfFb4SejshDBlN2/UgxCCOKH9Y34ljqEGOc=
google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw=
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds=
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
Expand Down
17 changes: 17 additions & 0 deletions proto/subscription/subscription.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package lavanet.lava.subscription;

option go_package = "github.com/lavanet/lava/x/subscription/types";

message Subscription {
orenl-lava marked this conversation as resolved.
Show resolved Hide resolved

string creator = 1;
string consumer = 2;
uint64 block = 3;
string plan_index = 4;
uint64 plan_block = 5;
bool is_yearly = 6;
uint64 expiry_time = 7;
uint64 usedCU = 8;
uint64 remainingCU = 9;
}
13 changes: 12 additions & 1 deletion proto/subscription/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ option go_package = "github.com/lavanet/lava/x/subscription/types";

// Msg defines the Msg service.
service Msg {
// this line is used by starport scaffolding # proto/tx/rpc
rpc Subscribe(MsgSubscribe) returns (MsgSubscribeResponse);
// this line is used by starport scaffolding # proto/tx/rpc
}

message MsgSubscribe {
string creator = 1;
string consumer = 2;
string index = 3;
bool isYearly = 4;
}

message MsgSubscribeResponse {
}

// this line is used by starport scaffolding # proto/tx/message
2 changes: 1 addition & 1 deletion testutil/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func CreateMockPlan() plantypes.Plan {
Type: "rpc",
Duration: 200,
Block: 100,
Price: sdk.NewCoin("ulava", sdk.OneInt()),
Price: sdk.NewCoin("ulava", sdk.NewInt(100)),
ComputeUnits: 1000,
ComputeUnitsPerEpoch: 100,
ServicersToPair: 3,
Expand Down
13 changes: 13 additions & 0 deletions testutil/keeper/keepers_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"github.com/lavanet/lava/x/spec"
speckeeper "github.com/lavanet/lava/x/spec/keeper"
spectypes "github.com/lavanet/lava/x/spec/types"
subscriptionkeeper "github.com/lavanet/lava/x/subscription/keeper"
subscriptiontypes "github.com/lavanet/lava/x/subscription/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand All @@ -45,6 +47,7 @@ type Keepers struct {
Epochstorage epochstoragekeeper.Keeper
Spec speckeeper.Keeper
Plans planskeeper.Keeper
Subscription subscriptionkeeper.Keeper
Pairing pairingkeeper.Keeper
Conflict conflictkeeper.Keeper
BankKeeper mockBankKeeper
Expand Down Expand Up @@ -100,6 +103,11 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) {
stateStore.MountStoreWithDB(plansStoreKey, sdk.StoreTypeIAVL, db)
stateStore.MountStoreWithDB(plansMemStoreKey, sdk.StoreTypeMemory, nil)

subscriptionStoreKey := sdk.NewKVStoreKey(subscriptiontypes.StoreKey)
subscriptionMemStoreKey := storetypes.NewMemoryStoreKey(subscriptiontypes.MemStoreKey)
stateStore.MountStoreWithDB(subscriptionStoreKey, sdk.StoreTypeIAVL, db)
stateStore.MountStoreWithDB(subscriptionMemStoreKey, sdk.StoreTypeMemory, nil)

epochStoreKey := sdk.NewKVStoreKey(epochstoragetypes.StoreKey)
epochMemStoreKey := storetypes.NewMemoryStoreKey(epochstoragetypes.MemStoreKey)
stateStore.MountStoreWithDB(epochStoreKey, sdk.StoreTypeIAVL, db)
Expand All @@ -119,6 +127,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) {

paramsKeeper := paramskeeper.NewKeeper(cdc, pairingtypes.Amino, paramsStoreKey, tkey)
paramsKeeper.Subspace(spectypes.ModuleName)
paramsKeeper.Subspace(subscriptiontypes.ModuleName)
paramsKeeper.Subspace(epochstoragetypes.ModuleName)
paramsKeeper.Subspace(pairingtypes.ModuleName)
// paramsKeeper.Subspace(conflicttypes.ModuleName) //TODO...
Expand All @@ -131,6 +140,8 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) {

plansparamsSubspace, _ := paramsKeeper.GetSubspace(planstypes.ModuleName)

subscriptionparamsSubspace, _ := paramsKeeper.GetSubspace(subscriptiontypes.ModuleName)

conflictparamsSubspace := paramstypes.NewSubspace(cdc,
conflicttypes.Amino,
conflictStoreKey,
Expand All @@ -144,6 +155,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) {
ks.Spec = *speckeeper.NewKeeper(cdc, specStoreKey, specMemStoreKey, specparamsSubspace)
ks.Epochstorage = *epochstoragekeeper.NewKeeper(cdc, epochStoreKey, epochMemStoreKey, epochparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Spec)
ks.Plans = *planskeeper.NewKeeper(cdc, plansStoreKey, plansMemStoreKey, plansparamsSubspace)
ks.Subscription = *subscriptionkeeper.NewKeeper(cdc, subscriptionStoreKey, subscriptionMemStoreKey, subscriptionparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, &ks.Epochstorage, ks.Plans)
ks.Pairing = *pairingkeeper.NewKeeper(cdc, pairingStoreKey, pairingMemStoreKey, pairingparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Spec, &ks.Epochstorage)
ks.ParamsKeeper = paramsKeeper
ks.Conflict = *conflictkeeper.NewKeeper(cdc, conflictStoreKey, conflictMemStoreKey, conflictparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Pairing, ks.Epochstorage, ks.Spec)
Expand All @@ -154,6 +166,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) {
// Initialize params
ks.Pairing.SetParams(ctx, pairingtypes.DefaultParams())
ks.Spec.SetParams(ctx, spectypes.DefaultParams())
ks.Subscription.SetParams(ctx, subscriptiontypes.DefaultParams())
ks.Epochstorage.SetParams(ctx, epochstoragetypes.DefaultParams())
ks.Conflict.SetParams(ctx, conflicttypes.DefaultParams())
ks.Plans.SetParams(ctx, planstypes.DefaultParams())
Expand Down
21 changes: 21 additions & 0 deletions testutil/keeper/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
typesparams "github.com/cosmos/cosmos-sdk/x/params/types"
epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper"
planskeeper "github.com/lavanet/lava/x/plans/keeper"
"github.com/lavanet/lava/x/subscription/keeper"
"github.com/lavanet/lava/x/subscription/types"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -36,11 +38,30 @@ func SubscriptionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {
memStoreKey,
"SubscriptionParams",
)

paramsSubspaceEpochstorage := typesparams.NewSubspace(cdc,
types.Amino,
storeKey,
memStoreKey,
"EpochStorageParams",
)

paramsSubspacePlans := typesparams.NewSubspace(cdc,
types.Amino,
storeKey,
memStoreKey,
"PlansParams",
)

k := keeper.NewKeeper(
cdc,
storeKey,
memStoreKey,
paramsSubspace,
nil,
nil,
epochstoragekeeper.NewKeeper(cdc, nil, nil, paramsSubspaceEpochstorage, nil, nil, nil),
planskeeper.NewKeeper(cdc, nil, nil, paramsSubspacePlans),
)

ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger())
Expand Down
Loading