diff --git a/ecosystem/lava-sdk/scripts/protoc_grpc_relay.sh b/ecosystem/lava-sdk/scripts/protoc_grpc_relay.sh index 2eaf1257f6..7889230274 100755 --- a/ecosystem/lava-sdk/scripts/protoc_grpc_relay.sh +++ b/ecosystem/lava-sdk/scripts/protoc_grpc_relay.sh @@ -40,12 +40,10 @@ protoc \ "$LAVA_PROTO_DIR/lavanet/lava/pairing/badges.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/pairing/params.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/pairing/query.proto" \ - "$LAVA_PROTO_DIR/lavanet/lava/pairing/provider_payment_storage.proto" \ - "$LAVA_PROTO_DIR/lavanet/lava/pairing/unique_payment_storage_client_provider.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/subscription/subscription.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/projects/project.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/plans/policy.proto" \ - "$LAVA_PROTO_DIR/lavanet/lava/pairing/epoch_payments.proto" \ + "$LAVA_PROTO_DIR/lavanet/lava/pairing/epoch_cu.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/spec/spec.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/spec/api_collection.proto" \ "$LAVA_PROTO_DIR/lavanet/lava/epochstorage/stake_entry.proto" \ diff --git a/proto/lavanet/lava/pairing/epoch_cu.proto b/proto/lavanet/lava/pairing/epoch_cu.proto new file mode 100644 index 0000000000..3e981c00f0 --- /dev/null +++ b/proto/lavanet/lava/pairing/epoch_cu.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package lavanet.lava.pairing; + +option go_package = "github.com/lavanet/lava/x/pairing/types"; + +// UniqueEpochSession is used to detect double spend attacks +// It's kept in a epoch-prefixed store with a unique index: provider, project ID, chain ID and session ID +message UniqueEpochSession { +} + +// ProviderEpochCu is used to track the CU of a specific provider in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider address +message ProviderEpochCu { + uint64 serviced_cu = 1; +} + +// ProviderEpochComplainerCu is used to track the CU complained of a specific provider in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider address +message ProviderEpochComplainerCu { + uint64 complainers_cu = 1; +} + +// ProviderConsumerEpochCu is used to track the CU between a specific provider and +// consumer in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider and project ID +message ProviderConsumerEpochCu { + uint64 cu = 1; +} + diff --git a/proto/lavanet/lava/pairing/epoch_payments.proto b/proto/lavanet/lava/pairing/epoch_payments.proto deleted file mode 100644 index 3fa19dc8c1..0000000000 --- a/proto/lavanet/lava/pairing/epoch_payments.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package lavanet.lava.pairing; - -option go_package = "github.com/lavanet/lava/x/pairing/types"; - -message EpochPayments { - string index = 1; - reserved 2; - repeated string providerPaymentStorageKeys = 3; -} - diff --git a/proto/lavanet/lava/pairing/genesis.proto b/proto/lavanet/lava/pairing/genesis.proto index 5185592551..51c94e8f8e 100644 --- a/proto/lavanet/lava/pairing/genesis.proto +++ b/proto/lavanet/lava/pairing/genesis.proto @@ -3,9 +3,7 @@ package lavanet.lava.pairing; import "gogoproto/gogo.proto"; import "lavanet/lava/pairing/params.proto"; -import "lavanet/lava/pairing/unique_payment_storage_client_provider.proto"; -import "lavanet/lava/pairing/provider_payment_storage.proto"; -import "lavanet/lava/pairing/epoch_payments.proto"; +import "lavanet/lava/pairing/epoch_cu.proto"; import "lavanet/lava/fixationstore/fixation.proto"; import "lavanet/lava/timerstore/timer.proto"; @@ -21,11 +19,45 @@ message BadgeUsedCu { // GenesisState defines the pairing module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - repeated UniquePaymentStorageClientProvider uniquePaymentStorageClientProviderList = 2 [(gogoproto.nullable) = false]; - repeated ProviderPaymentStorage providerPaymentStorageList = 3 [(gogoproto.nullable) = false]; - repeated EpochPayments epochPaymentsList = 4 [(gogoproto.nullable) = false]; + reserved 2; + reserved 3; + reserved 4; repeated BadgeUsedCu badgeUsedCuList = 5 [(gogoproto.nullable) = false]; lavanet.lava.timerstore.GenesisState badgesTS = 6 [(gogoproto.nullable) = false]; lavanet.lava.fixationstore.GenesisState providerQosFS = 7 [(gogoproto.nullable) = false]; + repeated UniqueEpochSessionGenesis unique_epoch_sessions = 8 [(gogoproto.nullable) = false]; + repeated ProviderEpochCuGenesis provider_epoch_cus = 9 [(gogoproto.nullable) = false]; + repeated ProviderEpochComplainerCuGenesis provider_epoch_complained_cus = 10 [(gogoproto.nullable) = false]; + repeated ProviderConsumerEpochCuGenesis provider_consumer_epoch_cus = 11 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } + +message UniqueEpochSessionGenesis { + uint64 epoch = 1; + string provider = 2; + string project = 3; + string chain_id = 4; + uint64 session_id = 5; +} + +message ProviderEpochCuGenesis { + uint64 epoch = 1; + string provider = 2; + string chain_id = 3; + ProviderEpochCu provider_epoch_cu = 4 [(gogoproto.nullable) = false]; +} + +message ProviderEpochComplainerCuGenesis { + uint64 epoch = 1; + string provider = 2; + string chain_id = 3; + ProviderEpochComplainerCu provider_epoch_complainer_cu = 4 [(gogoproto.nullable) = false]; +} + +message ProviderConsumerEpochCuGenesis { + uint64 epoch = 1; + string provider = 2; + string project = 3; + string chain_id = 4; + ProviderConsumerEpochCu provider_consumer_epoch_cu = 5 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/provider_payment_storage.proto b/proto/lavanet/lava/pairing/provider_payment_storage.proto deleted file mode 100644 index 00a554a21e..0000000000 --- a/proto/lavanet/lava/pairing/provider_payment_storage.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package lavanet.lava.pairing; - -option go_package = "github.com/lavanet/lava/x/pairing/types"; -import "lavanet/lava/pairing/unique_payment_storage_client_provider.proto"; - -message ProviderPaymentStorage { - - string index = 1; - reserved 2; - uint64 epoch = 3; - reserved 4; - repeated string uniquePaymentStorageClientProviderKeys = 5; - uint64 complainersTotalCu = 6; // total CU that were supposed to be served by the provider but didn't because he was unavailable (so consumers complained about him) -} -// change Client -> consumer - -// 1. client -> provider payment storage index = epoch+provider address - -// 2. clientlimit -> go over unique payment storage client provider check if the payment is from the consumer. -// its the other way around right now - -// 3. todo, break the loop when finding the first payment because in the future we will have only one request per epoch \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/query.proto b/proto/lavanet/lava/pairing/query.proto index 1cfe159838..5164abbf9b 100644 --- a/proto/lavanet/lava/pairing/query.proto +++ b/proto/lavanet/lava/pairing/query.proto @@ -5,14 +5,11 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "lavanet/lava/pairing/params.proto"; -import "lavanet/lava/pairing/epoch_payments.proto"; import "lavanet/lava/spec/spec.proto"; // this line is used by starport scaffolding # 1 import "lavanet/lava/plans/policy.proto"; -import "lavanet/lava/pairing/provider_payment_storage.proto"; -import "lavanet/lava/pairing/unique_payment_storage_client_provider.proto"; import "lavanet/lava/epochstorage/stake_entry.proto"; import "lavanet/lava/subscription/subscription.proto"; import "lavanet/lava/projects/project.proto"; @@ -42,36 +39,6 @@ service Query { option (google.api.http).get = "/lavanet/lava/pairing/verify_pairing/{chainID}/{client}/{provider}/{block}"; } -// Queries a UniquePaymentStorageClientProvider by index. - rpc UniquePaymentStorageClientProvider(QueryGetUniquePaymentStorageClientProviderRequest) returns (QueryGetUniquePaymentStorageClientProviderResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/unique_payment_storage_client_provider/{index}"; - } - - // Queries a list of UniquePaymentStorageClientProvider items. - rpc UniquePaymentStorageClientProviderAll(QueryAllUniquePaymentStorageClientProviderRequest) returns (QueryAllUniquePaymentStorageClientProviderResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/unique_payment_storage_client_provider"; - } - -// Queries a ProviderPaymentStorage by index. - rpc ProviderPaymentStorage(QueryGetProviderPaymentStorageRequest) returns (QueryGetProviderPaymentStorageResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/provider_payment_storage/{index}"; - } - - // Queries a list of ProviderPaymentStorage items. - rpc ProviderPaymentStorageAll(QueryAllProviderPaymentStorageRequest) returns (QueryAllProviderPaymentStorageResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/provider_payment_storage"; - } - -// Queries a EpochPayments by index. - rpc EpochPayments(QueryGetEpochPaymentsRequest) returns (QueryGetEpochPaymentsResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/epoch_payments/{index}"; - } - - // Queries a list of EpochPayments items. - rpc EpochPaymentsAll(QueryAllEpochPaymentsRequest) returns (QueryAllEpochPaymentsResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/epoch_payments"; - } - // Queries a UserEntry items. rpc UserEntry(QueryUserEntryRequest) returns (QueryUserEntryResponse) { option (google.api.http).get = "/lavanet/lava/pairing/user_entry/{address}/{chainID}"; @@ -97,11 +64,18 @@ service Query { option (google.api.http).get = "/lavanet/lava/pairing/subscription_monthly_payout/{consumer}"; } -// this line is used by starport scaffolding # 2 - // Queries a list of SdkPairing items. -rpc SdkPairing (QueryGetPairingRequest) returns (QuerySdkPairingResponse) { - option (google.api.http).get = "/lavanet/lava/pairing/sdk_pairing"; +// Queries a list of SdkPairing items. + rpc SdkPairing (QueryGetPairingRequest) returns (QuerySdkPairingResponse) { + option (google.api.http).get = "/lavanet/lava/pairing/sdk_pairing"; + } + +// Queries a for the aggregated CU of all ProviderEpochCu objects all the providers. +rpc ProvidersEpochCu(QueryProvidersEpochCuRequest) returns (QueryProvidersEpochCuResponse) { + option (google.api.http).get = "/lavanet/lava/pairing/providers_epoch_cu"; } + + // this line is used by starport scaffolding # 2 + } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -151,59 +125,6 @@ message QueryVerifyPairingResponse { string project_id = 5; } -message QueryGetUniquePaymentStorageClientProviderRequest { - string index = 1; -} - -message QueryGetUniquePaymentStorageClientProviderResponse { - UniquePaymentStorageClientProvider uniquePaymentStorageClientProvider = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllUniquePaymentStorageClientProviderRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllUniquePaymentStorageClientProviderResponse { - repeated UniquePaymentStorageClientProvider uniquePaymentStorageClientProvider = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetProviderPaymentStorageRequest { - string index = 1; - -} - -message QueryGetProviderPaymentStorageResponse { - ProviderPaymentStorage providerPaymentStorage = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllProviderPaymentStorageRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllProviderPaymentStorageResponse { - repeated ProviderPaymentStorage providerPaymentStorage = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetEpochPaymentsRequest { - string index = 1; - -} - -message QueryGetEpochPaymentsResponse { - EpochPayments epochPayments = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllEpochPaymentsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllEpochPaymentsResponse { - repeated EpochPayments epochPayments = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - message QueryUserEntryRequest { string address = 1; string chainID = 2; @@ -276,3 +197,15 @@ message QuerySubscriptionMonthlyPayoutResponse { uint64 total = 1; repeated ChainIDPayout details = 2; } + +message QueryProvidersEpochCuRequest { +} + +message QueryProvidersEpochCuResponse { + repeated ProviderCuInfo info = 1 [(gogoproto.nullable) = false]; +} + +message ProviderCuInfo { + string provider = 1; + uint64 cu = 2; +} \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/unique_payment_storage_client_provider.proto b/proto/lavanet/lava/pairing/unique_payment_storage_client_provider.proto deleted file mode 100644 index 4032c7e93a..0000000000 --- a/proto/lavanet/lava/pairing/unique_payment_storage_client_provider.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package lavanet.lava.pairing; - -option go_package = "github.com/lavanet/lava/x/pairing/types"; - -message UniquePaymentStorageClientProvider { - string index = 1; - uint64 block = 2; - uint64 usedCU = 3; -} - diff --git a/scripts/cli_test.sh b/scripts/cli_test.sh index 702dfe938a..f7bd410c6f 100755 --- a/scripts/cli_test.sh +++ b/scripts/cli_test.sh @@ -143,9 +143,7 @@ trace lavad q pairing params >/dev/null trace lavad q pairing account-info $(lavad keys show alice -a) >/dev/null trace lavad q pairing effective-policy ETH1 $(lavad keys show alice -a) >/dev/null trace lavad q pairing get-pairing STRK $(lavad keys show alice -a) >/dev/null -trace lavad q pairing list-epoch-payments >/dev/null -trace lavad q pairing list-provider-payment-storage >/dev/null -trace lavad q pairing list-unique-payment-storage-client-provider >/dev/null +trace lavad q pairing provider-epoch-cu $(lavad keys show servicer1) >/dev/null trace lavad q pairing providers STRK >/dev/null trace lavad q pairing sdk-pairing STRK $(lavad keys show alice -a) >/dev/null trace lavad q pairing provider-monthly-payout $(lavad keys show servicer1 -a) >/dev/null diff --git a/testutil/common/tester.go b/testutil/common/tester.go index 8bd0f23de6..9660e00c75 100644 --- a/testutil/common/tester.go +++ b/testutil/common/tester.go @@ -788,12 +788,6 @@ func (ts *Tester) QueryPairingGetPairing(chainID, client string) (*pairingtypes. return ts.Keepers.Pairing.GetPairing(ts.GoCtx, msg) } -// QueryPairingListEpochPayments implements 'q pairing list-epoch-payments' -func (ts *Tester) QueryPairingListEpochPayments() (*pairingtypes.QueryAllEpochPaymentsResponse, error) { - msg := &pairingtypes.QueryAllEpochPaymentsRequest{} - return ts.Keepers.Pairing.EpochPaymentsAll(ts.GoCtx, msg) -} - // QueryPairingProviders: implement 'q pairing providers' func (ts *Tester) QueryPairingProviders(chainID string, frozen bool) (*pairingtypes.QueryProvidersResponse, error) { msg := &pairingtypes.QueryProvidersRequest{ @@ -831,6 +825,12 @@ func (ts *Tester) QueryPairingProviderMonthlyPayout(provider string) (*pairingty return ts.Keepers.Pairing.ProviderMonthlyPayout(ts.GoCtx, msg) } +// QueryPairingProviderEpochCu implements 'q pairing provider-epoch-cu' +func (ts *Tester) QueryPairingProviderEpochCu(provider string, project string, chainID string) (*pairingtypes.QueryProvidersEpochCuResponse, error) { + msg := &pairingtypes.QueryProvidersEpochCuRequest{} + return ts.Keepers.Pairing.ProvidersEpochCu(ts.GoCtx, msg) +} + // QueryPairingSubscriptionMonthlyPayout implements 'q pairing subscription-monthly-payout' func (ts *Tester) QueryPairingSubscriptionMonthlyPayout(consumer string) (*pairingtypes.QuerySubscriptionMonthlyPayoutResponse, error) { msg := &pairingtypes.QuerySubscriptionMonthlyPayoutRequest{ diff --git a/testutil/e2e/protocolE2E.go b/testutil/e2e/protocolE2E.go index 35aa271549..b315733c95 100644 --- a/testutil/e2e/protocolE2E.go +++ b/testutil/e2e/protocolE2E.go @@ -23,7 +23,6 @@ import ( "time" tmclient "github.com/cometbft/cometbft/rpc/client/http" - bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -72,8 +71,6 @@ type lavaTest struct { tokenDenom string } -var providerBalances = make(map[string]*bankTypes.QueryBalanceResponse) - func init() { _, filename, _, _ := runtime.Caller(0) // Move to parent directory since running "go test ./testutil/e2e/ -v" would move working directory @@ -882,7 +879,6 @@ func (lt *lavaTest) checkQoS() error { if err != nil { panic("Provider CU calculation error!") } - providerIdx := 0 for provider := range providerCU { // Get sequence number of provider @@ -895,7 +891,7 @@ func (lt *lavaTest) checkQoS() error { cmdAcc.Args = strings.Split(fetchAccCommand, " ") cmdAcc.Stdout = lt.logs[logNameAcc] cmdAcc.Stderr = lt.logs[logNameAcc] - err = cmdAcc.Start() + err := cmdAcc.Start() if err != nil { errors = append(errors, fmt.Sprintf("%s", err)) } @@ -906,7 +902,7 @@ func (lt *lavaTest) checkQoS() error { } var obj map[string]interface{} - err := json.Unmarshal((lt.logs[logNameAcc].Bytes()), &obj) + err = json.Unmarshal((lt.logs[logNameAcc].Bytes()), &obj) if err != nil { panic(err) } @@ -1165,31 +1161,17 @@ func (lt *lavaTest) getKeyAddress(key string) string { func calculateProviderCU(pairingClient pairingTypes.QueryClient) (map[string]uint64, error) { providerCU := make(map[string]uint64) - paymentStorageClientRes, err := pairingClient.UniquePaymentStorageClientProviderAll(context.Background(), &pairingTypes.QueryAllUniquePaymentStorageClientProviderRequest{}) + res, err := pairingClient.ProvidersEpochCu(context.Background(), &pairingTypes.QueryProvidersEpochCuRequest{}) if err != nil { return nil, err } - uniquePaymentStorageClientProviderList := paymentStorageClientRes.GetUniquePaymentStorageClientProvider() - for _, uniquePaymentStorageClientProvider := range uniquePaymentStorageClientProviderList { - _, providerAddr := decodeProviderAddressFromUniquePaymentStorageClientProvider(uniquePaymentStorageClientProvider.Index) - - cu := uniquePaymentStorageClientProvider.UsedCU - providerCU[providerAddr] += cu + for _, info := range res.Info { + providerCU[info.Provider] = info.Cu } return providerCU, nil } -func decodeProviderAddressFromUniquePaymentStorageClientProvider(inputStr string) (clientAddr string, providerAddr string) { - firstIndex := strings.Index(inputStr, "lava@") - secondIndex := firstIndex + strings.Index(inputStr[firstIndex+len("lava@"):], "lava@") + len("lava@") - - clientAddr = inputStr[firstIndex:secondIndex] - providerAddr = inputStr[secondIndex : secondIndex+44] - - return clientAddr, providerAddr -} - func runProtocolE2E(timeout time.Duration) { os.RemoveAll(protocolLogsFolder) gopath := os.Getenv("GOPATH") diff --git a/testutil/keeper/keepers_init.go b/testutil/keeper/keepers_init.go index 4d6019381f..8bc7615683 100644 --- a/testutil/keeper/keepers_init.go +++ b/testutil/keeper/keepers_init.go @@ -324,7 +324,11 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { sdk.NewCoins(sdk.NewCoin(stakingparams.BondDenom, sdk.NewIntFromUint64(allocationPoolBalance)))) require.NoError(t, err) - ctx = ctx.WithBlockTime(time.Now()) + if !fixedTime { + ctx = ctx.WithBlockTime(time.Now()) + } else { + ctx = ctx.WithBlockTime(fixedDate) + } ks.Dualstaking.InitDelegations(ctx, *fixationtypes.DefaultGenesis()) ks.Dualstaking.InitDelegators(ctx, *fixationtypes.DefaultGenesis()) diff --git a/testutil/keeper/mock_keepers.go b/testutil/keeper/mock_keepers.go index d8512793d1..535c25c180 100644 --- a/testutil/keeper/mock_keepers.go +++ b/testutil/keeper/mock_keepers.go @@ -161,10 +161,19 @@ type MockBlockStore struct { blockHistory map[int64]*tenderminttypes.Block } +var ( + fixedTime bool + fixedDate = time.Date(2024, time.March, 1, 1, 1, 1, 1, time.UTC) +) + func (b *MockBlockStore) SetHeight(height int64) { b.height = height } +func SetFixedTime() { + fixedTime = true +} + func (b *MockBlockStore) AdvanceBlock(blockTime time.Duration) { // keep block height in mock blockstore blockInt64 := b.height + 1 @@ -175,8 +184,10 @@ func (b *MockBlockStore) AdvanceBlock(blockTime time.Duration) { blockHeader.Height = blockInt64 if prevBlock, ok := b.blockHistory[b.height-1]; ok { blockHeader.Time = prevBlock.Time.Add(blockTime) - } else { + } else if !fixedTime { blockHeader.Time = time.Now().Add(blockTime) + } else { + blockHeader.Time = fixedDate.Add(blockTime) } // update the blockstore's block history with current block diff --git a/x/pairing/client/cli/query.go b/x/pairing/client/cli/query.go index 619b266216..83c4814330 100644 --- a/x/pairing/client/cli/query.go +++ b/x/pairing/client/cli/query.go @@ -28,12 +28,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdProviders()) cmd.AddCommand(CmdGetPairing()) cmd.AddCommand(CmdVerifyPairing()) - cmd.AddCommand(CmdListUniquePaymentStorageClientProvider()) - cmd.AddCommand(CmdShowUniquePaymentStorageClientProvider()) - cmd.AddCommand(CmdListProviderPaymentStorage()) - cmd.AddCommand(CmdShowProviderPaymentStorage()) - cmd.AddCommand(CmdListEpochPayments()) - cmd.AddCommand(CmdShowEpochPayments()) cmd.AddCommand(CmdUserMaxCu()) cmd.AddCommand(CmdStaticProvidersList()) @@ -44,6 +38,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdProviderMonthlyPayout()) cmd.AddCommand(CmdSubscriptionMonthlyPayout()) + cmd.AddCommand(CmdProvidersEpochCu()) + cmd.AddCommand(CmdDebugQuery()) // this line is used by starport scaffolding # 1 diff --git a/x/pairing/client/cli/query_epoch_payments.go b/x/pairing/client/cli/query_epoch_payments.go deleted file mode 100644 index 1d1215e55b..0000000000 --- a/x/pairing/client/cli/query_epoch_payments.go +++ /dev/null @@ -1,79 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" - "github.com/spf13/cobra" -) - -func CmdListEpochPayments() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-epoch-payments", - Short: "list all EpochPayments", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllEpochPaymentsRequest{ - Pagination: pageReq, - } - - res, err := queryClient.EpochPaymentsAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowEpochPayments() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-epoch-payments [index]", - Short: "shows a EpochPayments", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argIndex := args[0] - - params := &types.QueryGetEpochPaymentsRequest{ - Index: argIndex, - } - - res, err := queryClient.EpochPayments(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/pairing/client/cli/query_epoch_payments_test.go b/x/pairing/client/cli/query_epoch_payments_test.go deleted file mode 100644 index 93aa605913..0000000000 --- a/x/pairing/client/cli/query_epoch_payments_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/client/cli" - "github.com/lavanet/lava/x/pairing/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithEpochPaymentsObjects(t *testing.T, n int) (*network.Network, []types.EpochPayments) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - epochPayments := types.EpochPayments{ - Index: strconv.Itoa(i), - } - nullify.Fill(&epochPayments) - state.EpochPaymentsList = append(state.EpochPaymentsList, epochPayments) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.EpochPaymentsList -} - -func TestShowEpochPayments(t *testing.T) { - net, objs := networkWithEpochPaymentsObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - idIndex string - - args []string - err error - obj types.EpochPayments - }{ - { - desc: "found", - idIndex: objs[0].Index, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idIndex: strconv.Itoa(100000), - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - tc.idIndex, - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowEpochPayments(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetEpochPaymentsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.EpochPayments) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.EpochPayments), - ) - } - }) - } -} - -func TestListEpochPayments(t *testing.T) { - net, objs := networkWithEpochPaymentsObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListEpochPayments(), args) - require.NoError(t, err) - var resp types.QueryAllEpochPaymentsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.EpochPayments), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.EpochPayments), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListEpochPayments(), args) - require.NoError(t, err) - var resp types.QueryAllEpochPaymentsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.EpochPayments), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.EpochPayments), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListEpochPayments(), args) - require.NoError(t, err) - var resp types.QueryAllEpochPaymentsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.EpochPayments), - ) - }) -} diff --git a/x/pairing/client/cli/query_provider_payment_storage.go b/x/pairing/client/cli/query_provider_payment_storage.go deleted file mode 100644 index e77f7e9670..0000000000 --- a/x/pairing/client/cli/query_provider_payment_storage.go +++ /dev/null @@ -1,79 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" - "github.com/spf13/cobra" -) - -func CmdListProviderPaymentStorage() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-provider-payment-storage", - Short: "list all ProviderPaymentStorage", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllProviderPaymentStorageRequest{ - Pagination: pageReq, - } - - res, err := queryClient.ProviderPaymentStorageAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowProviderPaymentStorage() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-provider-payment-storage [index]", - Short: "shows a ProviderPaymentStorage", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argIndex := args[0] - - params := &types.QueryGetProviderPaymentStorageRequest{ - Index: argIndex, - } - - res, err := queryClient.ProviderPaymentStorage(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/pairing/client/cli/query_provider_payment_storage_test.go b/x/pairing/client/cli/query_provider_payment_storage_test.go deleted file mode 100644 index 701e5a2d7a..0000000000 --- a/x/pairing/client/cli/query_provider_payment_storage_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/client/cli" - "github.com/lavanet/lava/x/pairing/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithProviderPaymentStorageObjects(t *testing.T, n int) (*network.Network, []types.ProviderPaymentStorage) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - providerPaymentStorage := types.ProviderPaymentStorage{ - Index: strconv.Itoa(i), - } - nullify.Fill(&providerPaymentStorage) - state.ProviderPaymentStorageList = append(state.ProviderPaymentStorageList, providerPaymentStorage) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.ProviderPaymentStorageList -} - -func TestShowProviderPaymentStorage(t *testing.T) { - net, objs := networkWithProviderPaymentStorageObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - idIndex string - - args []string - err error - obj types.ProviderPaymentStorage - }{ - { - desc: "found", - idIndex: objs[0].Index, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idIndex: strconv.Itoa(100000), - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - tc.idIndex, - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowProviderPaymentStorage(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetProviderPaymentStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.ProviderPaymentStorage) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.ProviderPaymentStorage), - ) - } - }) - } -} - -func TestListProviderPaymentStorage(t *testing.T) { - net, objs := networkWithProviderPaymentStorageObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListProviderPaymentStorage(), args) - require.NoError(t, err) - var resp types.QueryAllProviderPaymentStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ProviderPaymentStorage), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListProviderPaymentStorage(), args) - require.NoError(t, err) - var resp types.QueryAllProviderPaymentStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ProviderPaymentStorage), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListProviderPaymentStorage(), args) - require.NoError(t, err) - var resp types.QueryAllProviderPaymentStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - }) -} diff --git a/x/pairing/client/cli/query_providers_epoch_cu.go b/x/pairing/client/cli/query_providers_epoch_cu.go new file mode 100644 index 0000000000..09690a638d --- /dev/null +++ b/x/pairing/client/cli/query_providers_epoch_cu.go @@ -0,0 +1,37 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/x/pairing/types" + "github.com/spf13/cobra" +) + +func CmdProvidersEpochCu() *cobra.Command { + cmd := &cobra.Command{ + Use: "providers-epoch-cu", + Short: "Query to show the amount of CU serviced by all provider in a specific epoch", + Example: ` + lavad q pairing providers-epoch-cu`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryProvidersEpochCuRequest{} + + res, err := queryClient.ProvidersEpochCu(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/pairing/client/cli/query_unique_payment_storage_client_provider.go b/x/pairing/client/cli/query_unique_payment_storage_client_provider.go deleted file mode 100644 index 77c1ec4f29..0000000000 --- a/x/pairing/client/cli/query_unique_payment_storage_client_provider.go +++ /dev/null @@ -1,79 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" - "github.com/spf13/cobra" -) - -func CmdListUniquePaymentStorageClientProvider() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-unique-payment-storage-client-provider", - Short: "list all UniquePaymentStorageClientProvider", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllUniquePaymentStorageClientProviderRequest{ - Pagination: pageReq, - } - - res, err := queryClient.UniquePaymentStorageClientProviderAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowUniquePaymentStorageClientProvider() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-unique-payment-storage-client-provider [index]", - Short: "shows a UniquePaymentStorageClientProvider", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argIndex := args[0] - - params := &types.QueryGetUniquePaymentStorageClientProviderRequest{ - Index: argIndex, - } - - res, err := queryClient.UniquePaymentStorageClientProvider(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/pairing/client/cli/query_unique_payment_storage_client_provider_test.go b/x/pairing/client/cli/query_unique_payment_storage_client_provider_test.go deleted file mode 100644 index 68f4e51c44..0000000000 --- a/x/pairing/client/cli/query_unique_payment_storage_client_provider_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/client/cli" - "github.com/lavanet/lava/x/pairing/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithUniquePaymentStorageClientProviderObjects(t *testing.T, n int) (*network.Network, []types.UniquePaymentStorageClientProvider) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - uniquePaymentStorageClientProvider := types.UniquePaymentStorageClientProvider{ - Index: strconv.Itoa(i), - } - nullify.Fill(&uniquePaymentStorageClientProvider) - state.UniquePaymentStorageClientProviderList = append(state.UniquePaymentStorageClientProviderList, uniquePaymentStorageClientProvider) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.UniquePaymentStorageClientProviderList -} - -func TestShowUniquePaymentStorageClientProvider(t *testing.T) { - net, objs := networkWithUniquePaymentStorageClientProviderObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - idIndex string - - args []string - err error - obj types.UniquePaymentStorageClientProvider - }{ - { - desc: "found", - idIndex: objs[0].Index, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idIndex: strconv.Itoa(100000), - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - tc.idIndex, - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowUniquePaymentStorageClientProvider(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetUniquePaymentStorageClientProviderResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.UniquePaymentStorageClientProvider) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.UniquePaymentStorageClientProvider), - ) - } - }) - } -} - -func TestListUniquePaymentStorageClientProvider(t *testing.T) { - net, objs := networkWithUniquePaymentStorageClientProviderObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListUniquePaymentStorageClientProvider(), args) - require.NoError(t, err) - var resp types.QueryAllUniquePaymentStorageClientProviderResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.UniquePaymentStorageClientProvider), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListUniquePaymentStorageClientProvider(), args) - require.NoError(t, err) - var resp types.QueryAllUniquePaymentStorageClientProviderResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.UniquePaymentStorageClientProvider), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListUniquePaymentStorageClientProvider(), args) - require.NoError(t, err) - var resp types.QueryAllUniquePaymentStorageClientProviderResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - }) -} diff --git a/x/pairing/genesis.go b/x/pairing/genesis.go index b39a40ee6e..be5aa45283 100644 --- a/x/pairing/genesis.go +++ b/x/pairing/genesis.go @@ -10,16 +10,20 @@ import ( // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // Set all the uniquePaymentStorageClientProvider - for _, elem := range genState.UniquePaymentStorageClientProviderList { - k.SetUniquePaymentStorageClientProvider(ctx, elem) + for _, elem := range genState.UniqueEpochSessions { + k.SetUniqueEpochSession(ctx, elem.Epoch, elem.Provider, elem.Project, elem.ChainId, elem.SessionId) } // Set all the providerPaymentStorage - for _, elem := range genState.ProviderPaymentStorageList { - k.SetProviderPaymentStorage(ctx, elem) + for _, elem := range genState.ProviderEpochCus { + k.SetProviderEpochCu(ctx, elem.Epoch, elem.Provider, elem.ChainId, elem.ProviderEpochCu) + } + // Set all the ProviderEpochComplainedCus + for _, elem := range genState.ProviderEpochComplainedCus { + k.SetProviderEpochComplainerCu(ctx, elem.Epoch, elem.Provider, elem.ChainId, elem.ProviderEpochComplainerCu) } // Set all the epochPayments - for _, elem := range genState.EpochPaymentsList { - k.SetEpochPayments(ctx, elem) + for _, elem := range genState.ProviderConsumerEpochCus { + k.SetProviderConsumerEpochCu(ctx, elem.Epoch, elem.Provider, elem.Project, elem.ChainId, elem.ProviderConsumerEpochCu) } // Set all the badgeUsedCu for _, elem := range genState.BadgeUsedCuList { @@ -36,10 +40,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - - genesis.UniquePaymentStorageClientProviderList = k.GetAllUniquePaymentStorageClientProvider(ctx) - genesis.ProviderPaymentStorageList = k.GetAllProviderPaymentStorage(ctx) - genesis.EpochPaymentsList = k.GetAllEpochPayments(ctx) + genesis.UniqueEpochSessions = k.GetAllUniqueEpochSessionStore(ctx) + genesis.ProviderEpochCus = k.GetAllProviderEpochCuStore(ctx) + genesis.ProviderEpochComplainedCus = k.GetAllProviderEpochComplainerCuStore(ctx) + genesis.ProviderConsumerEpochCus = k.GetAllProviderConsumerEpochCuStore(ctx) genesis.BadgeUsedCuList = k.GetAllBadgeUsedCu(ctx) genesis.BadgesTS = k.ExportBadgesTimers(ctx) genesis.ProviderQosFS = k.ExportProviderQoS(ctx) diff --git a/x/pairing/genesis_test.go b/x/pairing/genesis_test.go index ecb8d6f28b..2dbc5b612a 100644 --- a/x/pairing/genesis_test.go +++ b/x/pairing/genesis_test.go @@ -14,28 +14,64 @@ func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - UniquePaymentStorageClientProviderList: []types.UniquePaymentStorageClientProvider{ + UniqueEpochSessions: []types.UniqueEpochSessionGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + SessionId: 0, }, { - Index: "1", + Epoch: 1, + Provider: "1", + Project: "1", + ChainId: "1", + SessionId: 1, }, }, - ProviderPaymentStorageList: []types.ProviderPaymentStorage{ + ProviderEpochCus: []types.ProviderEpochCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 10}, }, { - Index: "1", + Epoch: 1, + Provider: "1", + ChainId: "1", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 20}, }, }, - EpochPaymentsList: []types.EpochPayments{ + ProviderEpochComplainedCus: []types.ProviderEpochComplainerCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 100}, }, { - Index: "1", + Epoch: 1, + Provider: "1", + ChainId: "1", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 200}, + }, + }, + ProviderConsumerEpochCus: []types.ProviderConsumerEpochCuGenesis{ + { + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 10}, + }, + { + Epoch: 1, + Provider: "1", + Project: "1", + ChainId: "1", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 20}, }, }, BadgeUsedCuList: []types.BadgeUsedCu{ @@ -57,9 +93,9 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - require.ElementsMatch(t, genesisState.UniquePaymentStorageClientProviderList, got.UniquePaymentStorageClientProviderList) - require.ElementsMatch(t, genesisState.ProviderPaymentStorageList, got.ProviderPaymentStorageList) - require.ElementsMatch(t, genesisState.EpochPaymentsList, got.EpochPaymentsList) + require.ElementsMatch(t, genesisState.UniqueEpochSessions, got.UniqueEpochSessions) + require.ElementsMatch(t, genesisState.ProviderEpochCus, got.ProviderEpochCus) + require.ElementsMatch(t, genesisState.ProviderConsumerEpochCus, got.ProviderConsumerEpochCus) require.ElementsMatch(t, genesisState.BadgeUsedCuList, got.BadgeUsedCuList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/pairing/keeper/epoch_cu.go b/x/pairing/keeper/epoch_cu.go new file mode 100644 index 0000000000..8951a4d626 --- /dev/null +++ b/x/pairing/keeper/epoch_cu.go @@ -0,0 +1,341 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/cachekv" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/x/pairing/types" +) + +// UniqueEpochSession is used to detect double spend attacks +// It's kept in a epoch-prefixed store with a unique index: provider, project ID, chain ID and session ID +// +// ProviderEpochCu is used to track the CU of a specific provider in a specific epoch for unresponsiveness +// It's kept in a epoch-prefixed store with a unique index: provider address +// +// ProviderConsumerEpochCu is used to track the CU between a specific provider and +// consumer in a specific epoch for payments +// It's kept in a epoch-prefixed store with a unique index: provider and project ID + +/* ########## UniqueEpochSession ############ */ + +// SetUniqueEpochSession sets a UniqueEpochSession in the store +func (k Keeper) SetUniqueEpochSession(ctx sdk.Context, epoch uint64, provider string, project string, chainID string, sessionID uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) + store.Set(types.UniqueEpochSessionKey(epoch, provider, chainID, project, sessionID), []byte{0}) +} + +// IsUniqueEpochSessionExists checks if a UniqueEpochSession exists +func (k Keeper) IsUniqueEpochSessionExists(ctx sdk.Context, epoch uint64, provider string, project string, chainID string, sessionID uint64) bool { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) + b := store.Get(types.UniqueEpochSessionKey(epoch, provider, chainID, project, sessionID)) + return b != nil +} + +// RemoveAllUniqueEpochSession removes all the UniqueEpochSession objects from the store for a specific epoch +func (k Keeper) RemoveAllUniqueEpochSession(ctx sdk.Context, epoch uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// GetAllUniqueEpochSessionForEpoch gets all the UniqueEpochSession objects from the store for a specific epoch +func (k Keeper) GetAllUniqueEpochSessionForEpoch(ctx sdk.Context, epoch uint64) []string { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) + + iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) // Get an iterator with no prefix to iterate over all keys + defer iterator.Close() + + var keys []string + for ; iterator.Valid(); iterator.Next() { + keys = append(keys, string(iterator.Key())) + } + + return keys +} + +// GetAllUniqueEpochSessionStore gets all the UniqueEpochSession objects from the store (used for genesis) +func (k Keeper) GetAllUniqueEpochSessionStore(ctx sdk.Context) []types.UniqueEpochSessionGenesis { + info := []types.UniqueEpochSessionGenesis{} + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.UniqueEpochSessionPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + epoch, provider, chainID, project, sessionID, err := types.DecodeUniqueEpochSessionKey(string(iterator.Key())) + if err != nil { + utils.LavaFormatError("could not decode UniqueEpochSessionKey", err, utils.LogAttr("key", string(iterator.Key()))) + } + info = append(info, types.UniqueEpochSessionGenesis{ + Epoch: epoch, + Provider: provider, + Project: project, + ChainId: chainID, + SessionId: sessionID, + }) + } + + return info +} + +/* ########## ProviderEpochCu ############ */ + +// SetProviderEpochCu sets a ProviderEpochCu in the store +func (k Keeper) SetProviderEpochCu(ctx sdk.Context, epoch uint64, provider string, chainID string, providerEpochCu types.ProviderEpochCu) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) + b := k.cdc.MustMarshal(&providerEpochCu) + store.Set(types.ProviderEpochCuKey(epoch, provider, chainID), b) +} + +// GetProviderEpochCu returns a ProviderEpochCu for a specific epoch and provider +func (k Keeper) GetProviderEpochCu(ctx sdk.Context, epoch uint64, provider string, chainID string) (val types.ProviderEpochCu, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) + b := store.Get(types.ProviderEpochCuKey(epoch, provider, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveProviderEpochCu removes a ProviderEpochCu from the store +func (k Keeper) RemoveAllProviderEpochCu(ctx sdk.Context, epoch uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// GetAllProviderEpochCuStore returns all the ProviderEpochCu from the store (used for genesis) +func (k Keeper) GetAllProviderEpochCuStore(ctx sdk.Context) []types.ProviderEpochCuGenesis { + info := []types.ProviderEpochCuGenesis{} + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + epoch, provider, chainID, err := types.DecodeProviderEpochCuKey(string(iterator.Key())) + if err != nil { + utils.LavaFormatError("could not decode ProviderEpochCuKey with epoch", err, utils.LogAttr("key", string(iterator.Key()))) + continue + } + var pec types.ProviderEpochCu + k.cdc.MustUnmarshal(iterator.Value(), &pec) + info = append(info, types.ProviderEpochCuGenesis{ + Epoch: epoch, + Provider: provider, + ChainId: chainID, + ProviderEpochCu: pec, + }) + } + + return info +} + +/* ########## ProviderEpochComplainerCu ############ */ + +// SetProviderEpochComplainerCu sets a ProviderEpochComplainerCu in the store +func (k Keeper) SetProviderEpochComplainerCu(ctx sdk.Context, epoch uint64, provider string, chainID string, providerEpochCu types.ProviderEpochComplainerCu) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) + b := k.cdc.MustMarshal(&providerEpochCu) + store.Set(types.ProviderEpochCuKey(epoch, provider, chainID), b) +} + +// GetProviderEpochComplainerCu returns a ProviderEpochCu for a specific epoch and provider +func (k Keeper) GetProviderEpochComplainerCu(ctx sdk.Context, epoch uint64, provider string, chainID string) (val types.ProviderEpochComplainerCu, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) + b := store.Get(types.ProviderEpochCuKey(epoch, provider, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveProviderEpochComplainerCu removes a ProviderEpochCu from the store +func (k Keeper) RemoveAllProviderEpochComplainerCu(ctx sdk.Context, epoch uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// GetAllProviderEpochComplainerCuStore returns all the ProviderEpochCu from the store (used for genesis) +func (k Keeper) GetAllProviderEpochComplainerCuStore(ctx sdk.Context) []types.ProviderEpochComplainerCuGenesis { + info := []types.ProviderEpochComplainerCuGenesis{} + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + epoch, provider, chainID, err := types.DecodeProviderEpochCuKey(string(iterator.Key())) + if err != nil { + utils.LavaFormatError("could not decode ProviderEpochComplainerCuKey with epoch", err, utils.LogAttr("key", string(iterator.Key()))) + continue + } + var pec types.ProviderEpochComplainerCu + k.cdc.MustUnmarshal(iterator.Value(), &pec) + info = append(info, types.ProviderEpochComplainerCuGenesis{ + Epoch: epoch, + Provider: provider, + ChainId: chainID, + ProviderEpochComplainerCu: pec, + }) + } + + return info +} + +/* ########## ProviderConsumerEpochCu ############ */ + +// SetProviderConsumerEpochCu sets a ProviderConsumerEpochCu in the store +func (k Keeper) SetProviderConsumerEpochCu(ctx sdk.Context, epoch uint64, provider string, project string, chainID string, providerConsumerEpochCu types.ProviderConsumerEpochCu) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) + b := k.cdc.MustMarshal(&providerConsumerEpochCu) + store.Set(types.ProviderConsumerEpochCuKey(epoch, provider, project, chainID), b) +} + +// GetProviderConsumerEpochCu returns a ProviderConsumerEpochCu for a specific epoch, provider and project +func (k Keeper) GetProviderConsumerEpochCu(ctx sdk.Context, epoch uint64, provider string, project string, chainID string) (val types.ProviderConsumerEpochCu, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) + b := store.Get(types.ProviderConsumerEpochCuKey(epoch, provider, project, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveProviderConsumerEpochCu removes a ProviderConsumerEpochCu from the store +func (k Keeper) RemoveProviderConsumerEpochCu(ctx sdk.Context, epoch uint64, provider string, project string, chainID string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) + store.Delete(types.ProviderConsumerEpochCuKey(epoch, provider, project, chainID)) +} + +// GetAllProviderConsumerEpochCuStore returns all the ProviderConsumerEpochCu from the store (used for genesis) +func (k Keeper) GetAllProviderConsumerEpochCu(ctx sdk.Context, epoch uint64) []types.ProviderConsumerEpochCuGenesis { + providerConsumerEpochCus := []types.ProviderConsumerEpochCuGenesis{} + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) + iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + epoch, provider, project, chainID, err := types.DecodeProviderConsumerEpochCuKey(string(iterator.Key())) + if err != nil { + utils.LavaFormatError("could not decode ProviderConsumerEpochCu with epoch", err, utils.LogAttr("key", string(iterator.Key()))) + continue + } + var pcec types.ProviderConsumerEpochCu + k.cdc.MustUnmarshal(iterator.Value(), &pcec) + providerConsumerEpochCus = append(providerConsumerEpochCus, types.ProviderConsumerEpochCuGenesis{ + Epoch: epoch, + Provider: provider, + Project: project, + ChainId: chainID, + ProviderConsumerEpochCu: pcec, + }) + } + + return providerConsumerEpochCus +} + +// GetAllProviderConsumerEpochCuStore returns all the ProviderConsumerEpochCu from the store (used for genesis) +func (k Keeper) GetAllProviderConsumerEpochCuStore(ctx sdk.Context) []types.ProviderConsumerEpochCuGenesis { + info := []types.ProviderConsumerEpochCuGenesis{} + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.ProviderConsumerEpochCuPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + epoch, provider, project, chainID, err := types.DecodeProviderConsumerEpochCuKey(string(iterator.Key())) + if err != nil { + utils.LavaFormatError("could not decode ProviderConsumerEpochCuKey", err, utils.LogAttr("key", string(iterator.Key()))) + continue + } + var pcec types.ProviderConsumerEpochCu + k.cdc.MustUnmarshal(iterator.Value(), &pcec) + info = append(info, types.ProviderConsumerEpochCuGenesis{ + Epoch: epoch, + Provider: provider, + Project: project, + ChainId: chainID, + ProviderConsumerEpochCu: pcec, + }) + } + + return info +} + +/* ########## EpochCuCache ############ */ +type EpochCuCache struct { + Keeper + ProviderEpochCuCache *cachekv.Store + ProviderEpochComplainerCuCache *cachekv.Store + ProviderConsumerEpochCuCache *cachekv.Store +} + +func (k Keeper) NewEpochCuCacheHandler(ctx sdk.Context) EpochCuCache { + return EpochCuCache{ + Keeper: k, + ProviderEpochCuCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix())), + ProviderEpochComplainerCuCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix())), + ProviderConsumerEpochCuCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix())), + } +} + +func (k EpochCuCache) SetProviderEpochCuCached(ctx sdk.Context, epoch uint64, provider string, chainID string, providerEpochCu types.ProviderEpochCu) { + b := k.cdc.MustMarshal(&providerEpochCu) + k.ProviderEpochCuCache.Set(types.ProviderEpochCuKey(epoch, provider, chainID), b) +} + +func (k EpochCuCache) GetProviderEpochCuCached(ctx sdk.Context, epoch uint64, provider string, chainID string) (val types.ProviderEpochCu, found bool) { + b := k.ProviderEpochCuCache.Get(types.ProviderEpochCuKey(epoch, provider, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k EpochCuCache) SetProviderEpochComplainerCuCached(ctx sdk.Context, epoch uint64, provider string, chainID string, providerEpochCu types.ProviderEpochComplainerCu) { + b := k.cdc.MustMarshal(&providerEpochCu) + k.ProviderEpochComplainerCuCache.Set(types.ProviderEpochCuKey(epoch, provider, chainID), b) +} + +func (k EpochCuCache) GetProviderEpochComplainerCuCached(ctx sdk.Context, epoch uint64, provider string, chainID string) (val types.ProviderEpochComplainerCu, found bool) { + b := k.ProviderEpochComplainerCuCache.Get(types.ProviderEpochCuKey(epoch, provider, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k EpochCuCache) SetProviderConsumerEpochCuCached(ctx sdk.Context, epoch uint64, provider string, project string, chainID string, providerConsumerEpochCu types.ProviderConsumerEpochCu) { + b := k.cdc.MustMarshal(&providerConsumerEpochCu) + k.ProviderConsumerEpochCuCache.Set(types.ProviderConsumerEpochCuKey(epoch, provider, project, chainID), b) +} + +func (k EpochCuCache) GetProviderConsumerEpochCuCached(ctx sdk.Context, epoch uint64, provider string, project string, chainID string) (val types.ProviderConsumerEpochCu, found bool) { + b := k.ProviderConsumerEpochCuCache.Get(types.ProviderConsumerEpochCuKey(epoch, provider, project, chainID)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k EpochCuCache) Flush() { + k.ProviderEpochCuCache.Write() + k.ProviderEpochComplainerCuCache.Write() + k.ProviderConsumerEpochCuCache.Write() +} diff --git a/x/pairing/keeper/epoch_cu_test.go b/x/pairing/keeper/epoch_cu_test.go new file mode 100644 index 0000000000..7acc9a5a88 --- /dev/null +++ b/x/pairing/keeper/epoch_cu_test.go @@ -0,0 +1,204 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/testutil/nullify" + "github.com/lavanet/lava/x/pairing/keeper" + "github.com/lavanet/lava/x/pairing/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +/* ########## UniqueEpochSession ############ */ + +func createNUniqueEpochSession(keeper *keeper.Keeper, ctx sdk.Context, n int) []string { + items := make([]string, n) + for i := range items { + items[i] = strconv.Itoa(i) + keeper.SetUniqueEpochSession(ctx, uint64(i), items[i], items[i], items[i], uint64(i)) + } + return items +} + +func TestUniqueEpochSessionGet(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNUniqueEpochSession(keeper, ctx, 10) + for i := range items { + item := strconv.Itoa(i) + found := keeper.IsUniqueEpochSessionExists(ctx, uint64(i), item, item, item, uint64(i)) + require.True(t, found) + } +} + +func TestUniqueEpochSessionRemove(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNUniqueEpochSession(keeper, ctx, 10) + for i := range items { + keeper.RemoveAllUniqueEpochSession(ctx, uint64(i)) + item := strconv.Itoa(i) + found := keeper.IsUniqueEpochSessionExists(ctx, uint64(i), item, item, item, uint64(i)) + require.False(t, found) + } +} + +func TestUniqueEpochSessionGetAll(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNUniqueEpochSession(keeper, ctx, 10) + expectedKeys := []string{} + keys := []string{} + for i, item := range items { + key := string(types.UniqueEpochSessionKey(uint64(i), item, item, item, uint64(i))) + expectedKeys = append(expectedKeys, key) + keys = append(keys, keeper.GetAllUniqueEpochSessionForEpoch(ctx, uint64(i))...) + } + require.ElementsMatch(t, nullify.Fill(expectedKeys), nullify.Fill(keys)) +} + +func TestUniqueEpochSessionGetAllStore(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNUniqueEpochSession(keeper, ctx, 10) + expectedInfo := []types.UniqueEpochSessionGenesis{} + for i, item := range items { + expectedInfo = append(expectedInfo, types.UniqueEpochSessionGenesis{ + Epoch: uint64(i), + Provider: item, + Project: item, + ChainId: item, + SessionId: uint64(i), + }) + } + info := keeper.GetAllUniqueEpochSessionStore(ctx) + require.ElementsMatch(t, nullify.Fill(expectedInfo), nullify.Fill(info)) +} + +/* ########## ProviderEpochCu ############ */ + +func createNProviderEpochCu(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ProviderEpochCu { + items := make([]types.ProviderEpochCu, n) + for i := range items { + name := strconv.Itoa(i) + items[i] = types.ProviderEpochCu{ServicedCu: uint64(i)} + keeper.SetProviderEpochCu(ctx, uint64(i), name, name, items[i]) + } + return items +} + +func TestProviderEpochCuGet(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderEpochCu(keeper, ctx, 10) + for i, item := range items { + name := strconv.Itoa(i) + pec, found := keeper.GetProviderEpochCu(ctx, uint64(i), name, name) + require.True(t, found) + require.Equal(t, item.ServicedCu, pec.ServicedCu) + } +} + +func TestProviderEpochCuRemove(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderEpochCu(keeper, ctx, 10) + for i := range items { + name := strconv.Itoa(i) + keeper.RemoveAllProviderEpochCu(ctx, uint64(i)) + _, found := keeper.GetProviderEpochCu(ctx, uint64(i), name, name) + require.False(t, found) + } +} + +func TestProviderEpochCuGetAllStore(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderEpochCu(keeper, ctx, 10) + expectedInfo := []types.ProviderEpochCuGenesis{} + for i := range items { + name := strconv.Itoa(i) + expectedInfo = append(expectedInfo, types.ProviderEpochCuGenesis{ + Epoch: uint64(i), + Provider: name, + ChainId: name, + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: uint64(i)}, + }) + } + info := keeper.GetAllProviderEpochCuStore(ctx) + require.ElementsMatch(t, nullify.Fill(expectedInfo), nullify.Fill(info)) +} + +/* ########## ProviderConsumerEpochCu ############ */ + +func createNProviderConsumerEpochCu(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ProviderConsumerEpochCu { + items := make([]types.ProviderConsumerEpochCu, n) + for i := range items { + name := strconv.Itoa(i) + items[i] = types.ProviderConsumerEpochCu{Cu: uint64(i)} + keeper.SetProviderConsumerEpochCu(ctx, uint64(i), name, name, name, items[i]) + } + return items +} + +func TestProviderConsumerEpochCuGet(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderConsumerEpochCu(keeper, ctx, 10) + for i, item := range items { + name := strconv.Itoa(i) + pecc, found := keeper.GetProviderConsumerEpochCu(ctx, uint64(i), name, name, name) + require.True(t, found) + require.Equal(t, item.Cu, pecc.Cu) + } +} + +func TestProviderConsumerEpochCuRemove(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderConsumerEpochCu(keeper, ctx, 10) + for i := range items { + name := strconv.Itoa(i) + keeper.RemoveProviderConsumerEpochCu(ctx, uint64(i), name, name, name) + _, found := keeper.GetProviderConsumerEpochCu(ctx, uint64(i), name, name, name) + require.False(t, found) + } +} + +func TestProviderConsumerEpochCuGetAll(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderConsumerEpochCu(keeper, ctx, 10) + expectedPcecs := []types.ProviderConsumerEpochCuGenesis{} + actualPcecs := []types.ProviderConsumerEpochCuGenesis{} + for i := range items { + name := strconv.Itoa(i) + expectedPcecs = append(expectedPcecs, types.ProviderConsumerEpochCuGenesis{ + Epoch: uint64(i), + Provider: name, + Project: name, + ChainId: name, + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{ + Cu: uint64(i), + }, + }) + pecs := keeper.GetAllProviderConsumerEpochCu(ctx, uint64(i)) + actualPcecs = append(actualPcecs, pecs...) + } + + require.ElementsMatch(t, expectedPcecs, actualPcecs) +} + +func TestProviderConsumerEpochCuGetAllStore(t *testing.T) { + keeper, ctx := keepertest.PairingKeeper(t) + items := createNProviderConsumerEpochCu(keeper, ctx, 10) + expectedInfo := []types.ProviderConsumerEpochCuGenesis{} + for i := range items { + name := strconv.Itoa(i) + expectedInfo = append(expectedInfo, types.ProviderConsumerEpochCuGenesis{ + Epoch: uint64(i), + Provider: name, + Project: name, + ChainId: name, + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: uint64(i)}, + }) + } + info := keeper.GetAllProviderConsumerEpochCuStore(ctx) + require.ElementsMatch(t, nullify.Fill(expectedInfo), nullify.Fill(info)) +} diff --git a/x/pairing/keeper/epoch_payment.go b/x/pairing/keeper/epoch_payment.go new file mode 100644 index 0000000000..f1a6235bcb --- /dev/null +++ b/x/pairing/keeper/epoch_payment.go @@ -0,0 +1,77 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/pairing/types" +) + +// AddEpochPayment adds a new epoch payment and returns the updated CU used between provider and project +func (k EpochCuCache) AddEpochPayment(ctx sdk.Context, chainID string, epoch uint64, project string, provider string, cu uint64, sessionID uint64) uint64 { + // register new epoch session (not checking double spend because it's already checked before calling this function) + k.SetUniqueEpochSession(ctx, epoch, provider, project, chainID, sessionID) + + // update provider serviced CU + pec, found := k.GetProviderEpochCuCached(ctx, epoch, provider, chainID) + if !found { + pec = types.ProviderEpochCu{ServicedCu: cu} + } else { + pec.ServicedCu += cu + } + k.SetProviderEpochCuCached(ctx, epoch, provider, chainID, pec) + + // update provider CU for the specific project + pcec, found := k.GetProviderConsumerEpochCuCached(ctx, epoch, provider, project, chainID) + if !found { + pcec = types.ProviderConsumerEpochCu{Cu: cu} + } else { + pcec.Cu += cu + } + k.SetProviderConsumerEpochCuCached(ctx, epoch, provider, project, chainID, pcec) + return pcec.Cu +} + +// Function to remove epoch payment objects from deleted epochs (older than the chain's memory) +func (k Keeper) RemoveOldEpochPayments(ctx sdk.Context) { + epochsToDelete := k.epochStorageKeeper.GetDeletedEpochs(ctx) + for _, epoch := range epochsToDelete { + k.RemoveAllEpochPaymentsForBlockAppendAdjustments(ctx, epoch) + } +} + +// Function to remove all epoch payments objects from a specific epoch +func (k Keeper) RemoveAllEpochPaymentsForBlockAppendAdjustments(ctx sdk.Context, epochToDelete uint64) { + // remove all unique epoch sessions + k.RemoveAllUniqueEpochSession(ctx, epochToDelete) + + // remove all provider epoch cu + k.RemoveAllProviderEpochCu(ctx, epochToDelete) + + // remove all provider epoch complainer cu + k.RemoveAllProviderEpochComplainerCu(ctx, epochToDelete) + + pcecs := k.GetAllProviderConsumerEpochCu(ctx, epochToDelete) + + // TODO: update Qos in providerQosFS. new consumers (cluster.subUsage = 0) get default QoS (what is default?) + consumerUsage := map[string]uint64{} + type couplingConsumerProvider struct { + consumer string + provider string + } + // we are keeping the iteration keys to keep determinism when going over the map + iterationOrder := []couplingConsumerProvider{} + couplingUsage := map[couplingConsumerProvider]uint64{} + for _, pcec := range pcecs { + coupling := couplingConsumerProvider{consumer: pcec.Project, provider: pcec.Provider} + if _, ok := couplingUsage[coupling]; !ok { + // only add it if it doesn't exist + iterationOrder = append(iterationOrder, coupling) + } + consumerUsage[pcec.Project] += pcec.ProviderConsumerEpochCu.Cu + couplingUsage[coupling] += pcec.ProviderConsumerEpochCu.Cu + + k.RemoveProviderConsumerEpochCu(ctx, epochToDelete, pcec.Provider, pcec.Project, pcec.ChainId) + } + for _, coupling := range iterationOrder { + k.subscriptionKeeper.AppendAdjustment(ctx, coupling.consumer, coupling.provider, consumerUsage[coupling.consumer], couplingUsage[coupling]) + } +} diff --git a/x/pairing/keeper/epoch_payments.go b/x/pairing/keeper/epoch_payments.go deleted file mode 100644 index d89937822e..0000000000 --- a/x/pairing/keeper/epoch_payments.go +++ /dev/null @@ -1,237 +0,0 @@ -package keeper - -import ( - "fmt" - "strconv" - - "github.com/cosmos/cosmos-sdk/store/cachekv" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" -) - -// SetEpochPayments set a specific epochPayments in the store from its index -func (k Keeper) SetEpochPayments(ctx sdk.Context, epochPayments types.EpochPayments) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochPaymentsKeyPrefix)) - b := k.cdc.MustMarshal(&epochPayments) - store.Set(types.EpochPaymentsKey( - epochPayments.Index, - ), b) -} - -// GetEpochPayments returns a epochPayments from its index -func (k Keeper) GetEpochPayments( - ctx sdk.Context, - index string, -) (val types.EpochPayments, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochPaymentsKeyPrefix)) - - b := store.Get(types.EpochPaymentsKey( - index, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -func (k EpochPaymentHandler) SetEpochPaymentsCached(ctx sdk.Context, epochPayments types.EpochPayments) { - b := k.cdc.MustMarshal(&epochPayments) - k.EpochPaymentsCache.Set(types.EpochPaymentsKey(epochPayments.Index), b) -} - -func (k EpochPaymentHandler) GetEpochPaymentsCached( - ctx sdk.Context, - index string, -) (val types.EpochPayments, found bool) { - b := k.EpochPaymentsCache.Get(types.EpochPaymentsKey(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveEpochPayments removes a epochPayments from the store -func (k Keeper) RemoveEpochPayments( - ctx sdk.Context, - index string, -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochPaymentsKeyPrefix)) - store.Delete(types.EpochPaymentsKey( - index, - )) -} - -// GetAllEpochPayments returns all epochPayments -func (k Keeper) GetAllEpochPayments(ctx sdk.Context) (list []types.EpochPayments) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochPaymentsKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.EpochPayments - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -// Function to remove epochPayments objects from deleted epochs (older than the chain's memory) -func (k Keeper) RemoveOldEpochPayment(ctx sdk.Context) { - for _, epoch := range k.epochStorageKeeper.GetDeletedEpochs(ctx) { - k.RemoveAllEpochPaymentsForBlockAppendAdjustments(ctx, epoch) - } -} - -// Function to get the epochPayments object from a specific epoch. Note that it also returns the epochPayments object's key which is the epoch in hex representation (base 16) -func (k Keeper) GetEpochPaymentsFromBlock(ctx sdk.Context, epoch uint64) (epochPayment types.EpochPayments, found bool, key string) { - key = epochPaymentKey(epoch) - epochPayment, found = k.GetEpochPayments(ctx, key) - return -} - -func epochPaymentKey(epoch uint64) string { - return strconv.FormatUint(epoch, 16) -} - -type EpochPaymentHandler struct { - Keeper - EpochPaymentsCache *cachekv.Store - ProviderPaymentStorageCache *cachekv.Store - UniquePaymentStorageClientProviderCache *cachekv.Store -} - -func (k Keeper) NewEpochPaymentHandler(ctx sdk.Context) EpochPaymentHandler { - return EpochPaymentHandler{ - Keeper: k, - EpochPaymentsCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochPaymentsKeyPrefix))), - ProviderPaymentStorageCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix))), - UniquePaymentStorageClientProviderCache: cachekv.NewStore(prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix))), - } -} - -func (k EpochPaymentHandler) Flush() { - k.EpochPaymentsCache.Write() - k.ProviderPaymentStorageCache.Write() - k.UniquePaymentStorageClientProviderCache.Write() -} - -// Function to add an epoch payment to the epochPayments object -func (k EpochPaymentHandler) AddEpochPayment(ctx sdk.Context, chainID string, epoch uint64, projectID string, providerAddress sdk.AccAddress, usedCU uint64, uniqueIdentifier string) uint64 { - if epoch < k.epochStorageKeeper.GetEarliestEpochStart(ctx) { - return 0 - } - - // add a uniquePaymentStorageClientProvider object (the object that represent the actual payment) to this epoch's providerPaymentPayment object - userPaymentProviderStorage, usedCUProviderTotal := k.AddProviderPaymentInEpoch(ctx, chainID, epoch, projectID, providerAddress, usedCU, uniqueIdentifier) - - // get this epoch's epochPayments object - key := epochPaymentKey(epoch) - epochPayments, found := k.GetEpochPaymentsCached(ctx, key) - if !found { - // this epoch doesn't have a epochPayments object, create one with the providerPaymentStorage object from before - epochPayments = types.EpochPayments{Index: key, ProviderPaymentStorageKeys: []string{userPaymentProviderStorage.GetIndex()}} - } else { - // this epoch has a epochPayments object -> make sure this payment is not already in this object - // TODO: improve - have it sorted and binary search, store indexes map for the current epoch providers stake and just lookup at the provider index (and turn it on) - assumes most providers will have payments - providerPaymentStorageKeyFound := false - for _, providerPaymentStorageKey := range epochPayments.GetProviderPaymentStorageKeys() { - if providerPaymentStorageKey == userPaymentProviderStorage.GetIndex() { - providerPaymentStorageKeyFound = true - break - } - } - - // this epoch's epochPayments object doesn't contain this providerPaymentStorage key -> append the new key - if !providerPaymentStorageKeyFound { - epochPayments.ProviderPaymentStorageKeys = append(epochPayments.ProviderPaymentStorageKeys, userPaymentProviderStorage.GetIndex()) - } - } - - // update the epochPayments object - k.SetEpochPaymentsCached(ctx, epochPayments) - - return usedCUProviderTotal -} - -// Function to remove all epochPayments objects from a specific epoch -func (k Keeper) RemoveAllEpochPaymentsForBlockAppendAdjustments(ctx sdk.Context, blockForDelete uint64) { - // get the epochPayments object of blockForDelete - epochPayments, found, key := k.GetEpochPaymentsFromBlock(ctx, blockForDelete) - if !found { - return - } - - // TODO: update Qos in providerQosFS. new consumers (cluster.subUsage = 0) get default QoS (what is default?) - consumerUsage := map[string]uint64{} - type couplingConsumerProvider struct { - consumer string - provider string - } - // we are keeping the iteration keys to keep determinism when going over the map - iterationOrder := []couplingConsumerProvider{} - couplingUsage := map[couplingConsumerProvider]uint64{} - // go over the epochPayments object's providerPaymentStorageKeys - userPaymentsStorageKeys := epochPayments.GetProviderPaymentStorageKeys() - for _, userPaymentStorageKey := range userPaymentsStorageKeys { - // get the providerPaymentStorage object - providerPaymentStorage, found := k.GetProviderPaymentStorage(ctx, userPaymentStorageKey) - if !found { - continue - } - - // go over the providerPaymentStorage object's uniquePaymentStorageClientProviderKeys - uniquePaymentStoragesCliProKeys := providerPaymentStorage.GetUniquePaymentStorageClientProviderKeys() - for _, uniquePaymentStorageKey := range uniquePaymentStoragesCliProKeys { - // get the uniquePaymentStorageClientProvider object - uniquePaymentStorage, found := k.GetUniquePaymentStorageClientProvider(ctx, uniquePaymentStorageKey) - if !found { - continue - } - - // validate its an old entry, for sanity - if uniquePaymentStorage.Block > blockForDelete { - // this should not happen; to avoid panic we simply skip this one (thus - // freeze the situation so it can be investigated and orderly resolved). - utils.LavaFormatError("critical: failed to delete epoch payment", - fmt.Errorf("payment block greater than block for delete"), - utils.Attribute{Key: "paymentBlock", Value: uniquePaymentStorage.Block}, - utils.Attribute{Key: "deleteBlock", Value: blockForDelete}, - ) - continue - } - - // delete the uniquePaymentStorageClientProvider object - k.RemoveUniquePaymentStorageClientProvider(ctx, uniquePaymentStorage.Index) - consumer := k.GetConsumerFromUniquePayment(uniquePaymentStorageKey) - - provider, err := k.GetProviderFromProviderPaymentStorage(&providerPaymentStorage) - if err != nil { - utils.LavaFormatError("failed getting provider from payment storage", err) - continue - } - coupling := couplingConsumerProvider{consumer: consumer, provider: provider} - if _, ok := couplingUsage[coupling]; !ok { - // only add it if it doesn't exist - iterationOrder = append(iterationOrder, coupling) - } - consumerUsage[consumer] += uniquePaymentStorage.UsedCU - couplingUsage[coupling] += uniquePaymentStorage.UsedCU - } - - // after we're done deleting the uniquePaymentStorageClientProvider objects, delete the providerPaymentStorage object - k.RemoveProviderPaymentStorage(ctx, providerPaymentStorage.Index) - } - for _, coupling := range iterationOrder { - k.subscriptionKeeper.AppendAdjustment(ctx, coupling.consumer, coupling.provider, consumerUsage[coupling.consumer], couplingUsage[coupling]) - } - // after we're done deleting the providerPaymentStorage objects, delete the epochPayments object - k.RemoveEpochPayments(ctx, key) -} diff --git a/x/pairing/keeper/epoch_payments_test.go b/x/pairing/keeper/epoch_payments_test.go deleted file mode 100644 index a20b5f29e6..0000000000 --- a/x/pairing/keeper/epoch_payments_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNEpochPayments(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.EpochPayments { - items := make([]types.EpochPayments, n) - for i := range items { - items[i].Index = strconv.Itoa(i) - - keeper.SetEpochPayments(ctx, items[i]) - } - return items -} - -func TestEpochPaymentsGet(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNEpochPayments(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetEpochPayments(ctx, - item.Index, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} - -func TestEpochPaymentsRemove(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNEpochPayments(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveEpochPayments(ctx, - item.Index, - ) - _, found := keeper.GetEpochPayments(ctx, - item.Index, - ) - require.False(t, found) - } -} - -func TestEpochPaymentsGetAll(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNEpochPayments(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllEpochPayments(ctx)), - ) -} diff --git a/x/pairing/keeper/fixation_test.go b/x/pairing/keeper/fixation_test.go index f48fd91683..759522b26d 100644 --- a/x/pairing/keeper/fixation_test.go +++ b/x/pairing/keeper/fixation_test.go @@ -51,7 +51,18 @@ func TestEpochPaymentDeletionWithMemoryShortening(t *testing.T) { // check that both payments were deleted ts.AdvanceEpochs(epochsToSave) - res, err := ts.QueryPairingListEpochPayments() + res, err := ts.QueryProjectDeveloper(clientAcct.Addr.String()) require.NoError(t, err) - require.Equal(t, 0, len(res.EpochPayments)) + res2, err := ts.QueryPairingProviderEpochCu(providerAddr, res.Project.Index, ts.spec.Index) + require.NoError(t, err) + require.Len(t, res2.Info, 0) + + list0 := ts.Keepers.Pairing.GetAllProviderEpochComplainerCuStore(ts.Ctx) + require.Len(t, list0, 0) + + list1 := ts.Keepers.Pairing.GetAllUniqueEpochSessionStore(ts.Ctx) + require.Len(t, list1, 0) + + list2 := ts.Keepers.Pairing.GetAllProviderConsumerEpochCuStore(ts.Ctx) + require.Len(t, list2, 0) } diff --git a/x/pairing/keeper/grpc_query_epoch_payments.go b/x/pairing/keeper/grpc_query_epoch_payments.go deleted file mode 100644 index 27e8b1cf3e..0000000000 --- a/x/pairing/keeper/grpc_query_epoch_payments.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/pairing/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) EpochPaymentsAll(c context.Context, req *types.QueryAllEpochPaymentsRequest) (*types.QueryAllEpochPaymentsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var epochPaymentss []types.EpochPayments - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - epochPaymentsStore := prefix.NewStore(store, types.KeyPrefix(types.EpochPaymentsKeyPrefix)) - - pageRes, err := query.Paginate(epochPaymentsStore, req.Pagination, func(key, value []byte) error { - var epochPayments types.EpochPayments - if err := k.cdc.Unmarshal(value, &epochPayments); err != nil { - return err - } - - epochPaymentss = append(epochPaymentss, epochPayments) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllEpochPaymentsResponse{EpochPayments: epochPaymentss, Pagination: pageRes}, nil -} - -func (k Keeper) EpochPayments(c context.Context, req *types.QueryGetEpochPaymentsRequest) (*types.QueryGetEpochPaymentsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetEpochPayments( - ctx, - req.Index, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetEpochPaymentsResponse{EpochPayments: val}, nil -} diff --git a/x/pairing/keeper/grpc_query_epoch_payments_test.go b/x/pairing/keeper/grpc_query_epoch_payments_test.go deleted file mode 100644 index 351a6976ea..0000000000 --- a/x/pairing/keeper/grpc_query_epoch_payments_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/types" -) - -var _ = strconv.IntSize - -func TestEpochPaymentsQuerySingle(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNEpochPayments(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetEpochPaymentsRequest - response *types.QueryGetEpochPaymentsResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetEpochPaymentsRequest{ - Index: msgs[0].Index, - }, - response: &types.QueryGetEpochPaymentsResponse{EpochPayments: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetEpochPaymentsRequest{ - Index: msgs[1].Index, - }, - response: &types.QueryGetEpochPaymentsResponse{EpochPayments: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetEpochPaymentsRequest{ - Index: strconv.Itoa(100000), - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.EpochPayments(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestEpochPaymentsQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNEpochPayments(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllEpochPaymentsRequest { - return &types.QueryAllEpochPaymentsRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.EpochPaymentsAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.EpochPayments), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.EpochPayments), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.EpochPaymentsAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.EpochPayments), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.EpochPayments), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.EpochPaymentsAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.EpochPayments), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.EpochPaymentsAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/pairing/keeper/grpc_query_provider_payment_storage.go b/x/pairing/keeper/grpc_query_provider_payment_storage.go deleted file mode 100644 index d1c4ff5349..0000000000 --- a/x/pairing/keeper/grpc_query_provider_payment_storage.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/pairing/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) ProviderPaymentStorageAll(c context.Context, req *types.QueryAllProviderPaymentStorageRequest) (*types.QueryAllProviderPaymentStorageResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var providerPaymentStorages []types.ProviderPaymentStorage - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - providerPaymentStorageStore := prefix.NewStore(store, types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix)) - - pageRes, err := query.Paginate(providerPaymentStorageStore, req.Pagination, func(key, value []byte) error { - var providerPaymentStorage types.ProviderPaymentStorage - if err := k.cdc.Unmarshal(value, &providerPaymentStorage); err != nil { - return err - } - - providerPaymentStorages = append(providerPaymentStorages, providerPaymentStorage) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllProviderPaymentStorageResponse{ProviderPaymentStorage: providerPaymentStorages, Pagination: pageRes}, nil -} - -func (k Keeper) ProviderPaymentStorage(c context.Context, req *types.QueryGetProviderPaymentStorageRequest) (*types.QueryGetProviderPaymentStorageResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetProviderPaymentStorage( - ctx, - req.Index, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetProviderPaymentStorageResponse{ProviderPaymentStorage: val}, nil -} diff --git a/x/pairing/keeper/grpc_query_provider_payment_storage_test.go b/x/pairing/keeper/grpc_query_provider_payment_storage_test.go deleted file mode 100644 index abc24208a9..0000000000 --- a/x/pairing/keeper/grpc_query_provider_payment_storage_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func TestProviderPaymentStorageQuerySingle(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNProviderPaymentStorage(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetProviderPaymentStorageRequest - response *types.QueryGetProviderPaymentStorageResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetProviderPaymentStorageRequest{ - Index: msgs[0].Index, - }, - response: &types.QueryGetProviderPaymentStorageResponse{ProviderPaymentStorage: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetProviderPaymentStorageRequest{ - Index: msgs[1].Index, - }, - response: &types.QueryGetProviderPaymentStorageResponse{ProviderPaymentStorage: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetProviderPaymentStorageRequest{ - Index: strconv.Itoa(100000), - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.ProviderPaymentStorage(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestProviderPaymentStorageQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNProviderPaymentStorage(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllProviderPaymentStorageRequest { - return &types.QueryAllProviderPaymentStorageRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.ProviderPaymentStorageAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.ProviderPaymentStorage), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.ProviderPaymentStorageAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.ProviderPaymentStorage), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.ProviderPaymentStorageAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.ProviderPaymentStorage), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.ProviderPaymentStorageAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/pairing/keeper/grpc_query_providers_epoch_cu.go b/x/pairing/keeper/grpc_query_providers_epoch_cu.go new file mode 100644 index 0000000000..ec34d870fc --- /dev/null +++ b/x/pairing/keeper/grpc_query_providers_epoch_cu.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + "sort" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/pairing/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ProvidersEpochCu(goCtx context.Context, req *types.QueryProvidersEpochCuRequest) (*types.QueryProvidersEpochCuResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + infoMap := map[string]uint64{} + + infos := k.GetAllProviderEpochCuStore(ctx) + for _, info := range infos { + if _, ok := infoMap[info.Provider]; !ok { + infoMap[info.Provider] = info.ProviderEpochCu.ServicedCu + } else { + infoMap[info.Provider] += info.ProviderEpochCu.ServicedCu + } + } + + info := []types.ProviderCuInfo{} + for provider, cu := range infoMap { + info = append(info, types.ProviderCuInfo{Provider: provider, Cu: cu}) + } + + sort.Slice(info, func(i, j int) bool { + return info[i].Provider < info[j].Provider + }) + + return &types.QueryProvidersEpochCuResponse{Info: info}, nil +} diff --git a/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider.go b/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider.go deleted file mode 100644 index 28a834f8f2..0000000000 --- a/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/pairing/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) UniquePaymentStorageClientProviderAll(c context.Context, req *types.QueryAllUniquePaymentStorageClientProviderRequest) (*types.QueryAllUniquePaymentStorageClientProviderResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var uniquePaymentStorageClientProviders []types.UniquePaymentStorageClientProvider - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - uniquePaymentStorageClientProviderStore := prefix.NewStore(store, types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix)) - - pageRes, err := query.Paginate(uniquePaymentStorageClientProviderStore, req.Pagination, func(key, value []byte) error { - var uniquePaymentStorageClientProvider types.UniquePaymentStorageClientProvider - if err := k.cdc.Unmarshal(value, &uniquePaymentStorageClientProvider); err != nil { - return err - } - - uniquePaymentStorageClientProviders = append(uniquePaymentStorageClientProviders, uniquePaymentStorageClientProvider) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllUniquePaymentStorageClientProviderResponse{UniquePaymentStorageClientProvider: uniquePaymentStorageClientProviders, Pagination: pageRes}, nil -} - -func (k Keeper) UniquePaymentStorageClientProvider(c context.Context, req *types.QueryGetUniquePaymentStorageClientProviderRequest) (*types.QueryGetUniquePaymentStorageClientProviderResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetUniquePaymentStorageClientProvider( - ctx, - req.Index, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetUniquePaymentStorageClientProviderResponse{UniquePaymentStorageClientProvider: val}, nil -} diff --git a/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider_test.go b/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider_test.go deleted file mode 100644 index 03b124b245..0000000000 --- a/x/pairing/keeper/grpc_query_unique_payment_storage_client_provider_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func TestUniquePaymentStorageClientProviderQuerySingle(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNUniquePaymentStorageClientProvider(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetUniquePaymentStorageClientProviderRequest - response *types.QueryGetUniquePaymentStorageClientProviderResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetUniquePaymentStorageClientProviderRequest{ - Index: msgs[0].Index, - }, - response: &types.QueryGetUniquePaymentStorageClientProviderResponse{UniquePaymentStorageClientProvider: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetUniquePaymentStorageClientProviderRequest{ - Index: msgs[1].Index, - }, - response: &types.QueryGetUniquePaymentStorageClientProviderResponse{UniquePaymentStorageClientProvider: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetUniquePaymentStorageClientProviderRequest{ - Index: strconv.Itoa(100000), - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.UniquePaymentStorageClientProvider(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestUniquePaymentStorageClientProviderQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNUniquePaymentStorageClientProvider(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllUniquePaymentStorageClientProviderRequest { - return &types.QueryAllUniquePaymentStorageClientProviderRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.UniquePaymentStorageClientProviderAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.UniquePaymentStorageClientProvider), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.UniquePaymentStorageClientProviderAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.UniquePaymentStorageClientProvider), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.UniquePaymentStorageClientProviderAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.UniquePaymentStorageClientProvider), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.UniquePaymentStorageClientProviderAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/pairing/keeper/helpers_test.go b/x/pairing/keeper/helpers_test.go index 832b7ae4b3..eb04174f9e 100644 --- a/x/pairing/keeper/helpers_test.go +++ b/x/pairing/keeper/helpers_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "strconv" "testing" "cosmossdk.io/math" @@ -138,14 +137,6 @@ func (ts *tester) setupForPayments(providersCount, clientsCount, providersToPair return ts } -func newStubRelayRequest(relaySession *pairingtypes.RelaySession) *pairingtypes.RelayRequest { - req := &pairingtypes.RelayRequest{ - RelaySession: relaySession, - RelayData: &pairingtypes.RelayPrivateData{Data: []byte("stub-data")}, - } - return req -} - // payAndVerifyBalance performs payment and then verifies the balances // (provider balance should increase and consumer should decrease) // The providerRewardPerc arg is the part of the provider reward after dedcuting @@ -254,66 +245,31 @@ func (ts *tester) payAndVerifyBalance( // verifyRelayPayments verifies relay payments saved on-chain after getting payment func (ts *tester) verifyRelayPayment(relaySession *pairingtypes.RelaySession, exists bool) { epoch := uint64(relaySession.Epoch) - // Get EpochPayment struct from current epoch and perform basic verifications - epochPayments, found, epochPaymentKey := ts.Keepers.Pairing.GetEpochPaymentsFromBlock(ts.Ctx, epoch) - if exists { - require.Equal(ts.T, true, found) - require.Equal(ts.T, epochPaymentKey, epochPayments.Index) - } else { - require.Equal(ts.T, false, found) - return - } + chainID := ts.spec.Name + cu := relaySession.CuSum + sessionID := relaySession.SessionId // note: assume a single client and a single provider, so these make sense: - _, client1Addr := ts.GetAccount(common.CONSUMER, 0) - providerAcct, _ := ts.GetAccount(common.PROVIDER, 0) - - providerPaymentStorageKey := ts.Keepers.Pairing.GetProviderPaymentStorageKey( - ts.Ctx, ts.spec.Name, epoch, providerAcct.Addr) - - // Get the providerPaymentStorage struct from epochPayments - var providerPaymentStorageFromEpochPayments pairingtypes.ProviderPaymentStorage - for _, paymentStorageKey := range epochPayments.GetProviderPaymentStorageKeys() { - if paymentStorageKey == providerPaymentStorageKey { - providerPaymentStorageFromEpochPayments, found = ts.Keepers.Pairing.GetProviderPaymentStorage(ts.Ctx, providerPaymentStorageKey) - require.True(ts.T, found) - } - } - require.NotEmpty(ts.T, providerPaymentStorageFromEpochPayments.Index) - require.Equal(ts.T, epoch, providerPaymentStorageFromEpochPayments.Epoch) + _, consumer := ts.GetAccount(common.CONSUMER, 0) + _, provider := ts.GetAccount(common.PROVIDER, 0) - project, err := ts.QueryProjectDeveloper(client1Addr) - require.Nil(ts.T, err) + project, err := ts.GetProjectForDeveloper(consumer, epoch) + require.NoError(ts.T, err) - // Get the UniquePaymentStorageClientProvider key - hexSessionID := strconv.FormatUint(relaySession.SessionId, 16) - uniquePaymentStorageClientProviderKey := ts.Keepers.Pairing.EncodeUniquePaymentKey( - ts.Ctx, project.Project.Index, providerAcct.Addr, hexSessionID, ts.spec.Name) - - // Get a uniquePaymentStorageClientProvider from providerPaymentStorageFromEpochPayments - // (note, this is one of the uniqueXXXX structs. So usedCU was calculated above with a - // function that takes into account all the structs) - var uniquePaymentStorageClientProviderFromProviderPaymentStorage pairingtypes.UniquePaymentStorageClientProvider - for _, paymentStorageKey := range providerPaymentStorageFromEpochPayments.UniquePaymentStorageClientProviderKeys { - if paymentStorageKey == uniquePaymentStorageClientProviderKey { - uniquePaymentStorageClientProviderFromProviderPaymentStorage, found = ts.Keepers.Pairing.GetUniquePaymentStorageClientProvider(ts.Ctx, paymentStorageKey) - require.True(ts.T, found) - } + found := ts.Keepers.Pairing.IsUniqueEpochSessionExists(ts.Ctx, epoch, provider, project.Index, chainID, sessionID) + require.Equal(ts.T, exists, found) + + pec, found := ts.Keepers.Pairing.GetProviderEpochCu(ts.Ctx, epoch, provider, chainID) + require.Equal(ts.T, exists, found) + if exists { + require.GreaterOrEqual(ts.T, pec.ServicedCu, cu) + } + + pcec, found := ts.Keepers.Pairing.GetProviderConsumerEpochCu(ts.Ctx, epoch, provider, project.Index, chainID) + require.Equal(ts.T, exists, found) + if exists { + require.GreaterOrEqual(ts.T, pcec.Cu, cu) } - require.NotEmpty(ts.T, uniquePaymentStorageClientProviderFromProviderPaymentStorage.Index) - require.Equal(ts.T, epoch, uniquePaymentStorageClientProviderFromProviderPaymentStorage.Block) - require.Equal(ts.T, relaySession.CuSum, uniquePaymentStorageClientProviderFromProviderPaymentStorage.UsedCU) - - // Get the providerPaymentStorage struct directly - providerPaymentStorage, found := ts.Keepers.Pairing.GetProviderPaymentStorage(ts.Ctx, providerPaymentStorageKey) - require.Equal(ts.T, true, found) - require.Equal(ts.T, uint64(relaySession.Epoch), providerPaymentStorage.Epoch) - - // Get one of the UniquePaymentStorageClientProvider struct directly - uniquePaymentStorageClientProvider, found := ts.Keepers.Pairing.GetUniquePaymentStorageClientProvider(ts.Ctx, uniquePaymentStorageClientProviderKey) - require.Equal(ts.T, true, found) - require.Equal(ts.T, epoch, uniquePaymentStorageClientProvider.Block) - require.Equal(ts.T, relaySession.CuSum, uniquePaymentStorageClientProvider.UsedCU) } func (ts *tester) newRelaySession( diff --git a/x/pairing/keeper/keeper.go b/x/pairing/keeper/keeper.go index 6329a2d8fb..ee8bce49ff 100644 --- a/x/pairing/keeper/keeper.go +++ b/x/pairing/keeper/keeper.go @@ -108,11 +108,11 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) BeginBlock(ctx sdk.Context) { if k.epochStorageKeeper.IsEpochStart(ctx) { // remove old session payments - k.RemoveOldEpochPayment(ctx) + k.RemoveOldEpochPayments(ctx) // unstake any unstaking providers k.CheckUnstakingForCommit(ctx) // unstake/jail unresponsive providers - k.UnstakeUnresponsiveProviders(ctx, + k.PunishUnresponsiveProviders(ctx, types.EPOCHS_NUM_TO_CHECK_CU_FOR_UNRESPONSIVE_PROVIDER, types.EPOCHS_NUM_TO_CHECK_FOR_COMPLAINERS) } diff --git a/x/pairing/keeper/migrations.go b/x/pairing/keeper/migrations.go new file mode 100644 index 0000000000..94c0aa7738 --- /dev/null +++ b/x/pairing/keeper/migrations.go @@ -0,0 +1,22 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + v2 "github.com/lavanet/lava/x/pairing/migrations/v2" +) + +type Migrator struct { + keeper Keeper +} + +func NewMigrator(keeper Keeper) Migrator { + return Migrator{keeper: keeper} +} + +// MigrateVersion2To3 removes all the old payment objects (to get a fresh start for the new ones) +func (m Migrator) MigrateVersion2To3(ctx sdk.Context) error { + v2.RemoveAllUniquePaymentStorageClientProvider(ctx, m.keeper.storeKey) + v2.RemoveAllProviderPaymentStorage(ctx, m.keeper.storeKey) + v2.RemoveAllEpochPayments(ctx, m.keeper.storeKey) + return nil +} diff --git a/x/pairing/keeper/msg_server_relay_payment.go b/x/pairing/keeper/msg_server_relay_payment.go index 41696c6e83..15906f8f8f 100644 --- a/x/pairing/keeper/msg_server_relay_payment.go +++ b/x/pairing/keeper/msg_server_relay_payment.go @@ -7,13 +7,13 @@ import ( "strings" "time" - "github.com/cometbft/cometbft/libs/log" sdk "github.com/cosmos/cosmos-sdk/types" commontypes "github.com/lavanet/lava/common/types" "github.com/lavanet/lava/utils" "github.com/lavanet/lava/utils/sigs" epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" "github.com/lavanet/lava/x/pairing/types" + projectstypes "github.com/lavanet/lava/x/projects/types" subscriptiontypes "github.com/lavanet/lava/x/subscription/types" ) @@ -41,7 +41,7 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen ctx := sdk.UnwrapSDKContext(goCtx) logger := k.Logger(ctx) - paymentHandler := k.NewEpochPaymentHandler(ctx) + epochCuCache := k.NewEpochCuCacheHandler(ctx) lavaChainID := ctx.BlockHeader().ChainID creator, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { @@ -144,7 +144,16 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen continue } - if paymentHandler.IsDoubleSpend(ctx, relay.SpecId, epochStart, project.Index, providerAddr, strconv.FormatUint(relay.SessionId, 16)) { + // check the epoch is within the chain's memory + if epochStart < k.epochStorageKeeper.GetEarliestEpochStart(ctx) { + utils.LavaFormatWarning("relay epoch is older than earliest epohc", fmt.Errorf("invalid relay payment request"), + utils.Attribute{Key: "relayEpoch", Value: relay.Epoch}, + utils.Attribute{Key: "epochStart", Value: epochStart}, + ) + continue + } + + if k.IsUniqueEpochSessionExists(ctx, epochStart, relay.Provider, project.Index, relay.SpecId, relay.SessionId) { utils.LavaFormatWarning("double spending detected", err, utils.Attribute{Key: "epoch", Value: epochStart}, utils.Attribute{Key: "client", Value: clientAddr.String()}, @@ -158,7 +167,7 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen // if they failed (one relay should affect all of them). From here on, every check will // fail the TX *** - totalCUInEpochForUserProvider := paymentHandler.AddEpochPayment(ctx, relay.SpecId, epochStart, project.Index, providerAddr, relay.CuSum, strconv.FormatUint(relay.SessionId, 16)) + totalCUInEpochForUserProvider := epochCuCache.AddEpochPayment(ctx, relay.SpecId, epochStart, project.Index, relay.Provider, relay.CuSum, relay.SessionId) if badgeFound { k.handleBadgeCu(ctx, badgeData, relay.Provider, relay.CuSum, newBadgeTimerExpiry) } @@ -268,13 +277,13 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen utils.LogLavaEvent(ctx, logger, types.RelayPaymentEventName, successDetails, "New Proof Of Work Was Accepted") cuAfterQos := rewardedCUDec.TruncateInt().Uint64() - err = k.chargeCuToSubscriptionAndCreditProvider(ctx, clientAddr, relay, cuAfterQos) + err = k.chargeCuToSubscriptionAndCreditProvider(ctx, project, relay, cuAfterQos) if err != nil { return nil, utils.LavaFormatError("Failed charging CU to project and subscription", err) } // update provider payment storage with complainer's CU - err = paymentHandler.updateProviderPaymentStorageWithComplainerCU(ctx, relay.UnresponsiveProviders, logger, epochStart, relay.SpecId, cuAfterQos, providers, project.Index) + err = epochCuCache.updateProvidersComplainerCU(ctx, relay.UnresponsiveProviders, epochStart, relay.SpecId, cuAfterQos, providers, project.Index) if err != nil { var reportedProviders []string for _, p := range relay.UnresponsiveProviders { @@ -317,7 +326,7 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen } utils.LogLavaEvent(ctx, logger, types.LatestBlocksReportEventName, latestBlockReports, "New LatestBlocks Report for provider") - paymentHandler.Flush() + epochCuCache.Flush() return &types.MsgRelayPaymentResponse{RejectedRelays: rejected_relays}, nil } @@ -333,86 +342,61 @@ func (k msgServer) setStakeEntryBlockReport(ctx sdk.Context, providerAddr sdk.Ac } } -func (k EpochPaymentHandler) updateProviderPaymentStorageWithComplainerCU(ctx sdk.Context, unresponsiveProviders []*types.ReportedProvider, logger log.Logger, epoch uint64, chainID string, cuSum uint64, providersToPair []epochstoragetypes.StakeEntry, projectID string) error { - // check that unresponsiveData exists - if len(unresponsiveProviders) == 0 { +func (k EpochCuCache) updateProvidersComplainerCU(ctx sdk.Context, unresponsiveProviders []*types.ReportedProvider, epoch uint64, chainID string, cu uint64, pairedProviders []epochstoragetypes.StakeEntry, project string) error { + // check that unresponsiveData exists and that the paired providers list is larger than 1 + if len(unresponsiveProviders) == 0 || len(pairedProviders) <= 1 { return nil } - // check that servicersToPair is bigger than 1 - if len(providersToPair) <= 1 { - return nil - } - - // the added complainer CU takes into account the number of providers the client complained on and the number - complainerCuToAdd := cuSum / (uint64(len(unresponsiveProviders)) * uint64(len(providersToPair)-1)) + // the added complainer CU takes into account the number of providers the client complained on and the number of paired providers + complainerCuToAdd := cu / (uint64(len(unresponsiveProviders)) * uint64(len(pairedProviders)-1)) - // iterate over the unresponsive providers list and update their complainers_total_cu + // iterate over the unresponsive providers list and update their complainers total cu for _, unresponsiveProvider := range unresponsiveProviders { - // get provider address - sdkUnresponsiveProviderAddress, err := sdk.AccAddressFromBech32(unresponsiveProvider.GetAddress()) - if err != nil { // if bad data was given, we cant parse it so we ignote it and continue this protects from spamming wrong information. - utils.LavaFormatError("unable to sdk.AccAddressFromBech32(unresponsive_provider)", err, utils.Attribute{Key: "unresponsive_provider_address", Value: unresponsiveProvider}) - continue - } - found := false - for _, provider := range providersToPair { + for _, provider := range pairedProviders { if provider.Address == unresponsiveProvider.Address { found = true break } } if !found { - utils.LavaFormatError("reported provider that is not in the pairing list of the client", err, utils.Attribute{Key: "unresponsive_provider_address", Value: unresponsiveProvider}) - continue - } - - // get this epoch's epochPayments object - epochPayments, found := k.GetEpochPaymentsCached(ctx, epochPaymentKey(epoch)) - if !found { - // the epochPayments object should exist since we already paid. if not found, print an error and continue - utils.LavaFormatError("did not find epochPayments object", err, utils.Attribute{Key: "epochPaymentsKey", Value: epoch}) + utils.LavaFormatError("reported provider that is not in the pairing list of the client", + fmt.Errorf("cannot update unresponsive provider complainer CU"), + utils.Attribute{Key: "unresponsive_provider", Value: unresponsiveProvider}, + ) continue } - // get the providerPaymentStorage object using the providerStorageKey - providerStorageKey := k.GetProviderPaymentStorageKey(ctx, chainID, epoch, sdkUnresponsiveProviderAddress) - providerPaymentStorage, found := k.GetProviderPaymentStorageCached(ctx, providerStorageKey) + pec, found := k.GetProviderEpochComplainerCuCached(ctx, epoch, unresponsiveProvider.Address, chainID) if !found { - // providerPaymentStorage not found (this provider has no payments in this epoch and also no complaints) -> we need to add one complaint - providerPaymentStorage = types.ProviderPaymentStorage{ - Index: providerStorageKey, - UniquePaymentStorageClientProviderKeys: []string{}, - Epoch: epoch, - ComplainersTotalCu: uint64(0), - } - - // append the providerPaymentStorage to the epochPayments object's providerPaymentStorages - epochPayments.ProviderPaymentStorageKeys = append(epochPayments.GetProviderPaymentStorageKeys(), providerPaymentStorage.GetIndex()) - k.SetEpochPaymentsCached(ctx, epochPayments) + pec = types.ProviderEpochComplainerCu{ComplainersCu: complainerCuToAdd} + } else { + pec.ComplainersCu += complainerCuToAdd } + k.SetProviderEpochComplainerCuCached(ctx, epoch, unresponsiveProvider.Address, chainID, pec) - // add complainer's used CU to providerPaymentStorage - providerPaymentStorage.ComplainersTotalCu += complainerCuToAdd timestamp := time.Unix(unresponsiveProvider.TimestampS, 0) - utils.LogLavaEvent(ctx, logger, types.ProviderReportedEventName, map[string]string{"provider": unresponsiveProvider.GetAddress(), "timestamp": timestamp.Format(time.DateTime), "disconnections": strconv.FormatUint(unresponsiveProvider.GetDisconnections(), 10), "errors": strconv.FormatUint(unresponsiveProvider.GetErrors(), 10), "project": projectID, "cu": strconv.FormatUint(complainerCuToAdd, 10), "epoch": strconv.FormatUint(epoch, 10), "total_complaint_this_epoch": strconv.FormatUint(providerPaymentStorage.ComplainersTotalCu, 10)}, "provider got reported by consumer") - // set the final provider payment storage state including the complaints - k.SetProviderPaymentStorageCached(ctx, providerPaymentStorage) + details := map[string]string{ + "provider": unresponsiveProvider.Address, + "timestamp": timestamp.Format(time.DateTime), + "disconnections": strconv.FormatUint(unresponsiveProvider.GetDisconnections(), 10), + "errors": strconv.FormatUint(unresponsiveProvider.GetErrors(), 10), + "project": project, + "cu": strconv.FormatUint(complainerCuToAdd, 10), + "epoch": strconv.FormatUint(epoch, 10), + "total_complaint_this_epoch": strconv.FormatUint(pec.ComplainersCu, 10), + } + utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderReportedEventName, details, "provider got reported by consumer") } return nil } -func (k Keeper) chargeCuToSubscriptionAndCreditProvider(ctx sdk.Context, clientAddr sdk.AccAddress, relay *types.RelaySession, cuAfterQos uint64) error { +func (k Keeper) chargeCuToSubscriptionAndCreditProvider(ctx sdk.Context, project projectstypes.Project, relay *types.RelaySession, cuAfterQos uint64) error { epoch := uint64(relay.Epoch) - project, err := k.projectsKeeper.GetProjectForDeveloper(ctx, clientAddr.String(), epoch) - if err != nil { - return fmt.Errorf("failed to get project for client") - } - - err = k.projectsKeeper.ChargeComputeUnitsToProject(ctx, project, epoch, relay.CuSum) + err := k.projectsKeeper.ChargeComputeUnitsToProject(ctx, project, epoch, relay.CuSum) if err != nil { return fmt.Errorf("failed to add CU to the project") } diff --git a/x/pairing/keeper/msg_server_relay_payment_test.go b/x/pairing/keeper/msg_server_relay_payment_test.go index 4d475ca14f..906bdf533d 100644 --- a/x/pairing/keeper/msg_server_relay_payment_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_test.go @@ -447,13 +447,15 @@ func TestRelayPaymentQoS(t *testing.T) { func TestEpochPaymentDeletion(t *testing.T) { ts := newTester(t) - ts.setupForPayments(1, 1, 0) // 1 provider, 1 client, default providers-to-pair + ts.setupForPayments(2, 1, 0) // 1 provider, 1 client, default providers-to-pair client1Acct, _ := ts.GetAccount(common.CONSUMER, 0) providerAcct, providerAddr := ts.GetAccount(common.PROVIDER, 0) + _, unresponsiveprovider := ts.GetAccount(common.PROVIDER, 1) cuSum := ts.spec.ApiCollections[0].Apis[0].ComputeUnits * 10 relaySession := ts.newRelaySession(providerAddr, 0, cuSum, ts.BlockHeight(), 0) + relaySession.UnresponsiveProviders = []*types.ReportedProvider{{Address: unresponsiveprovider, Disconnections: 5, Errors: 2}} sig, err := sigs.Sign(client1Acct.SK, *relaySession) relaySession.Sig = sig require.NoError(t, err) @@ -467,9 +469,17 @@ func TestEpochPaymentDeletion(t *testing.T) { ts.AdvanceEpochs(ts.EpochsToSave() + 1) - res, err := ts.QueryPairingListEpochPayments() - require.NoError(t, err) - require.Equal(t, 0, len(res.EpochPayments)) + listA := ts.Keepers.Pairing.GetAllUniqueEpochSessionStore(ts.Ctx) + require.Len(t, listA, 0) + + list0 := ts.Keepers.Pairing.GetAllProviderEpochCuStore(ts.Ctx) + require.Len(t, list0, 0) + + list1 := ts.Keepers.Pairing.GetAllProviderEpochComplainerCuStore(ts.Ctx) + require.Len(t, list1, 0) + + list2 := ts.Keepers.Pairing.GetAllProviderConsumerEpochCuStore(ts.Ctx) + require.Len(t, list2, 0) } // Test that after the consumer uses some CU it's updated in its project and subscription @@ -992,17 +1002,14 @@ func TestPairingCaching(t *testing.T) { require.NoError(t, err) } - epochPayment, found, _ := ts.Keepers.Pairing.GetEpochPaymentsFromBlock(ts.Ctx, ts.EpochStart()) - require.True(t, found) - require.Len(t, epochPayment.ProviderPaymentStorageKeys, 3) + pecs := ts.Keepers.Pairing.GetAllProviderEpochCuStore(ts.Ctx) + require.Len(t, pecs, 3) - UniquePayments := ts.Keepers.Pairing.GetAllUniquePaymentStorageClientProvider(ts.Ctx) + UniquePayments := ts.Keepers.Pairing.GetAllUniqueEpochSessionStore(ts.Ctx) require.Len(t, UniquePayments, 3*3*50) - storages := ts.Keepers.Pairing.GetAllProviderPaymentStorage(ts.Ctx) - for _, storage := range storages { - require.Len(t, storage.UniquePaymentStorageClientProviderKeys, 3*50) - } + storages := ts.Keepers.Pairing.GetAllProviderConsumerEpochCuStore(ts.Ctx) + require.Len(t, storages, 3*3) for i := 0; i < 3; i++ { consumerAcct, _ := ts.GetAccount(common.CONSUMER, i) diff --git a/x/pairing/keeper/provider_payment_storage.go b/x/pairing/keeper/provider_payment_storage.go deleted file mode 100644 index 45a1588ae4..0000000000 --- a/x/pairing/keeper/provider_payment_storage.go +++ /dev/null @@ -1,152 +0,0 @@ -package keeper - -import ( - "fmt" - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" -) - -// SetProviderPaymentStorage set a specific providerPaymentStorage in the store from its index -func (k Keeper) SetProviderPaymentStorage(ctx sdk.Context, providerPaymentStorage types.ProviderPaymentStorage) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix)) - b := k.cdc.MustMarshal(&providerPaymentStorage) - store.Set(types.ProviderPaymentStorageKey( - providerPaymentStorage.Index, - ), b) -} - -// GetProviderPaymentStorage returns a providerPaymentStorage from its index -func (k Keeper) GetProviderPaymentStorage( - ctx sdk.Context, - index string, -) (val types.ProviderPaymentStorage, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix)) - - b := store.Get(types.ProviderPaymentStorageKey( - index, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -func (k EpochPaymentHandler) SetProviderPaymentStorageCached(ctx sdk.Context, providerPaymentStorage types.ProviderPaymentStorage) { - b := k.cdc.MustMarshal(&providerPaymentStorage) - k.ProviderPaymentStorageCache.Set(types.ProviderPaymentStorageKey(providerPaymentStorage.Index), b) -} - -func (k EpochPaymentHandler) GetProviderPaymentStorageCached( - ctx sdk.Context, - index string, -) (val types.ProviderPaymentStorage, found bool) { - b := k.ProviderPaymentStorageCache.Get(types.ProviderPaymentStorageKey(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveProviderPaymentStorage removes a providerPaymentStorage from the store -func (k Keeper) RemoveProviderPaymentStorage( - ctx sdk.Context, - index string, -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix)) - store.Delete(types.ProviderPaymentStorageKey( - index, - )) -} - -// GetAllProviderPaymentStorage returns all providerPaymentStorage -func (k Keeper) GetAllProviderPaymentStorage(ctx sdk.Context) (list []types.ProviderPaymentStorage) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProviderPaymentStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ProviderPaymentStorage - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k Keeper) GetProviderFromProviderPaymentStorage(providerPaymentStorage *types.ProviderPaymentStorage) (string, error) { - index := providerPaymentStorage.Index - // index consists of chain_epoch_providerAddress - lastIndex := strings.LastIndex(index, "_") - if lastIndex != -1 { - return index[lastIndex+1:], nil - } - return "", fmt.Errorf("invalid provider payment storage key %s", index) -} - -// Function to get a providerPaymentStorage object's key (key is chainID_epoch_providerAddress, epoch in hex representation) -func (k Keeper) GetProviderPaymentStorageKey(ctx sdk.Context, chainID string, epoch uint64, providerAddress sdk.AccAddress) string { - return chainID + "_" + strconv.FormatUint(epoch, 16) + "_" + providerAddress.String() -} - -// Function to add a payment (which is represented by a uniquePaymentStorageClientProvider object) to a providerPaymentStorage object -func (k EpochPaymentHandler) AddProviderPaymentInEpoch(ctx sdk.Context, chainID string, epoch uint64, projectID string, providerAddress sdk.AccAddress, usedCU uint64, uniqueIdentifier string) (userPayment *types.ProviderPaymentStorage, usedCUConsumerTotal uint64) { - // create an uniquePaymentStorageClientProvider object and set it in the KVStore - uniquePaymentStorageClientProviderEntryAddr := k.AddUniquePaymentStorageClientProvider(ctx, chainID, epoch, projectID, providerAddress, uniqueIdentifier, usedCU) - - // get the providerPaymentStorage object - providerPaymentStorageKey := k.GetProviderPaymentStorageKey(ctx, chainID, epoch, providerAddress) - userPaymentStorageInEpoch, found := k.GetProviderPaymentStorageCached(ctx, providerPaymentStorageKey) - if !found { - // is new entry -> create a new providerPaymentStorage object - userPaymentStorageInEpoch = types.ProviderPaymentStorage{Index: providerPaymentStorageKey, UniquePaymentStorageClientProviderKeys: []string{uniquePaymentStorageClientProviderEntryAddr.GetIndex()}, Epoch: epoch} - usedCUConsumerTotal = usedCU - } else { - // found the providerPaymentStorage object -> append the uniquePaymentStorageClientProvider object's key - userPaymentStorageInEpoch.UniquePaymentStorageClientProviderKeys = append(userPaymentStorageInEpoch.UniquePaymentStorageClientProviderKeys, uniquePaymentStorageClientProviderEntryAddr.GetIndex()) - - // sum up the used CU for this provider and this consumer over this epoch - usedCUConsumerTotal = k.GetTotalUsedCUForConsumerPerEpoch(ctx, projectID, userPaymentStorageInEpoch.GetUniquePaymentStorageClientProviderKeys(), providerAddress.String()) - } - - // set the providerPaymentStorage object in the KVStore - k.SetProviderPaymentStorageCached(ctx, userPaymentStorageInEpoch) - - return &userPaymentStorageInEpoch, usedCUConsumerTotal -} - -// Function to get the total serviced CU by a provider in this epoch for a specific consumer -func (k EpochPaymentHandler) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, projectID string, uniquePaymentStorageKeys []string, providerAddress string) uint64 { - usedCUProviderTotal := uint64(0) - - // go over the uniquePaymentStorageKeys - for _, uniquePaymentKey := range uniquePaymentStorageKeys { - // if the uniquePaymentStorageClientProvider object is not between the provider and the specific consumer, continue - if k.GetConsumerFromUniquePayment(uniquePaymentKey) != projectID { - continue - } - // get the uniquePaymentStorageClientProvider object - uniquePayment, found := k.GetUniquePaymentStorageClientProviderCached(ctx, uniquePaymentKey) - if !found { - k.SetUniquePaymentStorageClientProviderCached(ctx, uniquePayment) - } - if !found { - utils.LavaFormatError("could not find uniquePaymentStorageClientProvider object", fmt.Errorf("unique payment object not found"), - utils.Attribute{Key: "providerAddress", Value: providerAddress}, - utils.Attribute{Key: "projectID", Value: projectID}, - ) - continue - } - usedCUProviderTotal += uniquePayment.UsedCU - } - return usedCUProviderTotal -} diff --git a/x/pairing/keeper/provider_payment_storage_test.go b/x/pairing/keeper/provider_payment_storage_test.go deleted file mode 100644 index d8bb531410..0000000000 --- a/x/pairing/keeper/provider_payment_storage_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNProviderPaymentStorage(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ProviderPaymentStorage { - items := make([]types.ProviderPaymentStorage, n) - for i := range items { - items[i].Index = strconv.Itoa(i) - - keeper.SetProviderPaymentStorage(ctx, items[i]) - } - return items -} - -func TestProviderPaymentStorageGet(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNProviderPaymentStorage(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetProviderPaymentStorage(ctx, - item.Index, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} - -func TestProviderPaymentStorageRemove(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNProviderPaymentStorage(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveProviderPaymentStorage(ctx, - item.Index, - ) - _, found := keeper.GetProviderPaymentStorage(ctx, - item.Index, - ) - require.False(t, found) - } -} - -func TestProviderPaymentStorageGetAll(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNProviderPaymentStorage(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllProviderPaymentStorage(ctx)), - ) -} diff --git a/x/pairing/keeper/qos_excellence.go b/x/pairing/keeper/qos_excellence.go index c076b1780e..eca781c944 100644 --- a/x/pairing/keeper/qos_excellence.go +++ b/x/pairing/keeper/qos_excellence.go @@ -8,8 +8,7 @@ import ( pairingtypes "github.com/lavanet/lava/x/pairing/types" ) -func (k Keeper) UpdateProviderQos(epochPayments pairingtypes.EpochPayments) { -} +// TODO: implement UpdateProviderQos(payments) // GetQos gets a provider's QoS excellence report from the providerQosFS func (k Keeper) GetQos(ctx sdk.Context, chainID string, cluster string, provider string) (pairingtypes.QualityOfServiceReport, error) { diff --git a/x/pairing/keeper/unique_payment_storage_client_provider.go b/x/pairing/keeper/unique_payment_storage_client_provider.go deleted file mode 100644 index afd4954620..0000000000 --- a/x/pairing/keeper/unique_payment_storage_client_provider.go +++ /dev/null @@ -1,113 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" -) - -// SetUniquePaymentStorageClientProvider set a specific uniquePaymentStorageClientProvider in the store from its index -func (k Keeper) SetUniquePaymentStorageClientProvider(ctx sdk.Context, uniquePaymentStorageClientProvider types.UniquePaymentStorageClientProvider) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix)) - b := k.cdc.MustMarshal(&uniquePaymentStorageClientProvider) - store.Set(types.UniquePaymentStorageClientProviderKey( - uniquePaymentStorageClientProvider.Index, - ), b) -} - -// GetUniquePaymentStorageClientProvider returns a uniquePaymentStorageClientProvider from its index -func (k Keeper) GetUniquePaymentStorageClientProvider( - ctx sdk.Context, - index string, -) (val types.UniquePaymentStorageClientProvider, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix)) - - b := store.Get(types.UniquePaymentStorageClientProviderKey( - index, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -func (k EpochPaymentHandler) SetUniquePaymentStorageClientProviderCached(ctx sdk.Context, uniquePaymentStorageClientProvider types.UniquePaymentStorageClientProvider) { - b := k.cdc.MustMarshal(&uniquePaymentStorageClientProvider) - k.UniquePaymentStorageClientProviderCache.Set(types.ProviderPaymentStorageKey(uniquePaymentStorageClientProvider.Index), b) -} - -func (k EpochPaymentHandler) GetUniquePaymentStorageClientProviderCached( - ctx sdk.Context, - index string, -) (val types.UniquePaymentStorageClientProvider, found bool) { - b := k.UniquePaymentStorageClientProviderCache.Get(types.UniquePaymentStorageClientProviderKey(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveUniquePaymentStorageClientProvider removes a uniquePaymentStorageClientProvider from the store -func (k Keeper) RemoveUniquePaymentStorageClientProvider( - ctx sdk.Context, - index string, -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix)) - store.Delete(types.UniquePaymentStorageClientProviderKey( - index, - )) -} - -// GetAllUniquePaymentStorageClientProvider returns all uniquePaymentStorageClientProvider -func (k Keeper) GetAllUniquePaymentStorageClientProvider(ctx sdk.Context) (list []types.UniquePaymentStorageClientProvider) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.UniquePaymentStorageClientProviderKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.UniquePaymentStorageClientProvider - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k EpochPaymentHandler) AddUniquePaymentStorageClientProvider(ctx sdk.Context, chainID string, block uint64, projectID string, providerAddress sdk.AccAddress, uniqueIdentifier string, usedCU uint64) *types.UniquePaymentStorageClientProvider { - key := k.EncodeUniquePaymentKey(ctx, projectID, providerAddress, uniqueIdentifier, chainID) - entry := types.UniquePaymentStorageClientProvider{Index: key, Block: block, UsedCU: usedCU} - k.SetUniquePaymentStorageClientProviderCached(ctx, entry) - return &entry -} - -func (k EpochPaymentHandler) IsDoubleSpend(ctx sdk.Context, chainID string, block uint64, projectID string, providerAddress sdk.AccAddress, uniqueIdentifier string) bool { - key := k.EncodeUniquePaymentKey(ctx, projectID, providerAddress, uniqueIdentifier, chainID) - _, found := k.GetUniquePaymentStorageClientProviderCached(ctx, key) - return found -} - -func (k Keeper) GetConsumerFromUniquePayment(uniquePaymentStorageClientProvider string) string { - key := uniquePaymentStorageClientProvider - providerAdrLengh := charToAsciiNumber(rune(key[0])) - provider := key[1 : providerAdrLengh+1] - return provider -} - -func (k Keeper) EncodeUniquePaymentKey(ctx sdk.Context, projectID string, providerAddress sdk.AccAddress, uniqueIdentifier, chainID string) string { - leadingChar := asciiNumberToChar(len(projectID)) - key := string(leadingChar) + projectID + providerAddress.String() + uniqueIdentifier + chainID - return key -} - -func charToAsciiNumber(char rune) int { - return int(char) -} - -func asciiNumberToChar(asciiNum int) rune { - return rune(asciiNum) -} diff --git a/x/pairing/keeper/unique_payment_storage_client_provider_test.go b/x/pairing/keeper/unique_payment_storage_client_provider_test.go deleted file mode 100644 index 7f0edbe276..0000000000 --- a/x/pairing/keeper/unique_payment_storage_client_provider_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNUniquePaymentStorageClientProvider(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.UniquePaymentStorageClientProvider { - items := make([]types.UniquePaymentStorageClientProvider, n) - for i := range items { - items[i].Index = strconv.Itoa(i) - - keeper.SetUniquePaymentStorageClientProvider(ctx, items[i]) - } - return items -} - -func TestUniquePaymentStorageClientProviderGet(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNUniquePaymentStorageClientProvider(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetUniquePaymentStorageClientProvider(ctx, - item.Index, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} - -func TestUniquePaymentStorageClientProviderRemove(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNUniquePaymentStorageClientProvider(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveUniquePaymentStorageClientProvider(ctx, - item.Index, - ) - _, found := keeper.GetUniquePaymentStorageClientProvider(ctx, - item.Index, - ) - require.False(t, found) - } -} - -func TestUniquePaymentStorageClientProviderGetAll(t *testing.T) { - keeper, ctx := keepertest.PairingKeeper(t) - items := createNUniquePaymentStorageClientProvider(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllUniquePaymentStorageClientProvider(ctx)), - ) -} diff --git a/x/pairing/keeper/unresponsive_provider.go b/x/pairing/keeper/unresponsive_provider.go index bb7fa00600..b0ca9f6448 100644 --- a/x/pairing/keeper/unresponsive_provider.go +++ b/x/pairing/keeper/unresponsive_provider.go @@ -4,6 +4,7 @@ import ( "fmt" "math" "strconv" + "strings" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/utils" @@ -13,8 +14,8 @@ import ( const THRESHOLD_FACTOR = 4 -// Function that returns a map that links between a provider that should be punished and its providerCuCounterForUnreponsiveness -func (k Keeper) UnstakeUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers uint64) { +// PunishUnresponsiveProviders punished unresponsive providers (current punishment: freeze) +func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers uint64) { // check the epochsNum consts if epochsNumToCheckCUForComplainers <= 0 || epochsNumToCheckCUForUnresponsiveProvider <= 0 { utils.LavaFormatError("epoch to check CU for unresponsive provider or for complainer is zero", @@ -71,44 +72,75 @@ func (k Keeper) UnstakeUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCU } } + ProviderChainID := func(provider, chainID string) string { + return provider + " " + chainID + } + // check all supported providers from all geolocations prior to making decisions existingProviders := map[string]uint64{} + stakeAppliedBlockProviders := map[string]uint64{} for _, providerStakeStorage := range providerStakeStorageList { providerStakeEntriesForChain := providerStakeStorage.GetStakeEntries() // count providers per geolocation for _, providerStakeEntry := range providerStakeEntriesForChain { if !providerStakeEntry.IsFrozen() { existingProviders[providerStakeEntry.GetChain()]++ + stakeAppliedBlockProviders[ProviderChainID(providerStakeEntry.Address, providerStakeEntry.Chain)] = providerStakeEntry.StakeAppliedBlock } } } - // Go over the staked provider entries (on all chains) - for _, providerStakeStorage := range providerStakeStorageList { - providerStakeEntriesForChain := providerStakeStorage.GetStakeEntries() - for _, providerStakeEntry := range providerStakeEntriesForChain { - if minHistoryBlock < providerStakeEntry.StakeAppliedBlock { - // this staked provider has too short history (either since staking - // or since it was last unfrozen) - do not consider for jailing - continue - } - // update the CU count for this provider in providerCuCounterForUnreponsivenessMap - providerPaymentStorageKeyList, complaintCU, servicedCU, err := k.countCuForUnresponsiveness(ctx, minPaymentBlock, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers, providerStakeEntry) - if err != nil { - utils.LavaFormatError("unstake unresponsive providers failed to count CU", err, - utils.Attribute{Key: "provider", Value: providerStakeEntry.Address}, + + // Go over the staked provider entries (on all chains) that has complaints + // build a map that has all the relevant details: provider address, chain, epoch and ProviderEpochCu object + keys := []string{} + pecsDetailed := k.GetAllProviderEpochComplainerCuStore(ctx) + complainedProviders := map[string]map[uint64]types.ProviderEpochComplainerCu{} // map[provider chainID]map[epoch]ProviderEpochComplainerCu + for _, pec := range pecsDetailed { + if minHistoryBlock < stakeAppliedBlockProviders[pec.Provider] { + // this staked provider has too short history (either since staking + // or since it was last unfrozen) - do not consider for jailing + continue + } + + key := ProviderChainID(pec.Provider, pec.ChainId) + + if _, ok := complainedProviders[key]; !ok { + complainedProviders[key] = map[uint64]types.ProviderEpochComplainerCu{pec.Epoch: pec.ProviderEpochComplainerCu} + keys = append(keys, key) + } else { + if _, ok := complainedProviders[key][pec.Epoch]; !ok { + complainedProviders[key][pec.Epoch] = pec.ProviderEpochComplainerCu + } else { + utils.LavaFormatError("duplicate ProviderEpochCu key", fmt.Errorf("did not aggregate complainers CU"), + utils.LogAttr("key", types.ProviderEpochCuKey(pec.Epoch, pec.Provider, pec.ChainId)), ) continue } + } + } - // providerPaymentStorageKeyList is not empty -> provider should be punished - if len(providerPaymentStorageKeyList) != 0 && existingProviders[providerStakeEntry.GetChain()] > minProviders { - err = k.punishUnresponsiveProvider(ctx, providerPaymentStorageKeyList, providerStakeEntry.GetAddress(), providerStakeEntry.GetChain(), complaintCU, servicedCU) - existingProviders[providerStakeEntry.GetChain()]-- - if err != nil { - utils.LavaFormatError("unstake unresponsive providers failed to punish provider", err, - utils.Attribute{Key: "provider", Value: providerStakeEntry.Address}, - ) - } + // go over all the providers, count the complainers CU and punish providers + for _, key := range keys { + components := strings.Split(key, " ") + provider := components[0] + chainID := components[1] + // update the CU count for this provider in providerCuCounterForUnreponsivenessMap + epochs, complaintCU, servicedCU, err := k.countCuForUnresponsiveness(ctx, provider, chainID, minPaymentBlock, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers, complainedProviders[key]) + if err != nil { + utils.LavaFormatError("unstake unresponsive providers failed to count CU", err, + utils.Attribute{Key: "provider", Value: provider}, + ) + continue + } + + // providerPaymentStorageKeyList is not empty -> provider should be punished + if len(epochs) != 0 && existingProviders[chainID] > minProviders { + err = k.punishUnresponsiveProvider(ctx, epochs, provider, chainID, complaintCU, servicedCU, complainedProviders[key]) + existingProviders[chainID]-- + if err != nil { + utils.LavaFormatError("unstake unresponsive providers failed to punish provider", err, + utils.Attribute{Key: "provider", Value: provider}, + ) } } } @@ -127,69 +159,51 @@ func (k Keeper) getBlockEpochsAgo(ctx sdk.Context, blockHeight, numEpochs uint64 return blockHeight, nil } -// Function to count the CU serviced by the unresponsive provider and the CU of the complainers. The function returns a list of the found providerPaymentStorageKey -func (k Keeper) countCuForUnresponsiveness(ctx sdk.Context, epoch, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers uint64, providerStakeEntry epochstoragetypes.StakeEntry) (keysToResetIfJail []string, complaints uint64, servicedCU uint64, errRet error) { - epochTemp := epoch - providerServicedCu := uint64(0) - complainersCu := uint64(0) - providerPaymentStorageKeyList := []string{} - - // get the provider's SDK account address - sdkStakeEntryProviderAddress, err := sdk.AccAddressFromBech32(providerStakeEntry.GetAddress()) - if err != nil { - return nil, 0, 0, utils.LavaFormatError("unable to sdk.AccAddressFromBech32(provider)", err, utils.Attribute{Key: "provider_address", Value: providerStakeEntry.Address}) - } - - // check which of the consts is larger - largerEpochsNumConst := epochsNumToCheckCUForComplainers +// Function to count the CU serviced by the unresponsive provider and the CU of the complainers. The function returns the keys of the objects containing complainer CU +func (k Keeper) countCuForUnresponsiveness(ctx sdk.Context, provider, chainId string, epoch, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers uint64, providerEpochCuMap map[uint64]types.ProviderEpochComplainerCu) (epochs []uint64, complainersCu uint64, servicedCu uint64, errRet error) { + // check which of the epoch consts is larger + max := epochsNumToCheckCUForComplainers if epochsNumToCheckCUForUnresponsiveProvider > epochsNumToCheckCUForComplainers { - largerEpochsNumConst = epochsNumToCheckCUForUnresponsiveProvider + max = epochsNumToCheckCUForUnresponsiveProvider } // count the CU serviced by the unersponsive provider and used CU of the complainers - for counter := uint64(0); counter < largerEpochsNumConst; counter++ { - // get providerPaymentStorageKey for epochTemp (other traits from the stake entry) - providerPaymentStorageKey := k.GetProviderPaymentStorageKey(ctx, providerStakeEntry.GetChain(), epochTemp, sdkStakeEntryProviderAddress) + for counter := uint64(0); counter < max; counter++ { + pec, ok := providerEpochCuMap[epoch] + if ok { + // counter is smaller than epochsNumToCheckCUForComplainers -> count complainer CU + if counter < epochsNumToCheckCUForComplainers { + complainersCu += pec.ComplainersCu + epochs = append(epochs, epoch) + } - // try getting providerPaymentStorage using the providerPaymentStorageKey - providerPaymentStorage, found := k.GetProviderPaymentStorage(ctx, providerPaymentStorageKey) - if found { // counter is smaller than epochsNumToCheckCUForUnresponsiveProvider -> count CU serviced by the provider in the epoch if counter < epochsNumToCheckCUForUnresponsiveProvider { - // count the CU by iterating through the uniquePaymentStorageClientProvider objects - for _, uniquePaymentKey := range providerPaymentStorage.GetUniquePaymentStorageClientProviderKeys() { - uniquePayment, _ := k.GetUniquePaymentStorageClientProvider(ctx, uniquePaymentKey) - providerServicedCu += uniquePayment.GetUsedCU() + pec, found := k.GetProviderEpochCu(ctx, epoch, provider, chainId) + if found { + servicedCu += pec.ServicedCu } } - - // counter is smaller than epochsNumToCheckCUForComplainers -> count complainer CU - if counter < epochsNumToCheckCUForComplainers { - // update complainersCu - complainersCu += providerPaymentStorage.ComplainersTotalCu - } - - // save the providerPaymentStorageKey in the providerPaymentStorageKeyList - providerPaymentStorageKeyList = append(providerPaymentStorageKeyList, providerPaymentStorageKey) } // Get previous epoch (from epochTemp) - previousEpoch, err := k.epochStorageKeeper.GetPreviousEpochStartForBlock(ctx, epochTemp) + previousEpoch, err := k.epochStorageKeeper.GetPreviousEpochStartForBlock(ctx, epoch) if err != nil { return nil, 0, 0, utils.LavaFormatWarning("couldn't get previous epoch", err, utils.Attribute{Key: "epoch", Value: epoch}, ) } - // update epochTemp - epochTemp = previousEpoch + // update epoch + epoch = previousEpoch } - // the complainers' CU is larger than the provider serviced CU -> should be punished (return providerPaymentStorageKeyList so the complainers' CU can be reset after the punishment) - if complainersCu > THRESHOLD_FACTOR*providerServicedCu { - return providerPaymentStorageKeyList, complainersCu, providerServicedCu, nil + // the complainers' CU is larger than the provider serviced CU -> should be punished + // epochs list is returned so the complainers' CU can be reset + if complainersCu > THRESHOLD_FACTOR*servicedCu { + return epochs, complainersCu, servicedCu, nil } - return nil, complainersCu, providerServicedCu, nil + return nil, complainersCu, servicedCu, nil } // Function that return the current stake storage for all chains @@ -212,35 +226,40 @@ func (k Keeper) getCurrentProviderStakeStorageList(ctx sdk.Context) []epochstora } // Function that punishes providers. Current punishment is freeze -func (k Keeper) punishUnresponsiveProvider(ctx sdk.Context, providerPaymentStorageKeyList []string, providerAddress, chainID string, complaintCU uint64, servicedCU uint64) error { +func (k Keeper) punishUnresponsiveProvider(ctx sdk.Context, epochs []uint64, provider, chainID string, complaintCU uint64, servicedCU uint64, providerEpochCuMap map[uint64]types.ProviderEpochComplainerCu) error { // freeze the unresponsive provider - err := k.FreezeProvider(ctx, providerAddress, []string{chainID}, "unresponsiveness") + err := k.FreezeProvider(ctx, provider, []string{chainID}, "unresponsiveness") if err != nil { utils.LavaFormatError("unable to freeze provider entry due to unresponsiveness", err, - utils.Attribute{Key: "provider", Value: providerAddress}, + utils.Attribute{Key: "provider", Value: provider}, utils.Attribute{Key: "chainID", Value: chainID}, ) } - utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderJailedEventName, map[string]string{"provider_address": providerAddress, "chain_id": chainID, "complaint_cu": strconv.FormatUint(complaintCU, 10), "serviced_cu": strconv.FormatUint(servicedCU, 10)}, "Unresponsive provider was freezed due to unresponsiveness") + utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderJailedEventName, + map[string]string{ + "provider_address": provider, + "chain_id": chainID, + "complaint_cu": strconv.FormatUint(complaintCU, 10), + "serviced_cu": strconv.FormatUint(servicedCU, 10), + }, + "Unresponsive provider was freezed due to unresponsiveness") // reset the provider's complainer CU (so he won't get punished for the same complaints twice) - k.resetComplainersCU(ctx, providerPaymentStorageKeyList) + k.resetComplainersCU(ctx, epochs, provider, chainID, providerEpochCuMap) return nil } -// Function that reset the complainer CU of providerPaymentStorage objects that can be accessed using providerPaymentStorageIndexList -func (k Keeper) resetComplainersCU(ctx sdk.Context, providerPaymentStorageIndexList []string) { - // go over the providerPaymentStorageIndexList - for _, providerPaymentStorageIndex := range providerPaymentStorageIndexList { - // get providerPaymentStorage using its index - providerPaymentStorage, found := k.GetProviderPaymentStorage(ctx, providerPaymentStorageIndex) - if !found { +// resetComplainersCU resets the complainers CU for a specific provider and chain +func (k Keeper) resetComplainersCU(ctx sdk.Context, epochs []uint64, provider string, chainID string, providerEpochCuMap map[uint64]types.ProviderEpochComplainerCu) { + for _, epoch := range epochs { + pec, ok := providerEpochCuMap[epoch] + if !ok { continue } // reset the complainer CU - providerPaymentStorage.ComplainersTotalCu = 0 - k.SetProviderPaymentStorage(ctx, providerPaymentStorage) + pec.ComplainersCu = 0 + k.SetProviderEpochComplainerCu(ctx, epoch, provider, chainID, pec) } } diff --git a/x/pairing/keeper/unresponsive_provider_test.go b/x/pairing/keeper/unresponsive_provider_test.go index 08469d8cb8..ad50c903c4 100644 --- a/x/pairing/keeper/unresponsive_provider_test.go +++ b/x/pairing/keeper/unresponsive_provider_test.go @@ -23,13 +23,12 @@ func (ts *tester) checkProviderFreeze(provider sdk.AccAddress, shouldFreeze bool } } -func (ts *tester) checkComplainerReset(provider sdk.AccAddress, epoch uint64) { +func (ts *tester) checkComplainerReset(provider string, epoch uint64) { // validate the complainers CU field in the unresponsive provider's providerPaymentStorage // was reset after being punished (use the epoch from the relay - when it got reported) - providerPaymentStorageKey := ts.Keepers.Pairing.GetProviderPaymentStorageKey(ts.Ctx, ts.spec.Name, epoch, provider) - providerPaymentStorage, found := ts.Keepers.Pairing.GetProviderPaymentStorage(ts.Ctx, providerPaymentStorageKey) + pec, found := ts.Keepers.Pairing.GetProviderEpochComplainerCu(ts.Ctx, epoch, provider, ts.spec.Name) require.Equal(ts.T, true, found) - require.Equal(ts.T, uint64(0), providerPaymentStorage.ComplainersTotalCu) + require.Equal(ts.T, uint64(0), pec.ComplainersCu) } func (ts *tester) checkProviderStaked(provider sdk.AccAddress) { @@ -124,7 +123,7 @@ func TestUnresponsivenessStressTest(t *testing.T) { for i := 0; i < unresponsiveCount; i++ { ts.checkProviderFreeze(providers[i].Addr, true) - ts.checkComplainerReset(providers[i].Addr, relayEpoch) + ts.checkComplainerReset(providers[i].Addr.String(), relayEpoch) } for i := unresponsiveCount; i < providersCount; i++ { @@ -189,7 +188,7 @@ func TestFreezingProviderForUnresponsiveness(t *testing.T) { ts.AdvanceEpochs(largerConst) ts.checkProviderFreeze(provider1_addr, true) - ts.checkComplainerReset(provider1_addr, relayEpoch) + ts.checkComplainerReset(provider1_addr.String(), relayEpoch) ts.checkProviderStaked(provider0_addr) } @@ -246,7 +245,7 @@ func TestFreezingProviderForUnresponsivenessContinueComplainingAfterFreeze(t *te ts.AdvanceEpochs(largerConst) ts.checkProviderFreeze(provider1_addr, true) - ts.checkComplainerReset(provider1_addr, relayEpoch) + ts.checkComplainerReset(provider1_addr.String(), relayEpoch) ts.AdvanceEpochs(2) diff --git a/x/pairing/migrations/v2/epoch_payments.go b/x/pairing/migrations/v2/epoch_payments.go new file mode 100644 index 0000000000..1cdbe3aa3e --- /dev/null +++ b/x/pairing/migrations/v2/epoch_payments.go @@ -0,0 +1,44 @@ +package v2 + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/pairing/types" +) + +// RemoveAllEpochPayments removes all epochPayments +func RemoveAllEpochPayments(ctx sdk.Context, storeKey storetypes.StoreKey) { + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(EpochPaymentsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// RemoveAllProviderPaymentStorage removes all providerPaymentStorage +func RemoveAllProviderPaymentStorage(ctx sdk.Context, storeKey storetypes.StoreKey) { + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(ProviderPaymentStorageKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// RemoveAllUniquePaymentStorageClientProvider removes all uniquePaymentStorageClientProvider +func RemoveAllUniquePaymentStorageClientProvider(ctx sdk.Context, storeKey storetypes.StoreKey) { + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(UniquePaymentStorageClientProviderKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} diff --git a/x/pairing/types/epoch_payments.pb.go b/x/pairing/migrations/v2/epoch_payments.pb.go similarity index 99% rename from x/pairing/types/epoch_payments.pb.go rename to x/pairing/migrations/v2/epoch_payments.pb.go index 3c3c694977..c53188037b 100644 --- a/x/pairing/types/epoch_payments.pb.go +++ b/x/pairing/migrations/v2/epoch_payments.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lavanet/lava/pairing/epoch_payments.proto -package types +package v2 import ( fmt "fmt" diff --git a/x/pairing/migrations/v2/keys.go b/x/pairing/migrations/v2/keys.go new file mode 100644 index 0000000000..84916e7076 --- /dev/null +++ b/x/pairing/migrations/v2/keys.go @@ -0,0 +1,50 @@ +package v2 + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // EpochPaymentsKeyPrefix is the prefix to retrieve all EpochPayments + EpochPaymentsKeyPrefix = "EpochPayments/value/" + ProviderPaymentStorageKeyPrefix = "ProviderPaymentStorage/value/" + UniquePaymentStorageClientProviderKeyPrefix = "UniquePaymentStorageClientProvider/value/" +) + +// EpochPaymentsKey returns the store key to retrieve a EpochPayments from the index fields +func EpochPaymentsKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} + +// ProviderPaymentStorageKey returns the store key to retrieve a ProviderPaymentStorage from the index fields +func ProviderPaymentStorageKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} + +func UniquePaymentStorageClientProviderKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/pairing/types/provider_payment_storage.pb.go b/x/pairing/migrations/v2/provider_payment_storage.pb.go similarity index 99% rename from x/pairing/types/provider_payment_storage.pb.go rename to x/pairing/migrations/v2/provider_payment_storage.pb.go index add25081f9..f95162e411 100644 --- a/x/pairing/types/provider_payment_storage.pb.go +++ b/x/pairing/migrations/v2/provider_payment_storage.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lavanet/lava/pairing/provider_payment_storage.proto -package types +package v2 import ( fmt "fmt" diff --git a/x/pairing/types/unique_payment_storage_client_provider.pb.go b/x/pairing/migrations/v2/unique_payment_storage_client_provider.pb.go similarity index 99% rename from x/pairing/types/unique_payment_storage_client_provider.pb.go rename to x/pairing/migrations/v2/unique_payment_storage_client_provider.pb.go index 93a35419f7..f55112e0ec 100644 --- a/x/pairing/types/unique_payment_storage_client_provider.pb.go +++ b/x/pairing/migrations/v2/unique_payment_storage_client_provider.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lavanet/lava/pairing/unique_payment_storage_client_provider.proto -package types +package v2 import ( fmt "fmt" diff --git a/x/pairing/module.go b/x/pairing/module.go index 438fcee204..b17698238e 100644 --- a/x/pairing/module.go +++ b/x/pairing/module.go @@ -127,6 +127,12 @@ func (am AppModule) Name() string { func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + + migrator := keeper.NewMigrator(am.keeper) + // register v2 -> v3 migration + if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.MigrateVersion2To3); err != nil { + panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) + } } // RegisterInvariants registers the capability module's invariants. @@ -151,7 +157,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { diff --git a/x/pairing/types/epoch_cu.go b/x/pairing/types/epoch_cu.go new file mode 100644 index 0000000000..48cae050c6 --- /dev/null +++ b/x/pairing/types/epoch_cu.go @@ -0,0 +1,84 @@ +package types + +import ( + "encoding/binary" + "fmt" + "strconv" + "strings" +) + +const ( + UniqueEpochSessionPrefix = "UniqueEpochSession/" + ProviderEpochCuPrefix = "ProviderEpochCu/" + ProviderEpochComplainerCuPrefix = "ProviderEpochComplainerCu/" + ProviderConsumerEpochCuPrefix = "ProviderConsumerEpochCu/" +) + +func EncodeBlock(block uint64) []byte { + encodedKey := make([]byte, 8) + binary.BigEndian.PutUint64(encodedKey[0:8], block) + return encodedKey +} + +func DecodeBlock(encodedKey []byte) uint64 { + return binary.BigEndian.Uint64(encodedKey[0:8]) +} + +func UniqueEpochSessionKey(epoch uint64, provider string, chainID string, project string, sessionID uint64) []byte { + return []byte(strings.Join([]string{string(EncodeBlock(epoch)), provider, chainID, project, strconv.FormatUint(sessionID, 10)}, " ")) +} + +func ProviderEpochCuKey(epoch uint64, provider string, chainID string) []byte { + return []byte(strings.Join([]string{string(EncodeBlock(epoch)), provider, chainID}, " ")) +} + +func ProviderConsumerEpochCuKey(epoch uint64, provider string, project string, chainID string) []byte { + return []byte(strings.Join([]string{string(EncodeBlock(epoch)), provider, project, chainID}, " ")) +} + +func DecodeUniqueEpochSessionKey(key string) (epoch uint64, provider string, chainID string, project string, sessionID uint64, err error) { + split := strings.Split(key, " ") + if len(split) != 5 { + return 0, "", "", "", 0, fmt.Errorf("invalid UniqueEpochSession key: bad structure. key: %s", key) + } + epoch = DecodeBlock([]byte(split[0])) + sessionID, err = strconv.ParseUint(split[4], 10, 64) + if err != nil { + return 0, "", "", "", 0, fmt.Errorf("invalid UniqueEpochSession key: bad session ID. key: %s", key) + } + return epoch, split[1], split[2], split[3], sessionID, nil +} + +func DecodeProviderEpochCuKey(key string) (epoch uint64, provider string, chainID string, err error) { + split := strings.Split(key, " ") + if len(split) != 3 { + return 0, "", "", fmt.Errorf("invalid ProviderEpochCu key: bad structure. key: %s", key) + } + epoch = DecodeBlock([]byte(split[0])) + return epoch, split[1], split[2], nil +} + +func DecodeProviderConsumerEpochCuKey(key string) (epoch uint64, provider string, project string, chainID string, err error) { + split := strings.Split(key, " ") + if len(split) != 4 { + return 0, "", "", "", fmt.Errorf("invalid ProviderConsumerEpochCu key: bad structure. key: %s", key) + } + epoch = DecodeBlock([]byte(split[0])) + return epoch, split[1], split[2], split[3], nil +} + +func UniqueEpochSessionKeyPrefix() []byte { + return []byte(UniqueEpochSessionPrefix) +} + +func ProviderEpochCuKeyPrefix() []byte { + return []byte(ProviderEpochCuPrefix) +} + +func ProviderEpochComplainerCuKeyPrefix() []byte { + return []byte(ProviderEpochComplainerCuPrefix) +} + +func ProviderConsumerEpochCuKeyPrefix() []byte { + return []byte(ProviderConsumerEpochCuPrefix) +} diff --git a/x/pairing/types/epoch_cu.pb.go b/x/pairing/types/epoch_cu.pb.go new file mode 100644 index 0000000000..25b144e06c --- /dev/null +++ b/x/pairing/types/epoch_cu.pb.go @@ -0,0 +1,742 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: lavanet/lava/pairing/epoch_cu.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// UniqueEpochSession is used to detect double spend attacks +// It's kept in a epoch-prefixed store with a unique index: provider, project ID, chain ID and session ID +type UniqueEpochSession struct { +} + +func (m *UniqueEpochSession) Reset() { *m = UniqueEpochSession{} } +func (m *UniqueEpochSession) String() string { return proto.CompactTextString(m) } +func (*UniqueEpochSession) ProtoMessage() {} +func (*UniqueEpochSession) Descriptor() ([]byte, []int) { + return fileDescriptor_c2abb0ec984ffb4c, []int{0} +} +func (m *UniqueEpochSession) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UniqueEpochSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UniqueEpochSession.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UniqueEpochSession) XXX_Merge(src proto.Message) { + xxx_messageInfo_UniqueEpochSession.Merge(m, src) +} +func (m *UniqueEpochSession) XXX_Size() int { + return m.Size() +} +func (m *UniqueEpochSession) XXX_DiscardUnknown() { + xxx_messageInfo_UniqueEpochSession.DiscardUnknown(m) +} + +var xxx_messageInfo_UniqueEpochSession proto.InternalMessageInfo + +// ProviderEpochCu is used to track the CU of a specific provider in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider address +type ProviderEpochCu struct { + ServicedCu uint64 `protobuf:"varint,1,opt,name=serviced_cu,json=servicedCu,proto3" json:"serviced_cu,omitempty"` +} + +func (m *ProviderEpochCu) Reset() { *m = ProviderEpochCu{} } +func (m *ProviderEpochCu) String() string { return proto.CompactTextString(m) } +func (*ProviderEpochCu) ProtoMessage() {} +func (*ProviderEpochCu) Descriptor() ([]byte, []int) { + return fileDescriptor_c2abb0ec984ffb4c, []int{1} +} +func (m *ProviderEpochCu) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderEpochCu) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderEpochCu.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderEpochCu) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderEpochCu.Merge(m, src) +} +func (m *ProviderEpochCu) XXX_Size() int { + return m.Size() +} +func (m *ProviderEpochCu) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderEpochCu.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderEpochCu proto.InternalMessageInfo + +func (m *ProviderEpochCu) GetServicedCu() uint64 { + if m != nil { + return m.ServicedCu + } + return 0 +} + +// ProviderEpochComplainerCu is used to track the CU complained of a specific provider in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider address +type ProviderEpochComplainerCu struct { + ComplainersCu uint64 `protobuf:"varint,1,opt,name=complainers_cu,json=complainersCu,proto3" json:"complainers_cu,omitempty"` +} + +func (m *ProviderEpochComplainerCu) Reset() { *m = ProviderEpochComplainerCu{} } +func (m *ProviderEpochComplainerCu) String() string { return proto.CompactTextString(m) } +func (*ProviderEpochComplainerCu) ProtoMessage() {} +func (*ProviderEpochComplainerCu) Descriptor() ([]byte, []int) { + return fileDescriptor_c2abb0ec984ffb4c, []int{2} +} +func (m *ProviderEpochComplainerCu) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderEpochComplainerCu) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderEpochComplainerCu.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderEpochComplainerCu) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderEpochComplainerCu.Merge(m, src) +} +func (m *ProviderEpochComplainerCu) XXX_Size() int { + return m.Size() +} +func (m *ProviderEpochComplainerCu) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderEpochComplainerCu.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderEpochComplainerCu proto.InternalMessageInfo + +func (m *ProviderEpochComplainerCu) GetComplainersCu() uint64 { + if m != nil { + return m.ComplainersCu + } + return 0 +} + +// ProviderConsumerEpochCu is used to track the CU between a specific provider and +// consumer in a specific epoch +// It's kept in a epoch-prefixed store with a unique index: provider and project ID +type ProviderConsumerEpochCu struct { + Cu uint64 `protobuf:"varint,1,opt,name=cu,proto3" json:"cu,omitempty"` +} + +func (m *ProviderConsumerEpochCu) Reset() { *m = ProviderConsumerEpochCu{} } +func (m *ProviderConsumerEpochCu) String() string { return proto.CompactTextString(m) } +func (*ProviderConsumerEpochCu) ProtoMessage() {} +func (*ProviderConsumerEpochCu) Descriptor() ([]byte, []int) { + return fileDescriptor_c2abb0ec984ffb4c, []int{3} +} +func (m *ProviderConsumerEpochCu) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderConsumerEpochCu) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderConsumerEpochCu.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderConsumerEpochCu) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderConsumerEpochCu.Merge(m, src) +} +func (m *ProviderConsumerEpochCu) XXX_Size() int { + return m.Size() +} +func (m *ProviderConsumerEpochCu) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderConsumerEpochCu.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderConsumerEpochCu proto.InternalMessageInfo + +func (m *ProviderConsumerEpochCu) GetCu() uint64 { + if m != nil { + return m.Cu + } + return 0 +} + +func init() { + proto.RegisterType((*UniqueEpochSession)(nil), "lavanet.lava.pairing.UniqueEpochSession") + proto.RegisterType((*ProviderEpochCu)(nil), "lavanet.lava.pairing.ProviderEpochCu") + proto.RegisterType((*ProviderEpochComplainerCu)(nil), "lavanet.lava.pairing.ProviderEpochComplainerCu") + proto.RegisterType((*ProviderConsumerEpochCu)(nil), "lavanet.lava.pairing.ProviderConsumerEpochCu") +} + +func init() { + proto.RegisterFile("lavanet/lava/pairing/epoch_cu.proto", fileDescriptor_c2abb0ec984ffb4c) +} + +var fileDescriptor_c2abb0ec984ffb4c = []byte{ + // 242 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x49, 0x2c, 0x4b, + 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x89, 0x99, 0x45, 0x99, 0x79, 0xe9, 0xfa, 0xa9, + 0x05, 0xf9, 0xc9, 0x19, 0xf1, 0xc9, 0xa5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x22, 0x50, + 0x45, 0x7a, 0x20, 0x5a, 0x0f, 0xaa, 0x48, 0x49, 0x84, 0x4b, 0x28, 0x34, 0x2f, 0xb3, 0xb0, 0x34, + 0xd5, 0x15, 0xa4, 0x3a, 0x38, 0xb5, 0xb8, 0x38, 0x33, 0x3f, 0x4f, 0xc9, 0x88, 0x8b, 0x3f, 0xa0, + 0x28, 0xbf, 0x2c, 0x33, 0x25, 0xb5, 0x08, 0x2c, 0xee, 0x5c, 0x2a, 0x24, 0xcf, 0xc5, 0x5d, 0x9c, + 0x5a, 0x54, 0x96, 0x99, 0x9c, 0x9a, 0x12, 0x9f, 0x5c, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x12, + 0xc4, 0x05, 0x13, 0x72, 0x2e, 0x55, 0x72, 0xe2, 0x92, 0x44, 0xd5, 0x93, 0x9f, 0x5b, 0x90, 0x93, + 0x98, 0x99, 0x97, 0x5a, 0xe4, 0x5c, 0x2a, 0xa4, 0xca, 0xc5, 0x97, 0x0c, 0xe7, 0x17, 0x23, 0x0c, + 0xe0, 0x45, 0x12, 0x75, 0x2e, 0x55, 0xd2, 0xe4, 0x12, 0x87, 0x99, 0xe1, 0x9c, 0x9f, 0x57, 0x5c, + 0x9a, 0x8b, 0xb0, 0x9f, 0x8f, 0x8b, 0x09, 0xae, 0x8b, 0x29, 0xb9, 0xd4, 0xc9, 0xf1, 0xc4, 0x23, + 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, + 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, + 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x02, 0xa6, 0x02, 0x1e, 0x34, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, + 0x6c, 0xe0, 0x80, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xf8, 0x2d, 0xe9, 0x3f, 0x01, + 0x00, 0x00, +} + +func (m *UniqueEpochSession) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UniqueEpochSession) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UniqueEpochSession) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ProviderEpochCu) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderEpochCu) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderEpochCu) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ServicedCu != 0 { + i = encodeVarintEpochCu(dAtA, i, uint64(m.ServicedCu)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProviderEpochComplainerCu) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderEpochComplainerCu) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderEpochComplainerCu) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ComplainersCu != 0 { + i = encodeVarintEpochCu(dAtA, i, uint64(m.ComplainersCu)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProviderConsumerEpochCu) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderConsumerEpochCu) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderConsumerEpochCu) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Cu != 0 { + i = encodeVarintEpochCu(dAtA, i, uint64(m.Cu)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEpochCu(dAtA []byte, offset int, v uint64) int { + offset -= sovEpochCu(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *UniqueEpochSession) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ProviderEpochCu) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ServicedCu != 0 { + n += 1 + sovEpochCu(uint64(m.ServicedCu)) + } + return n +} + +func (m *ProviderEpochComplainerCu) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ComplainersCu != 0 { + n += 1 + sovEpochCu(uint64(m.ComplainersCu)) + } + return n +} + +func (m *ProviderConsumerEpochCu) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Cu != 0 { + n += 1 + sovEpochCu(uint64(m.Cu)) + } + return n +} + +func sovEpochCu(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEpochCu(x uint64) (n int) { + return sovEpochCu(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *UniqueEpochSession) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UniqueEpochSession: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UniqueEpochSession: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipEpochCu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochCu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProviderEpochCu) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProviderEpochCu: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderEpochCu: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ServicedCu", wireType) + } + m.ServicedCu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ServicedCu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEpochCu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochCu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProviderEpochComplainerCu) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProviderEpochComplainerCu: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderEpochComplainerCu: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ComplainersCu", wireType) + } + m.ComplainersCu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ComplainersCu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEpochCu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochCu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProviderConsumerEpochCu) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProviderConsumerEpochCu: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderConsumerEpochCu: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cu", wireType) + } + m.Cu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochCu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Cu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEpochCu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochCu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEpochCu(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochCu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochCu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochCu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEpochCu + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEpochCu + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEpochCu + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEpochCu = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEpochCu = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEpochCu = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/pairing/types/genesis.go b/x/pairing/types/genesis.go index c7cb7ac855..224077aabd 100644 --- a/x/pairing/types/genesis.go +++ b/x/pairing/types/genesis.go @@ -13,12 +13,12 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - UniquePaymentStorageClientProviderList: []UniquePaymentStorageClientProvider{}, - ProviderPaymentStorageList: []ProviderPaymentStorage{}, - EpochPaymentsList: []EpochPayments{}, - BadgeUsedCuList: []BadgeUsedCu{}, - BadgesTS: *timerstoretypes.DefaultGenesis(), - ProviderQosFS: *fixationtypes.DefaultGenesis(), + UniqueEpochSessions: []UniqueEpochSessionGenesis{}, + ProviderEpochCus: []ProviderEpochCuGenesis{}, + ProviderConsumerEpochCus: []ProviderConsumerEpochCuGenesis{}, + BadgeUsedCuList: []BadgeUsedCu{}, + BadgesTS: *timerstoretypes.DefaultGenesis(), + ProviderQosFS: *fixationtypes.DefaultGenesis(), // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -27,35 +27,45 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // Check for duplicated index in uniquePaymentStorageClientProvider - uniquePaymentStorageClientProviderIndexMap := make(map[string]struct{}) + // Check for duplicated index in UniqueEpochSession + UniqueEpochSessionsProviderIndexMap := make(map[string]struct{}) - for _, elem := range gs.UniquePaymentStorageClientProviderList { - index := string(UniquePaymentStorageClientProviderKey(elem.Index)) - if _, ok := uniquePaymentStorageClientProviderIndexMap[index]; ok { - return fmt.Errorf("duplicated index for uniquePaymentStorageClientProvider") + for _, elem := range gs.UniqueEpochSessions { + index := string(UniqueEpochSessionKey(elem.Epoch, elem.Provider, elem.ChainId, elem.Project, elem.SessionId)) + if _, ok := UniqueEpochSessionsProviderIndexMap[index]; ok { + return fmt.Errorf("duplicated index for UniqueEpochSession") } - uniquePaymentStorageClientProviderIndexMap[index] = struct{}{} + UniqueEpochSessionsProviderIndexMap[index] = struct{}{} + } + // Check for duplicated index in ProviderEpochCu + providerEpochCusIndexMap := make(map[string]struct{}) + for _, elem := range gs.ProviderEpochCus { + index := string(ProviderEpochCuKey(elem.Epoch, elem.Provider, elem.ChainId)) + if _, ok := providerEpochCusIndexMap[index]; ok { + return fmt.Errorf("duplicated index for ProviderEpochCu") + } + providerEpochCusIndexMap[index] = struct{}{} } - // Check for duplicated index in providerPaymentStorage - providerPaymentStorageIndexMap := make(map[string]struct{}) - for _, elem := range gs.ProviderPaymentStorageList { - index := string(ProviderPaymentStorageKey(elem.Index)) - if _, ok := providerPaymentStorageIndexMap[index]; ok { - return fmt.Errorf("duplicated index for providerPaymentStorage") + // Check for duplicated index in ProviderEpochCu + providerEpochComplainerCusIndexMap := make(map[string]struct{}) + for _, elem := range gs.ProviderEpochComplainedCus { + index := string(ProviderEpochCuKey(elem.Epoch, elem.Provider, elem.ChainId)) + if _, ok := providerEpochComplainerCusIndexMap[index]; ok { + return fmt.Errorf("duplicated index for ProviderEpochCu") } - providerPaymentStorageIndexMap[index] = struct{}{} + providerEpochComplainerCusIndexMap[index] = struct{}{} } - // Check for duplicated index in epochPayments - epochPaymentsIndexMap := make(map[string]struct{}) - for _, elem := range gs.EpochPaymentsList { - index := string(EpochPaymentsKey(elem.Index)) - if _, ok := epochPaymentsIndexMap[index]; ok { - return fmt.Errorf("duplicated index for epochPayments") + // Check for duplicated index in ProviderConsumerEpochCu + providerConsumerEpochCuIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ProviderConsumerEpochCus { + index := string(ProviderConsumerEpochCuKey(elem.Epoch, elem.Provider, elem.Project, elem.ChainId)) + if _, ok := providerConsumerEpochCuIndexMap[index]; ok { + return fmt.Errorf("duplicated index for ProviderConsumerEpochCu") } - epochPaymentsIndexMap[index] = struct{}{} + providerConsumerEpochCuIndexMap[index] = struct{}{} } // check the badgeUsedCuIndex map is empty diff --git a/x/pairing/types/genesis.pb.go b/x/pairing/types/genesis.pb.go index f09e7b826f..e8b319a8b9 100644 --- a/x/pairing/types/genesis.pb.go +++ b/x/pairing/types/genesis.pb.go @@ -79,13 +79,14 @@ func (m *BadgeUsedCu) GetUsedCu() uint64 { // GenesisState defines the pairing module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - UniquePaymentStorageClientProviderList []UniquePaymentStorageClientProvider `protobuf:"bytes,2,rep,name=uniquePaymentStorageClientProviderList,proto3" json:"uniquePaymentStorageClientProviderList"` - ProviderPaymentStorageList []ProviderPaymentStorage `protobuf:"bytes,3,rep,name=providerPaymentStorageList,proto3" json:"providerPaymentStorageList"` - EpochPaymentsList []EpochPayments `protobuf:"bytes,4,rep,name=epochPaymentsList,proto3" json:"epochPaymentsList"` - BadgeUsedCuList []BadgeUsedCu `protobuf:"bytes,5,rep,name=badgeUsedCuList,proto3" json:"badgeUsedCuList"` - BadgesTS types.GenesisState `protobuf:"bytes,6,opt,name=badgesTS,proto3" json:"badgesTS"` - ProviderQosFS types1.GenesisState `protobuf:"bytes,7,opt,name=providerQosFS,proto3" json:"providerQosFS"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + BadgeUsedCuList []BadgeUsedCu `protobuf:"bytes,5,rep,name=badgeUsedCuList,proto3" json:"badgeUsedCuList"` + BadgesTS types.GenesisState `protobuf:"bytes,6,opt,name=badgesTS,proto3" json:"badgesTS"` + ProviderQosFS types1.GenesisState `protobuf:"bytes,7,opt,name=providerQosFS,proto3" json:"providerQosFS"` + UniqueEpochSessions []UniqueEpochSessionGenesis `protobuf:"bytes,8,rep,name=unique_epoch_sessions,json=uniqueEpochSessions,proto3" json:"unique_epoch_sessions"` + ProviderEpochCus []ProviderEpochCuGenesis `protobuf:"bytes,9,rep,name=provider_epoch_cus,json=providerEpochCus,proto3" json:"provider_epoch_cus"` + ProviderEpochComplainedCus []ProviderEpochComplainerCuGenesis `protobuf:"bytes,10,rep,name=provider_epoch_complained_cus,json=providerEpochComplainedCus,proto3" json:"provider_epoch_complained_cus"` + ProviderConsumerEpochCus []ProviderConsumerEpochCuGenesis `protobuf:"bytes,11,rep,name=provider_consumer_epoch_cus,json=providerConsumerEpochCus,proto3" json:"provider_consumer_epoch_cus"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -128,51 +129,350 @@ func (m *GenesisState) GetParams() Params { return Params{} } -func (m *GenesisState) GetUniquePaymentStorageClientProviderList() []UniquePaymentStorageClientProvider { +func (m *GenesisState) GetBadgeUsedCuList() []BadgeUsedCu { if m != nil { - return m.UniquePaymentStorageClientProviderList + return m.BadgeUsedCuList } return nil } -func (m *GenesisState) GetProviderPaymentStorageList() []ProviderPaymentStorage { +func (m *GenesisState) GetBadgesTS() types.GenesisState { + if m != nil { + return m.BadgesTS + } + return types.GenesisState{} +} + +func (m *GenesisState) GetProviderQosFS() types1.GenesisState { + if m != nil { + return m.ProviderQosFS + } + return types1.GenesisState{} +} + +func (m *GenesisState) GetUniqueEpochSessions() []UniqueEpochSessionGenesis { if m != nil { - return m.ProviderPaymentStorageList + return m.UniqueEpochSessions } return nil } -func (m *GenesisState) GetEpochPaymentsList() []EpochPayments { +func (m *GenesisState) GetProviderEpochCus() []ProviderEpochCuGenesis { if m != nil { - return m.EpochPaymentsList + return m.ProviderEpochCus } return nil } -func (m *GenesisState) GetBadgeUsedCuList() []BadgeUsedCu { +func (m *GenesisState) GetProviderEpochComplainedCus() []ProviderEpochComplainerCuGenesis { if m != nil { - return m.BadgeUsedCuList + return m.ProviderEpochComplainedCus } return nil } -func (m *GenesisState) GetBadgesTS() types.GenesisState { +func (m *GenesisState) GetProviderConsumerEpochCus() []ProviderConsumerEpochCuGenesis { if m != nil { - return m.BadgesTS + return m.ProviderConsumerEpochCus } - return types.GenesisState{} + return nil } -func (m *GenesisState) GetProviderQosFS() types1.GenesisState { +type UniqueEpochSessionGenesis struct { + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + Project string `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` + ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + SessionId uint64 `protobuf:"varint,5,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` +} + +func (m *UniqueEpochSessionGenesis) Reset() { *m = UniqueEpochSessionGenesis{} } +func (m *UniqueEpochSessionGenesis) String() string { return proto.CompactTextString(m) } +func (*UniqueEpochSessionGenesis) ProtoMessage() {} +func (*UniqueEpochSessionGenesis) Descriptor() ([]byte, []int) { + return fileDescriptor_dbd1e49b8b57595b, []int{2} +} +func (m *UniqueEpochSessionGenesis) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UniqueEpochSessionGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UniqueEpochSessionGenesis.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UniqueEpochSessionGenesis) XXX_Merge(src proto.Message) { + xxx_messageInfo_UniqueEpochSessionGenesis.Merge(m, src) +} +func (m *UniqueEpochSessionGenesis) XXX_Size() int { + return m.Size() +} +func (m *UniqueEpochSessionGenesis) XXX_DiscardUnknown() { + xxx_messageInfo_UniqueEpochSessionGenesis.DiscardUnknown(m) +} + +var xxx_messageInfo_UniqueEpochSessionGenesis proto.InternalMessageInfo + +func (m *UniqueEpochSessionGenesis) GetEpoch() uint64 { if m != nil { - return m.ProviderQosFS + return m.Epoch } - return types1.GenesisState{} + return 0 +} + +func (m *UniqueEpochSessionGenesis) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *UniqueEpochSessionGenesis) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *UniqueEpochSessionGenesis) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *UniqueEpochSessionGenesis) GetSessionId() uint64 { + if m != nil { + return m.SessionId + } + return 0 +} + +type ProviderEpochCuGenesis struct { + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ProviderEpochCu ProviderEpochCu `protobuf:"bytes,4,opt,name=provider_epoch_cu,json=providerEpochCu,proto3" json:"provider_epoch_cu"` +} + +func (m *ProviderEpochCuGenesis) Reset() { *m = ProviderEpochCuGenesis{} } +func (m *ProviderEpochCuGenesis) String() string { return proto.CompactTextString(m) } +func (*ProviderEpochCuGenesis) ProtoMessage() {} +func (*ProviderEpochCuGenesis) Descriptor() ([]byte, []int) { + return fileDescriptor_dbd1e49b8b57595b, []int{3} +} +func (m *ProviderEpochCuGenesis) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderEpochCuGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderEpochCuGenesis.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderEpochCuGenesis) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderEpochCuGenesis.Merge(m, src) +} +func (m *ProviderEpochCuGenesis) XXX_Size() int { + return m.Size() +} +func (m *ProviderEpochCuGenesis) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderEpochCuGenesis.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderEpochCuGenesis proto.InternalMessageInfo + +func (m *ProviderEpochCuGenesis) GetEpoch() uint64 { + if m != nil { + return m.Epoch + } + return 0 +} + +func (m *ProviderEpochCuGenesis) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *ProviderEpochCuGenesis) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *ProviderEpochCuGenesis) GetProviderEpochCu() ProviderEpochCu { + if m != nil { + return m.ProviderEpochCu + } + return ProviderEpochCu{} +} + +type ProviderEpochComplainerCuGenesis struct { + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ProviderEpochComplainerCu ProviderEpochComplainerCu `protobuf:"bytes,4,opt,name=provider_epoch_complainer_cu,json=providerEpochComplainerCu,proto3" json:"provider_epoch_complainer_cu"` +} + +func (m *ProviderEpochComplainerCuGenesis) Reset() { *m = ProviderEpochComplainerCuGenesis{} } +func (m *ProviderEpochComplainerCuGenesis) String() string { return proto.CompactTextString(m) } +func (*ProviderEpochComplainerCuGenesis) ProtoMessage() {} +func (*ProviderEpochComplainerCuGenesis) Descriptor() ([]byte, []int) { + return fileDescriptor_dbd1e49b8b57595b, []int{4} +} +func (m *ProviderEpochComplainerCuGenesis) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderEpochComplainerCuGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderEpochComplainerCuGenesis.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderEpochComplainerCuGenesis) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderEpochComplainerCuGenesis.Merge(m, src) +} +func (m *ProviderEpochComplainerCuGenesis) XXX_Size() int { + return m.Size() +} +func (m *ProviderEpochComplainerCuGenesis) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderEpochComplainerCuGenesis.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderEpochComplainerCuGenesis proto.InternalMessageInfo + +func (m *ProviderEpochComplainerCuGenesis) GetEpoch() uint64 { + if m != nil { + return m.Epoch + } + return 0 +} + +func (m *ProviderEpochComplainerCuGenesis) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *ProviderEpochComplainerCuGenesis) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *ProviderEpochComplainerCuGenesis) GetProviderEpochComplainerCu() ProviderEpochComplainerCu { + if m != nil { + return m.ProviderEpochComplainerCu + } + return ProviderEpochComplainerCu{} +} + +type ProviderConsumerEpochCuGenesis struct { + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + Project string `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` + ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ProviderConsumerEpochCu ProviderConsumerEpochCu `protobuf:"bytes,5,opt,name=provider_consumer_epoch_cu,json=providerConsumerEpochCu,proto3" json:"provider_consumer_epoch_cu"` +} + +func (m *ProviderConsumerEpochCuGenesis) Reset() { *m = ProviderConsumerEpochCuGenesis{} } +func (m *ProviderConsumerEpochCuGenesis) String() string { return proto.CompactTextString(m) } +func (*ProviderConsumerEpochCuGenesis) ProtoMessage() {} +func (*ProviderConsumerEpochCuGenesis) Descriptor() ([]byte, []int) { + return fileDescriptor_dbd1e49b8b57595b, []int{5} +} +func (m *ProviderConsumerEpochCuGenesis) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderConsumerEpochCuGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderConsumerEpochCuGenesis.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProviderConsumerEpochCuGenesis) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderConsumerEpochCuGenesis.Merge(m, src) +} +func (m *ProviderConsumerEpochCuGenesis) XXX_Size() int { + return m.Size() +} +func (m *ProviderConsumerEpochCuGenesis) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderConsumerEpochCuGenesis.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderConsumerEpochCuGenesis proto.InternalMessageInfo + +func (m *ProviderConsumerEpochCuGenesis) GetEpoch() uint64 { + if m != nil { + return m.Epoch + } + return 0 +} + +func (m *ProviderConsumerEpochCuGenesis) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *ProviderConsumerEpochCuGenesis) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ProviderConsumerEpochCuGenesis) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *ProviderConsumerEpochCuGenesis) GetProviderConsumerEpochCu() ProviderConsumerEpochCu { + if m != nil { + return m.ProviderConsumerEpochCu + } + return ProviderConsumerEpochCu{} } func init() { proto.RegisterType((*BadgeUsedCu)(nil), "lavanet.lava.pairing.BadgeUsedCu") proto.RegisterType((*GenesisState)(nil), "lavanet.lava.pairing.GenesisState") + proto.RegisterType((*UniqueEpochSessionGenesis)(nil), "lavanet.lava.pairing.UniqueEpochSessionGenesis") + proto.RegisterType((*ProviderEpochCuGenesis)(nil), "lavanet.lava.pairing.ProviderEpochCuGenesis") + proto.RegisterType((*ProviderEpochComplainerCuGenesis)(nil), "lavanet.lava.pairing.ProviderEpochComplainerCuGenesis") + proto.RegisterType((*ProviderConsumerEpochCuGenesis)(nil), "lavanet.lava.pairing.ProviderConsumerEpochCuGenesis") } func init() { @@ -180,39 +480,51 @@ func init() { } var fileDescriptor_dbd1e49b8b57595b = []byte{ - // 500 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0xe3, 0x36, 0x4d, 0xd1, 0xa6, 0x80, 0xba, 0xaa, 0x84, 0x15, 0x21, 0x93, 0xa6, 0x02, - 0x52, 0x09, 0xd9, 0x52, 0x7b, 0x41, 0xdc, 0x9a, 0x0a, 0x7a, 0x80, 0x43, 0x3e, 0x5a, 0x21, 0x71, - 0xb1, 0x36, 0xc9, 0xe0, 0xae, 0x68, 0xbc, 0xc6, 0xbb, 0xae, 0x9a, 0xb7, 0xe0, 0xc4, 0x03, 0xf0, - 0x34, 0x3d, 0xf6, 0xc8, 0x09, 0xa1, 0xe4, 0x45, 0x90, 0xc7, 0x93, 0x34, 0x2e, 0xcb, 0xc7, 0xc9, - 0xde, 0xf8, 0x37, 0xbf, 0xff, 0x66, 0x66, 0x97, 0xb5, 0x2e, 0xc4, 0xa5, 0x88, 0xc1, 0x04, 0xf9, - 0x33, 0x48, 0x84, 0x4c, 0x65, 0x1c, 0x05, 0x11, 0xc4, 0xa0, 0xa5, 0xf6, 0x93, 0x54, 0x19, 0xc5, - 0x77, 0x88, 0xf1, 0xf3, 0xa7, 0x4f, 0x4c, 0x63, 0x27, 0x52, 0x91, 0x42, 0x20, 0xc8, 0xdf, 0x0a, - 0xb6, 0xb1, 0x6b, 0xf5, 0x25, 0x22, 0x15, 0x13, 0xd2, 0x35, 0x8e, 0xac, 0x48, 0x16, 0xcb, 0xcf, - 0x19, 0x84, 0x89, 0x98, 0x4e, 0x20, 0x36, 0xa1, 0x36, 0x2a, 0x15, 0x11, 0x84, 0xa3, 0x0b, 0x99, - 0x2f, 0x93, 0x54, 0x5d, 0xca, 0x31, 0xa4, 0xa4, 0x38, 0xb4, 0xa7, 0x10, 0x74, 0x57, 0x42, 0x45, - 0xfb, 0xd6, 0x22, 0x48, 0xd4, 0xe8, 0x7c, 0x51, 0xa1, 0xad, 0xe8, 0x47, 0x79, 0x25, 0x8c, 0x54, - 0x71, 0xae, 0x83, 0xe5, 0x8a, 0xd0, 0xbd, 0x12, 0x6a, 0xe4, 0x04, 0xd2, 0x82, 0xc3, 0xd7, 0x02, - 0x6a, 0xf5, 0x58, 0xbd, 0x23, 0xc6, 0x11, 0x9c, 0x69, 0x18, 0x1f, 0x67, 0x7c, 0x9f, 0x6d, 0x0f, - 0xf3, 0x65, 0x98, 0x69, 0x18, 0x87, 0xa3, 0x2c, 0xfc, 0x04, 0x53, 0xd7, 0x69, 0x3a, 0xed, 0xad, - 0xfe, 0x83, 0xe1, 0x2d, 0xf7, 0x16, 0xa6, 0xfc, 0x11, 0xdb, 0x24, 0xc8, 0x5d, 0x6b, 0x3a, 0xed, - 0x6a, 0xbf, 0x96, 0xe1, 0xb7, 0xd6, 0xb7, 0x0d, 0xb6, 0x75, 0x52, 0x8c, 0x69, 0x60, 0x84, 0x01, - 0xfe, 0x8a, 0xd5, 0x8a, 0x36, 0xa3, 0xa9, 0x7e, 0xf0, 0xd8, 0xb7, 0x8d, 0xcd, 0xef, 0x22, 0xd3, - 0xa9, 0x5e, 0xff, 0x78, 0x52, 0xe9, 0x53, 0x05, 0xff, 0xea, 0xb0, 0x67, 0xc5, 0x00, 0xba, 0x45, - 0x23, 0x06, 0x45, 0xe7, 0x8e, 0xb1, 0xfb, 0x5d, 0xea, 0xeb, 0x3b, 0xa9, 0x8d, 0xbb, 0xd6, 0x5c, - 0x6f, 0xd7, 0x0f, 0x5e, 0xda, 0xe5, 0x67, 0xff, 0x74, 0x50, 0xf0, 0x7f, 0xa6, 0xf1, 0x94, 0x35, - 0x16, 0x53, 0x2d, 0xb3, 0xb8, 0x97, 0x75, 0xdc, 0xcb, 0x8b, 0x3f, 0xfc, 0x51, 0x6b, 0x1d, 0xe5, - 0xff, 0xc5, 0xca, 0xdf, 0xb3, 0x6d, 0x3c, 0x14, 0xf4, 0x49, 0x63, 0x54, 0x15, 0xa3, 0xf6, 0xec, - 0x51, 0xaf, 0x57, 0x71, 0x4a, 0xf8, 0xdd, 0xc1, 0x7b, 0xec, 0xe1, 0xca, 0x74, 0x51, 0xbb, 0x81, - 0xda, 0x5d, 0xbb, 0x76, 0xe5, 0xc8, 0x90, 0xf4, 0x6e, 0x3d, 0x3f, 0x61, 0xf7, 0xf0, 0x27, 0x7d, - 0x3a, 0x70, 0x6b, 0x38, 0xf6, 0xa7, 0x65, 0xd7, 0xed, 0x81, 0xf4, 0x57, 0x4f, 0x0b, 0xf9, 0x96, - 0xc5, 0xfc, 0x94, 0xdd, 0x5f, 0xb4, 0xa4, 0xa7, 0xf4, 0x9b, 0x81, 0xbb, 0x89, 0xb6, 0x76, 0xd9, - 0x56, 0xba, 0x09, 0x36, 0x61, 0x59, 0xd2, 0x39, 0xba, 0x9e, 0x79, 0xce, 0xcd, 0xcc, 0x73, 0x7e, - 0xce, 0x3c, 0xe7, 0xcb, 0xdc, 0xab, 0xdc, 0xcc, 0xbd, 0xca, 0xf7, 0xb9, 0x57, 0xf9, 0xf0, 0x3c, - 0x92, 0xe6, 0x3c, 0x1b, 0xfa, 0x23, 0x35, 0x09, 0x4a, 0x37, 0xe8, 0x6a, 0x79, 0x33, 0xcd, 0x34, - 0x01, 0x3d, 0xac, 0xe1, 0x0d, 0x3a, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x86, 0x08, 0xe8, 0x13, - 0xa9, 0x04, 0x00, 0x00, + // 693 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x53, 0xd3, 0x40, + 0x18, 0x6d, 0x68, 0x5a, 0xca, 0x57, 0xd4, 0xb2, 0xa2, 0x84, 0x0a, 0xb1, 0xc4, 0x71, 0x2c, 0x33, + 0x9a, 0xcc, 0xa0, 0xe3, 0xc1, 0x9b, 0x30, 0xca, 0x80, 0x1e, 0xa4, 0x85, 0x71, 0xc6, 0x4b, 0x4c, + 0x93, 0xb5, 0xac, 0xd2, 0xec, 0x9a, 0x4d, 0x18, 0x7a, 0xf2, 0x2f, 0x78, 0xf3, 0xec, 0x1f, 0xf1, + 0xcc, 0x91, 0xa3, 0x27, 0xc7, 0x81, 0x83, 0xbf, 0xc1, 0x9b, 0x93, 0xcd, 0xb6, 0x34, 0x25, 0x41, + 0x71, 0x1c, 0x4f, 0xc9, 0x66, 0xdf, 0xf7, 0xde, 0xf7, 0xb2, 0xef, 0x9b, 0x05, 0x63, 0xcf, 0xd9, + 0x77, 0x7c, 0x1c, 0x5a, 0xf1, 0xd3, 0x62, 0x0e, 0x09, 0x88, 0xdf, 0xb5, 0xba, 0xd8, 0xc7, 0x9c, + 0x70, 0x93, 0x05, 0x34, 0xa4, 0x68, 0x56, 0x62, 0xcc, 0xf8, 0x69, 0x4a, 0x4c, 0x7d, 0xb6, 0x4b, + 0xbb, 0x54, 0x00, 0xac, 0xf8, 0x2d, 0xc1, 0xd6, 0x97, 0x32, 0xf9, 0x98, 0x13, 0x38, 0x3d, 0x49, + 0x57, 0xbf, 0x95, 0x09, 0xc1, 0x8c, 0xba, 0xbb, 0xb6, 0x1b, 0x49, 0xd0, 0x72, 0x0a, 0xf4, 0x86, + 0x1c, 0x38, 0x21, 0xa1, 0x3e, 0x0f, 0x69, 0x80, 0x87, 0xab, 0x4c, 0xbe, 0x90, 0xf4, 0x70, 0x90, + 0xe0, 0xc4, 0x6b, 0x02, 0x32, 0xb6, 0xa0, 0xba, 0xea, 0x78, 0x5d, 0xbc, 0xc3, 0xb1, 0xb7, 0x16, + 0xa1, 0x65, 0x98, 0xe9, 0xc4, 0x4b, 0x3b, 0xe2, 0xd8, 0xb3, 0xdd, 0xc8, 0x7e, 0x87, 0xfb, 0x9a, + 0xd2, 0x50, 0x9a, 0xd3, 0xad, 0xcb, 0x9d, 0x53, 0xdc, 0x33, 0xdc, 0x47, 0x73, 0x30, 0x29, 0x41, + 0xda, 0x44, 0x43, 0x69, 0xaa, 0xad, 0x72, 0x24, 0xf6, 0x8c, 0x4f, 0x65, 0x98, 0x5e, 0x4f, 0x7e, + 0x54, 0x3b, 0x74, 0x42, 0x8c, 0x1e, 0x41, 0x39, 0x31, 0x2a, 0x98, 0xaa, 0x2b, 0x0b, 0x66, 0xd6, + 0x8f, 0x33, 0x5f, 0x08, 0xcc, 0xaa, 0x7a, 0xf8, 0xed, 0x66, 0xa1, 0x25, 0x2b, 0xd0, 0x16, 0x5c, + 0x19, 0xd1, 0x7d, 0x4e, 0x78, 0xa8, 0x95, 0x1a, 0xc5, 0x66, 0x75, 0x65, 0x29, 0x9b, 0x64, 0xc4, + 0x8c, 0x64, 0x1a, 0xaf, 0x47, 0xeb, 0x50, 0x11, 0x9f, 0xf8, 0x76, 0x5b, 0x2b, 0x8b, 0x86, 0x6e, + 0xa7, 0xb9, 0x4e, 0x7f, 0x95, 0x39, 0xea, 0x43, 0xf2, 0x0d, 0x8b, 0xd1, 0x36, 0x5c, 0x62, 0x01, + 0xdd, 0x27, 0x1e, 0x0e, 0xb6, 0x28, 0x7f, 0xda, 0xd6, 0x26, 0x05, 0x5b, 0x33, 0xcd, 0x96, 0x3a, + 0xa3, 0x2c, 0xc2, 0x34, 0x09, 0x22, 0x70, 0x2d, 0xf2, 0xc9, 0xfb, 0x08, 0xdb, 0xc9, 0xd1, 0x73, + 0xcc, 0x79, 0x5c, 0xae, 0x55, 0x84, 0x6f, 0x2b, 0xdb, 0xf7, 0x8e, 0x28, 0x79, 0x12, 0x57, 0xb4, + 0x93, 0x02, 0xa9, 0x24, 0x45, 0xae, 0x46, 0x67, 0x00, 0x1c, 0xbd, 0x06, 0x34, 0xd0, 0xb6, 0x07, + 0x39, 0xe3, 0xda, 0x94, 0xd0, 0xb9, 0x9b, 0x73, 0x48, 0x12, 0x2f, 0x88, 0xd6, 0xa2, 0xb4, 0x48, + 0x8d, 0xa5, 0x77, 0x39, 0xfa, 0x00, 0x8b, 0xe3, 0x0a, 0xb4, 0xc7, 0xf6, 0x1c, 0xe2, 0x8b, 0xe4, + 0x70, 0x0d, 0x84, 0xd8, 0xc3, 0x3f, 0x11, 0x1b, 0x14, 0x06, 0xe3, 0xb2, 0x75, 0x96, 0x89, 0xf3, + 0xe2, 0x06, 0xfa, 0x70, 0x63, 0xd8, 0x80, 0x4b, 0x7d, 0x1e, 0xf5, 0x52, 0x5e, 0xab, 0x42, 0xfe, + 0xc1, 0xf9, 0xf2, 0x6b, 0xb2, 0x2e, 0xd3, 0xb3, 0xc6, 0xb2, 0x51, 0x7c, 0x53, 0xad, 0x4c, 0xd4, + 0x8a, 0x9b, 0x6a, 0xa5, 0x58, 0x53, 0x37, 0xd5, 0x8a, 0x5a, 0x2b, 0x19, 0x9f, 0x15, 0x98, 0xcf, + 0x3d, 0x28, 0x34, 0x0b, 0x25, 0xd1, 0x98, 0x98, 0x12, 0xb5, 0x95, 0x2c, 0x50, 0x1d, 0x2a, 0x03, + 0x05, 0x31, 0x67, 0x53, 0xad, 0xe1, 0x1a, 0x69, 0x30, 0xc9, 0x02, 0xfa, 0x16, 0xbb, 0xa1, 0x56, + 0x14, 0x5b, 0x83, 0x25, 0x9a, 0x87, 0x8a, 0xbb, 0xeb, 0x10, 0xdf, 0x26, 0x9e, 0xa6, 0x26, 0x5b, + 0x62, 0xbd, 0xe1, 0xa1, 0x45, 0x00, 0x19, 0xa9, 0x78, 0xb3, 0x24, 0xb4, 0xa6, 0xe4, 0x97, 0x0d, + 0xcf, 0xf8, 0xa2, 0xc0, 0xf5, 0xec, 0x43, 0xfe, 0x8b, 0x06, 0x47, 0xdb, 0x28, 0xa6, 0xdb, 0x78, + 0x09, 0x33, 0x67, 0xb2, 0x27, 0x5a, 0x3d, 0x33, 0x8e, 0x39, 0xd1, 0x1b, 0x8c, 0xf7, 0x58, 0xe6, + 0x8c, 0x1f, 0x0a, 0x34, 0x7e, 0x17, 0x9c, 0x7f, 0x6b, 0x65, 0x1f, 0x16, 0xf2, 0x42, 0x1e, 0x9c, + 0xba, 0xb2, 0x2e, 0x98, 0x71, 0xe9, 0x6f, 0x9e, 0xe5, 0x01, 0x8c, 0x9f, 0x0a, 0xe8, 0xe7, 0x67, + 0xf4, 0x7f, 0x65, 0x8a, 0x41, 0x3d, 0x7f, 0xca, 0x44, 0xc6, 0xaa, 0x2b, 0xf7, 0x2e, 0x34, 0x64, + 0xd2, 0xfd, 0x5c, 0xce, 0x74, 0xad, 0x3e, 0x3e, 0x3c, 0xd6, 0x95, 0xa3, 0x63, 0x5d, 0xf9, 0x7e, + 0xac, 0x2b, 0x1f, 0x4f, 0xf4, 0xc2, 0xd1, 0x89, 0x5e, 0xf8, 0x7a, 0xa2, 0x17, 0x5e, 0xdd, 0xe9, + 0x92, 0x70, 0x37, 0xea, 0x98, 0x2e, 0xed, 0x59, 0xa9, 0x1b, 0xf0, 0x60, 0x78, 0xa7, 0x86, 0x7d, + 0x86, 0x79, 0xa7, 0x2c, 0x6e, 0xc0, 0xfb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x79, 0x43, 0xa2, + 0x96, 0xeb, 0x07, 0x00, 0x00, } func (m *BadgeUsedCu) Marshal() (dAtA []byte, err error) { @@ -270,30 +582,24 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.ProviderQosFS.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.BadgesTS.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ProviderConsumerEpochCus) > 0 { + for iNdEx := len(m.ProviderConsumerEpochCus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProviderConsumerEpochCus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x32 - if len(m.BadgeUsedCuList) > 0 { - for iNdEx := len(m.BadgeUsedCuList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ProviderEpochComplainedCus) > 0 { + for iNdEx := len(m.ProviderEpochComplainedCus) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.BadgeUsedCuList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ProviderEpochComplainedCus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -301,13 +607,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x52 } } - if len(m.EpochPaymentsList) > 0 { - for iNdEx := len(m.EpochPaymentsList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ProviderEpochCus) > 0 { + for iNdEx := len(m.ProviderEpochCus) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.EpochPaymentsList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ProviderEpochCus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -315,13 +621,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x4a } } - if len(m.ProviderPaymentStorageList) > 0 { - for iNdEx := len(m.ProviderPaymentStorageList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.UniqueEpochSessions) > 0 { + for iNdEx := len(m.UniqueEpochSessions) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ProviderPaymentStorageList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.UniqueEpochSessions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -329,13 +635,33 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x42 + } + } + { + size, err := m.ProviderQosFS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size, err := m.BadgesTS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - if len(m.UniquePaymentStorageClientProviderList) > 0 { - for iNdEx := len(m.UniquePaymentStorageClientProviderList) - 1; iNdEx >= 0; iNdEx-- { + i-- + dAtA[i] = 0x32 + if len(m.BadgeUsedCuList) > 0 { + for iNdEx := len(m.BadgeUsedCuList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.UniquePaymentStorageClientProviderList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.BadgeUsedCuList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -343,7 +669,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x2a } } { @@ -359,22 +685,239 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *UniqueEpochSessionGenesis) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *BadgeUsedCu) Size() (n int) { - if m == nil { - return 0 - } - var l int + +func (m *UniqueEpochSessionGenesis) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UniqueEpochSessionGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SessionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.SessionId)) + i-- + dAtA[i] = 0x28 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Project) > 0 { + i -= len(m.Project) + copy(dAtA[i:], m.Project) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Project))) + i-- + dAtA[i] = 0x1a + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x12 + } + if m.Epoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Epoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProviderEpochCuGenesis) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderEpochCuGenesis) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderEpochCuGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProviderEpochCu.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x12 + } + if m.Epoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Epoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProviderEpochComplainerCuGenesis) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderEpochComplainerCuGenesis) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderEpochComplainerCuGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProviderEpochComplainerCu.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x12 + } + if m.Epoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Epoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProviderConsumerEpochCuGenesis) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProviderConsumerEpochCuGenesis) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderConsumerEpochCuGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProviderConsumerEpochCu.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Project) > 0 { + i -= len(m.Project) + copy(dAtA[i:], m.Project) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Project))) + i-- + dAtA[i] = 0x1a + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x12 + } + if m.Epoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Epoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BadgeUsedCu) Size() (n int) { + if m == nil { + return 0 + } + var l int _ = l l = len(m.BadgeUsedCuKey) if l > 0 { @@ -394,44 +937,753 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - if len(m.UniquePaymentStorageClientProviderList) > 0 { - for _, e := range m.UniquePaymentStorageClientProviderList { + if len(m.BadgeUsedCuList) > 0 { + for _, e := range m.BadgeUsedCuList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.BadgesTS.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.ProviderQosFS.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.UniqueEpochSessions) > 0 { + for _, e := range m.UniqueEpochSessions { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.ProviderPaymentStorageList) > 0 { - for _, e := range m.ProviderPaymentStorageList { + if len(m.ProviderEpochCus) > 0 { + for _, e := range m.ProviderEpochCus { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.EpochPaymentsList) > 0 { - for _, e := range m.EpochPaymentsList { + if len(m.ProviderEpochComplainedCus) > 0 { + for _, e := range m.ProviderEpochComplainedCus { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.BadgeUsedCuList) > 0 { - for _, e := range m.BadgeUsedCuList { + if len(m.ProviderConsumerEpochCus) > 0 { + for _, e := range m.ProviderConsumerEpochCus { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - l = m.BadgesTS.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.ProviderQosFS.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} + return n +} + +func (m *UniqueEpochSessionGenesis) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Epoch != 0 { + n += 1 + sovGenesis(uint64(m.Epoch)) + } + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Project) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.SessionId != 0 { + n += 1 + sovGenesis(uint64(m.SessionId)) + } + return n +} + +func (m *ProviderEpochCuGenesis) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Epoch != 0 { + n += 1 + sovGenesis(uint64(m.Epoch)) + } + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ProviderEpochCu.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *ProviderEpochComplainerCuGenesis) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Epoch != 0 { + n += 1 + sovGenesis(uint64(m.Epoch)) + } + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ProviderEpochComplainerCu.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *ProviderConsumerEpochCuGenesis) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Epoch != 0 { + n += 1 + sovGenesis(uint64(m.Epoch)) + } + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Project) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ProviderConsumerEpochCu.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BadgeUsedCu: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BadgeUsedCu: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BadgeUsedCuKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BadgeUsedCuKey = append(m.BadgeUsedCuKey[:0], dAtA[iNdEx:postIndex]...) + if m.BadgeUsedCuKey == nil { + m.BadgeUsedCuKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) + } + m.UsedCu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsedCu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BadgeUsedCuList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BadgeUsedCuList = append(m.BadgeUsedCuList, BadgeUsedCu{}) + if err := m.BadgeUsedCuList[len(m.BadgeUsedCuList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BadgesTS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BadgesTS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderQosFS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProviderQosFS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueEpochSessions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UniqueEpochSessions = append(m.UniqueEpochSessions, UniqueEpochSessionGenesis{}) + if err := m.UniqueEpochSessions[len(m.UniqueEpochSessions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderEpochCus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderEpochCus = append(m.ProviderEpochCus, ProviderEpochCuGenesis{}) + if err := m.ProviderEpochCus[len(m.ProviderEpochCus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderEpochComplainedCus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderEpochComplainedCus = append(m.ProviderEpochComplainedCus, ProviderEpochComplainerCuGenesis{}) + if err := m.ProviderEpochComplainedCus[len(m.ProviderEpochComplainedCus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderConsumerEpochCus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderConsumerEpochCus = append(m.ProviderConsumerEpochCus, ProviderConsumerEpochCuGenesis{}) + if err := m.ProviderConsumerEpochCus[len(m.ProviderConsumerEpochCus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UniqueEpochSessionGenesis) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UniqueEpochSessionGenesis: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UniqueEpochSessionGenesis: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) + } + m.Epoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Epoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Project = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", wireType) + } + m.SessionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SessionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { +func (m *ProviderEpochCuGenesis) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -454,17 +1706,36 @@ func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BadgeUsedCu: wiretype end group for non-group") + return fmt.Errorf("proto: ProviderEpochCuGenesis: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BadgeUsedCu: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProviderEpochCuGenesis: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) + } + m.Epoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Epoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BadgeUsedCuKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -474,31 +1745,61 @@ func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.BadgeUsedCuKey = append(m.BadgeUsedCuKey[:0], dAtA[iNdEx:postIndex]...) - if m.BadgeUsedCuKey == nil { - m.BadgeUsedCuKey = []byte{} + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderEpochCu", wireType) } - m.UsedCu = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -508,11 +1809,25 @@ func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.UsedCu |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProviderEpochCu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -534,7 +1849,7 @@ func (m *BadgeUsedCu) Unmarshal(dAtA []byte) error { } return nil } -func (m *GenesisState) Unmarshal(dAtA []byte) error { +func (m *ProviderEpochComplainerCuGenesis) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -557,17 +1872,36 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + return fmt.Errorf("proto: ProviderEpochComplainerCuGenesis: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProviderEpochComplainerCuGenesis: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) + } + m.Epoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Epoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -577,30 +1911,29 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UniquePaymentStorageClientProviderList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -610,29 +1943,27 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.UniquePaymentStorageClientProviderList = append(m.UniquePaymentStorageClientProviderList, UniquePaymentStorageClientProvider{}) - if err := m.UniquePaymentStorageClientProviderList[len(m.UniquePaymentStorageClientProviderList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderPaymentStorageList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderEpochComplainerCu", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -659,16 +1990,84 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderPaymentStorageList = append(m.ProviderPaymentStorageList, ProviderPaymentStorage{}) - if err := m.ProviderPaymentStorageList[len(m.ProviderPaymentStorageList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ProviderEpochComplainerCu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProviderConsumerEpochCuGenesis) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProviderConsumerEpochCuGenesis: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderConsumerEpochCuGenesis: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) + } + m.Epoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Epoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochPaymentsList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -678,31 +2077,29 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.EpochPaymentsList = append(m.EpochPaymentsList, EpochPayments{}) - if err := m.EpochPaymentsList[len(m.EpochPaymentsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BadgeUsedCuList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -712,31 +2109,29 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.BadgeUsedCuList = append(m.BadgeUsedCuList, BadgeUsedCu{}) - if err := m.BadgeUsedCuList[len(m.BadgeUsedCuList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Project = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BadgesTS", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -746,28 +2141,27 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BadgesTS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderQosFS", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderConsumerEpochCu", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -794,7 +2188,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ProviderQosFS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ProviderConsumerEpochCu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/pairing/types/genesis_test.go b/x/pairing/types/genesis_test.go index 7e1bb7172c..416d467cb9 100644 --- a/x/pairing/types/genesis_test.go +++ b/x/pairing/types/genesis_test.go @@ -22,28 +22,64 @@ func TestGenesisState_Validate(t *testing.T) { desc: "valid genesis state", genState: &types.GenesisState{ Params: types.DefaultParams(), - UniquePaymentStorageClientProviderList: []types.UniquePaymentStorageClientProvider{ + UniqueEpochSessions: []types.UniqueEpochSessionGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + SessionId: 0, }, { - Index: "1", + Epoch: 1, + Provider: "1", + Project: "1", + ChainId: "1", + SessionId: 1, }, }, - ProviderPaymentStorageList: []types.ProviderPaymentStorage{ + ProviderEpochCus: []types.ProviderEpochCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 10}, }, { - Index: "1", + Epoch: 1, + Provider: "1", + ChainId: "1", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 20}, }, }, - EpochPaymentsList: []types.EpochPayments{ + ProviderEpochComplainedCus: []types.ProviderEpochComplainerCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 100}, }, { - Index: "1", + Epoch: 1, + Provider: "1", + ChainId: "1", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 200}, + }, + }, + ProviderConsumerEpochCus: []types.ProviderConsumerEpochCuGenesis{ + { + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 10}, + }, + { + Epoch: 1, + Provider: "1", + Project: "1", + ChainId: "1", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 20}, }, }, // this line is used by starport scaffolding # types/genesis/validField @@ -51,30 +87,66 @@ func TestGenesisState_Validate(t *testing.T) { valid: true, }, { - desc: "duplicated uniquePaymentStorageClientProvider", + desc: "duplicated UniqueEpochSessions", genState: &types.GenesisState{ Params: types.DefaultParams(), - UniquePaymentStorageClientProviderList: []types.UniquePaymentStorageClientProvider{ + UniqueEpochSessions: []types.UniqueEpochSessionGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + SessionId: 0, }, { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + SessionId: 0, }, }, }, valid: false, }, { - desc: "duplicated providerPaymentStorage", + desc: "duplicated ProviderEpochCus", + genState: &types.GenesisState{ + Params: types.DefaultParams(), + ProviderEpochCus: []types.ProviderEpochCuGenesis{ + { + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 10}, + }, + { + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochCu: types.ProviderEpochCu{ServicedCu: 10}, + }, + }, + }, + valid: false, + }, + + { + desc: "duplicated ProviderEpochCus", genState: &types.GenesisState{ Params: types.DefaultParams(), - ProviderPaymentStorageList: []types.ProviderPaymentStorage{ + ProviderEpochComplainedCus: []types.ProviderEpochComplainerCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 200}, }, { - Index: "0", + Epoch: 0, + Provider: "0", + ChainId: "0", + ProviderEpochComplainerCu: types.ProviderEpochComplainerCu{ComplainersCu: 200}, }, }, }, @@ -84,12 +156,20 @@ func TestGenesisState_Validate(t *testing.T) { desc: "duplicated epochPayments", genState: &types.GenesisState{ Params: types.DefaultParams(), - EpochPaymentsList: []types.EpochPayments{ + ProviderConsumerEpochCus: []types.ProviderConsumerEpochCuGenesis{ { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 10}, }, { - Index: "0", + Epoch: 0, + Provider: "0", + Project: "0", + ChainId: "0", + ProviderConsumerEpochCu: types.ProviderConsumerEpochCu{Cu: 10}, }, }, }, diff --git a/x/pairing/types/key_epoch_payments.go b/x/pairing/types/key_epoch_payments.go deleted file mode 100644 index 9aa7a1c85a..0000000000 --- a/x/pairing/types/key_epoch_payments.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // EpochPaymentsKeyPrefix is the prefix to retrieve all EpochPayments - EpochPaymentsKeyPrefix = "EpochPayments/value/" -) - -// EpochPaymentsKey returns the store key to retrieve a EpochPayments from the index fields -func EpochPaymentsKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/pairing/types/key_provider_payment_storage.go b/x/pairing/types/key_provider_payment_storage.go deleted file mode 100644 index 3130113a07..0000000000 --- a/x/pairing/types/key_provider_payment_storage.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // ProviderPaymentStorageKeyPrefix is the prefix to retrieve all ProviderPaymentStorage - ProviderPaymentStorageKeyPrefix = "ProviderPaymentStorage/value/" -) - -// ProviderPaymentStorageKey returns the store key to retrieve a ProviderPaymentStorage from the index fields -func ProviderPaymentStorageKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/pairing/types/key_unique_payment_storage_client_provider.go b/x/pairing/types/key_unique_payment_storage_client_provider.go deleted file mode 100644 index 0f331b2324..0000000000 --- a/x/pairing/types/key_unique_payment_storage_client_provider.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // UniquePaymentStorageClientProviderKeyPrefix is the prefix to retrieve all UniquePaymentStorageClientProvider - UniquePaymentStorageClientProviderKeyPrefix = "UniquePaymentStorageClientProvider/value/" -) - -// UniquePaymentStorageClientProviderKey returns the store key to retrieve a UniquePaymentStorageClientProvider from the index fields -func UniquePaymentStorageClientProviderKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/pairing/types/query.pb.go b/x/pairing/types/query.pb.go index 04e8332bcc..4399afba3d 100644 --- a/x/pairing/types/query.pb.go +++ b/x/pairing/types/query.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -479,26 +479,24 @@ func (m *QueryVerifyPairingResponse) GetProjectId() string { return "" } -type QueryGetUniquePaymentStorageClientProviderRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +type QueryUserEntryRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` + Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) Reset() { - *m = QueryGetUniquePaymentStorageClientProviderRequest{} -} -func (m *QueryGetUniquePaymentStorageClientProviderRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryGetUniquePaymentStorageClientProviderRequest) ProtoMessage() {} -func (*QueryGetUniquePaymentStorageClientProviderRequest) Descriptor() ([]byte, []int) { +func (m *QueryUserEntryRequest) Reset() { *m = QueryUserEntryRequest{} } +func (m *QueryUserEntryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUserEntryRequest) ProtoMessage() {} +func (*QueryUserEntryRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{8} } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryUserEntryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryUserEntryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryUserEntryRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -508,45 +506,56 @@ func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_Marshal(b []byte return b[:n], nil } } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderRequest.Merge(m, src) +func (m *QueryUserEntryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserEntryRequest.Merge(m, src) } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_Size() int { +func (m *QueryUserEntryRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderRequest.DiscardUnknown(m) +func (m *QueryUserEntryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserEntryRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryUserEntryRequest proto.InternalMessageInfo -func (m *QueryGetUniquePaymentStorageClientProviderRequest) GetIndex() string { +func (m *QueryUserEntryRequest) GetAddress() string { if m != nil { - return m.Index + return m.Address } return "" } -type QueryGetUniquePaymentStorageClientProviderResponse struct { - UniquePaymentStorageClientProvider UniquePaymentStorageClientProvider `protobuf:"bytes,1,opt,name=uniquePaymentStorageClientProvider,proto3" json:"uniquePaymentStorageClientProvider"` +func (m *QueryUserEntryRequest) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) Reset() { - *m = QueryGetUniquePaymentStorageClientProviderResponse{} +func (m *QueryUserEntryRequest) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) String() string { - return proto.CompactTextString(m) + +type QueryUserEntryResponse struct { + Consumer types.StakeEntry `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer"` + MaxCU uint64 `protobuf:"varint,2,opt,name=maxCU,proto3" json:"maxCU,omitempty"` } -func (*QueryGetUniquePaymentStorageClientProviderResponse) ProtoMessage() {} -func (*QueryGetUniquePaymentStorageClientProviderResponse) Descriptor() ([]byte, []int) { + +func (m *QueryUserEntryResponse) Reset() { *m = QueryUserEntryResponse{} } +func (m *QueryUserEntryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryUserEntryResponse) ProtoMessage() {} +func (*QueryUserEntryResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{9} } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryUserEntryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryUserEntryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryUserEntryResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -556,45 +565,48 @@ func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_Marshal(b []byt return b[:n], nil } } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderResponse.Merge(m, src) +func (m *QueryUserEntryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserEntryResponse.Merge(m, src) } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_Size() int { +func (m *QueryUserEntryResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderResponse.DiscardUnknown(m) +func (m *QueryUserEntryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserEntryResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetUniquePaymentStorageClientProviderResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryUserEntryResponse proto.InternalMessageInfo -func (m *QueryGetUniquePaymentStorageClientProviderResponse) GetUniquePaymentStorageClientProvider() UniquePaymentStorageClientProvider { +func (m *QueryUserEntryResponse) GetConsumer() types.StakeEntry { if m != nil { - return m.UniquePaymentStorageClientProvider + return m.Consumer } - return UniquePaymentStorageClientProvider{} + return types.StakeEntry{} } -type QueryAllUniquePaymentStorageClientProviderRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (m *QueryUserEntryResponse) GetMaxCU() uint64 { + if m != nil { + return m.MaxCU + } + return 0 } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) Reset() { - *m = QueryAllUniquePaymentStorageClientProviderRequest{} -} -func (m *QueryAllUniquePaymentStorageClientProviderRequest) String() string { - return proto.CompactTextString(m) +type QueryStaticProvidersListRequest struct { + ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` } -func (*QueryAllUniquePaymentStorageClientProviderRequest) ProtoMessage() {} -func (*QueryAllUniquePaymentStorageClientProviderRequest) Descriptor() ([]byte, []int) { + +func (m *QueryStaticProvidersListRequest) Reset() { *m = QueryStaticProvidersListRequest{} } +func (m *QueryStaticProvidersListRequest) String() string { return proto.CompactTextString(m) } +func (*QueryStaticProvidersListRequest) ProtoMessage() {} +func (*QueryStaticProvidersListRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{10} } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryStaticProvidersListRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryStaticProvidersListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryStaticProvidersListRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -604,46 +616,41 @@ func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_Marshal(b []byte return b[:n], nil } } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderRequest.Merge(m, src) +func (m *QueryStaticProvidersListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStaticProvidersListRequest.Merge(m, src) } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_Size() int { +func (m *QueryStaticProvidersListRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderRequest.DiscardUnknown(m) +func (m *QueryStaticProvidersListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStaticProvidersListRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryStaticProvidersListRequest proto.InternalMessageInfo -func (m *QueryAllUniquePaymentStorageClientProviderRequest) GetPagination() *query.PageRequest { +func (m *QueryStaticProvidersListRequest) GetChainID() string { if m != nil { - return m.Pagination + return m.ChainID } - return nil + return "" } -type QueryAllUniquePaymentStorageClientProviderResponse struct { - UniquePaymentStorageClientProvider []UniquePaymentStorageClientProvider `protobuf:"bytes,1,rep,name=uniquePaymentStorageClientProvider,proto3" json:"uniquePaymentStorageClientProvider"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +type QueryStaticProvidersListResponse struct { + Providers []types.StakeEntry `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers"` } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) Reset() { - *m = QueryAllUniquePaymentStorageClientProviderResponse{} -} -func (m *QueryAllUniquePaymentStorageClientProviderResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryAllUniquePaymentStorageClientProviderResponse) ProtoMessage() {} -func (*QueryAllUniquePaymentStorageClientProviderResponse) Descriptor() ([]byte, []int) { +func (m *QueryStaticProvidersListResponse) Reset() { *m = QueryStaticProvidersListResponse{} } +func (m *QueryStaticProvidersListResponse) String() string { return proto.CompactTextString(m) } +func (*QueryStaticProvidersListResponse) ProtoMessage() {} +func (*QueryStaticProvidersListResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{11} } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryStaticProvidersListResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryStaticProvidersListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryStaticProvidersListResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -653,48 +660,42 @@ func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_Marshal(b []byt return b[:n], nil } } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderResponse.Merge(m, src) +func (m *QueryStaticProvidersListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStaticProvidersListResponse.Merge(m, src) } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_Size() int { +func (m *QueryStaticProvidersListResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderResponse.DiscardUnknown(m) +func (m *QueryStaticProvidersListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStaticProvidersListResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllUniquePaymentStorageClientProviderResponse proto.InternalMessageInfo - -func (m *QueryAllUniquePaymentStorageClientProviderResponse) GetUniquePaymentStorageClientProvider() []UniquePaymentStorageClientProvider { - if m != nil { - return m.UniquePaymentStorageClientProvider - } - return nil -} +var xxx_messageInfo_QueryStaticProvidersListResponse proto.InternalMessageInfo -func (m *QueryAllUniquePaymentStorageClientProviderResponse) GetPagination() *query.PageResponse { +func (m *QueryStaticProvidersListResponse) GetProviders() []types.StakeEntry { if m != nil { - return m.Pagination + return m.Providers } return nil } -type QueryGetProviderPaymentStorageRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +type QueryEffectivePolicyRequest struct { + Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` + SpecID string `protobuf:"bytes,2,opt,name=specID,proto3" json:"specID,omitempty"` } -func (m *QueryGetProviderPaymentStorageRequest) Reset() { *m = QueryGetProviderPaymentStorageRequest{} } -func (m *QueryGetProviderPaymentStorageRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetProviderPaymentStorageRequest) ProtoMessage() {} -func (*QueryGetProviderPaymentStorageRequest) Descriptor() ([]byte, []int) { +func (m *QueryEffectivePolicyRequest) Reset() { *m = QueryEffectivePolicyRequest{} } +func (m *QueryEffectivePolicyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEffectivePolicyRequest) ProtoMessage() {} +func (*QueryEffectivePolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{12} } -func (m *QueryGetProviderPaymentStorageRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryEffectivePolicyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetProviderPaymentStorageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryEffectivePolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetProviderPaymentStorageRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryEffectivePolicyRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -704,43 +705,49 @@ func (m *QueryGetProviderPaymentStorageRequest) XXX_Marshal(b []byte, determinis return b[:n], nil } } -func (m *QueryGetProviderPaymentStorageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetProviderPaymentStorageRequest.Merge(m, src) +func (m *QueryEffectivePolicyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEffectivePolicyRequest.Merge(m, src) } -func (m *QueryGetProviderPaymentStorageRequest) XXX_Size() int { +func (m *QueryEffectivePolicyRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetProviderPaymentStorageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetProviderPaymentStorageRequest.DiscardUnknown(m) +func (m *QueryEffectivePolicyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEffectivePolicyRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetProviderPaymentStorageRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryEffectivePolicyRequest proto.InternalMessageInfo -func (m *QueryGetProviderPaymentStorageRequest) GetIndex() string { +func (m *QueryEffectivePolicyRequest) GetConsumer() string { if m != nil { - return m.Index + return m.Consumer } return "" } -type QueryGetProviderPaymentStorageResponse struct { - ProviderPaymentStorage ProviderPaymentStorage `protobuf:"bytes,1,opt,name=providerPaymentStorage,proto3" json:"providerPaymentStorage"` +func (m *QueryEffectivePolicyRequest) GetSpecID() string { + if m != nil { + return m.SpecID + } + return "" } -func (m *QueryGetProviderPaymentStorageResponse) Reset() { - *m = QueryGetProviderPaymentStorageResponse{} +type QueryEffectivePolicyResponse struct { + Policy *types1.Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` + PendingPolicy *types1.Policy `protobuf:"bytes,2,opt,name=pending_policy,json=pendingPolicy,proto3" json:"pending_policy,omitempty"` } -func (m *QueryGetProviderPaymentStorageResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetProviderPaymentStorageResponse) ProtoMessage() {} -func (*QueryGetProviderPaymentStorageResponse) Descriptor() ([]byte, []int) { + +func (m *QueryEffectivePolicyResponse) Reset() { *m = QueryEffectivePolicyResponse{} } +func (m *QueryEffectivePolicyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEffectivePolicyResponse) ProtoMessage() {} +func (*QueryEffectivePolicyResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{13} } -func (m *QueryGetProviderPaymentStorageResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryEffectivePolicyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetProviderPaymentStorageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryEffectivePolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetProviderPaymentStorageResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryEffectivePolicyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -750,41 +757,51 @@ func (m *QueryGetProviderPaymentStorageResponse) XXX_Marshal(b []byte, determini return b[:n], nil } } -func (m *QueryGetProviderPaymentStorageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetProviderPaymentStorageResponse.Merge(m, src) +func (m *QueryEffectivePolicyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEffectivePolicyResponse.Merge(m, src) } -func (m *QueryGetProviderPaymentStorageResponse) XXX_Size() int { +func (m *QueryEffectivePolicyResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetProviderPaymentStorageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetProviderPaymentStorageResponse.DiscardUnknown(m) +func (m *QueryEffectivePolicyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEffectivePolicyResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetProviderPaymentStorageResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryEffectivePolicyResponse proto.InternalMessageInfo + +func (m *QueryEffectivePolicyResponse) GetPolicy() *types1.Policy { + if m != nil { + return m.Policy + } + return nil +} -func (m *QueryGetProviderPaymentStorageResponse) GetProviderPaymentStorage() ProviderPaymentStorage { +func (m *QueryEffectivePolicyResponse) GetPendingPolicy() *types1.Policy { if m != nil { - return m.ProviderPaymentStorage + return m.PendingPolicy } - return ProviderPaymentStorage{} + return nil } -type QueryAllProviderPaymentStorageRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +type QuerySdkPairingResponse struct { + Pairing *QueryGetPairingResponse `protobuf:"bytes,1,opt,name=pairing,proto3" json:"pairing,omitempty"` + MaxCu uint64 `protobuf:"varint,2,opt,name=max_cu,json=maxCu,proto3" json:"max_cu,omitempty"` + Spec *types2.Spec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + DowntimeParams *v1.Params `protobuf:"bytes,4,opt,name=downtime_params,json=downtimeParams,proto3" json:"downtime_params,omitempty"` } -func (m *QueryAllProviderPaymentStorageRequest) Reset() { *m = QueryAllProviderPaymentStorageRequest{} } -func (m *QueryAllProviderPaymentStorageRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllProviderPaymentStorageRequest) ProtoMessage() {} -func (*QueryAllProviderPaymentStorageRequest) Descriptor() ([]byte, []int) { +func (m *QuerySdkPairingResponse) Reset() { *m = QuerySdkPairingResponse{} } +func (m *QuerySdkPairingResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySdkPairingResponse) ProtoMessage() {} +func (*QuerySdkPairingResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{14} } -func (m *QueryAllProviderPaymentStorageRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySdkPairingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllProviderPaymentStorageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySdkPairingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllProviderPaymentStorageRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySdkPairingResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -794,95 +811,62 @@ func (m *QueryAllProviderPaymentStorageRequest) XXX_Marshal(b []byte, determinis return b[:n], nil } } -func (m *QueryAllProviderPaymentStorageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllProviderPaymentStorageRequest.Merge(m, src) +func (m *QuerySdkPairingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySdkPairingResponse.Merge(m, src) } -func (m *QueryAllProviderPaymentStorageRequest) XXX_Size() int { +func (m *QuerySdkPairingResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllProviderPaymentStorageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllProviderPaymentStorageRequest.DiscardUnknown(m) +func (m *QuerySdkPairingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySdkPairingResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllProviderPaymentStorageRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySdkPairingResponse proto.InternalMessageInfo -func (m *QueryAllProviderPaymentStorageRequest) GetPagination() *query.PageRequest { +func (m *QuerySdkPairingResponse) GetPairing() *QueryGetPairingResponse { if m != nil { - return m.Pagination + return m.Pairing } return nil } -type QueryAllProviderPaymentStorageResponse struct { - ProviderPaymentStorage []ProviderPaymentStorage `protobuf:"bytes,1,rep,name=providerPaymentStorage,proto3" json:"providerPaymentStorage"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllProviderPaymentStorageResponse) Reset() { - *m = QueryAllProviderPaymentStorageResponse{} -} -func (m *QueryAllProviderPaymentStorageResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllProviderPaymentStorageResponse) ProtoMessage() {} -func (*QueryAllProviderPaymentStorageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{15} -} -func (m *QueryAllProviderPaymentStorageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllProviderPaymentStorageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllProviderPaymentStorageResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *QuerySdkPairingResponse) GetMaxCu() uint64 { + if m != nil { + return m.MaxCu } + return 0 } -func (m *QueryAllProviderPaymentStorageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllProviderPaymentStorageResponse.Merge(m, src) -} -func (m *QueryAllProviderPaymentStorageResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllProviderPaymentStorageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllProviderPaymentStorageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllProviderPaymentStorageResponse proto.InternalMessageInfo -func (m *QueryAllProviderPaymentStorageResponse) GetProviderPaymentStorage() []ProviderPaymentStorage { +func (m *QuerySdkPairingResponse) GetSpec() *types2.Spec { if m != nil { - return m.ProviderPaymentStorage + return m.Spec } return nil } -func (m *QueryAllProviderPaymentStorageResponse) GetPagination() *query.PageResponse { +func (m *QuerySdkPairingResponse) GetDowntimeParams() *v1.Params { if m != nil { - return m.Pagination + return m.DowntimeParams } return nil } -type QueryGetEpochPaymentsRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +type QueryProviderMonthlyPayoutRequest struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` } -func (m *QueryGetEpochPaymentsRequest) Reset() { *m = QueryGetEpochPaymentsRequest{} } -func (m *QueryGetEpochPaymentsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetEpochPaymentsRequest) ProtoMessage() {} -func (*QueryGetEpochPaymentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{16} +func (m *QueryProviderMonthlyPayoutRequest) Reset() { *m = QueryProviderMonthlyPayoutRequest{} } +func (m *QueryProviderMonthlyPayoutRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProviderMonthlyPayoutRequest) ProtoMessage() {} +func (*QueryProviderMonthlyPayoutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{15} } -func (m *QueryGetEpochPaymentsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryProviderMonthlyPayoutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetEpochPaymentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryProviderMonthlyPayoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetEpochPaymentsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryProviderMonthlyPayoutRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -892,41 +876,43 @@ func (m *QueryGetEpochPaymentsRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryGetEpochPaymentsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetEpochPaymentsRequest.Merge(m, src) +func (m *QueryProviderMonthlyPayoutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderMonthlyPayoutRequest.Merge(m, src) } -func (m *QueryGetEpochPaymentsRequest) XXX_Size() int { +func (m *QueryProviderMonthlyPayoutRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetEpochPaymentsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetEpochPaymentsRequest.DiscardUnknown(m) +func (m *QueryProviderMonthlyPayoutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderMonthlyPayoutRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetEpochPaymentsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryProviderMonthlyPayoutRequest proto.InternalMessageInfo -func (m *QueryGetEpochPaymentsRequest) GetIndex() string { +func (m *QueryProviderMonthlyPayoutRequest) GetProvider() string { if m != nil { - return m.Index + return m.Provider } return "" } -type QueryGetEpochPaymentsResponse struct { - EpochPayments EpochPayments `protobuf:"bytes,1,opt,name=epochPayments,proto3" json:"epochPayments"` +type SubscriptionPayout struct { + Subscription string `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` } -func (m *QueryGetEpochPaymentsResponse) Reset() { *m = QueryGetEpochPaymentsResponse{} } -func (m *QueryGetEpochPaymentsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetEpochPaymentsResponse) ProtoMessage() {} -func (*QueryGetEpochPaymentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{17} +func (m *SubscriptionPayout) Reset() { *m = SubscriptionPayout{} } +func (m *SubscriptionPayout) String() string { return proto.CompactTextString(m) } +func (*SubscriptionPayout) ProtoMessage() {} +func (*SubscriptionPayout) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{16} } -func (m *QueryGetEpochPaymentsResponse) XXX_Unmarshal(b []byte) error { +func (m *SubscriptionPayout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetEpochPaymentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SubscriptionPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetEpochPaymentsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_SubscriptionPayout.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -936,42 +922,57 @@ func (m *QueryGetEpochPaymentsResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryGetEpochPaymentsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetEpochPaymentsResponse.Merge(m, src) +func (m *SubscriptionPayout) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscriptionPayout.Merge(m, src) } -func (m *QueryGetEpochPaymentsResponse) XXX_Size() int { +func (m *SubscriptionPayout) XXX_Size() int { return m.Size() } -func (m *QueryGetEpochPaymentsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetEpochPaymentsResponse.DiscardUnknown(m) +func (m *SubscriptionPayout) XXX_DiscardUnknown() { + xxx_messageInfo_SubscriptionPayout.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetEpochPaymentsResponse proto.InternalMessageInfo +var xxx_messageInfo_SubscriptionPayout proto.InternalMessageInfo -func (m *QueryGetEpochPaymentsResponse) GetEpochPayments() EpochPayments { +func (m *SubscriptionPayout) GetSubscription() string { if m != nil { - return m.EpochPayments + return m.Subscription } - return EpochPayments{} + return "" } -type QueryAllEpochPaymentsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (m *SubscriptionPayout) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" } -func (m *QueryAllEpochPaymentsRequest) Reset() { *m = QueryAllEpochPaymentsRequest{} } -func (m *QueryAllEpochPaymentsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllEpochPaymentsRequest) ProtoMessage() {} -func (*QueryAllEpochPaymentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{18} -} -func (m *QueryAllEpochPaymentsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *SubscriptionPayout) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 } -func (m *QueryAllEpochPaymentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllEpochPaymentsRequest.Marshal(b, m, deterministic) - } else { + +type QueryProviderMonthlyPayoutResponse struct { + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Details []*SubscriptionPayout `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` +} + +func (m *QueryProviderMonthlyPayoutResponse) Reset() { *m = QueryProviderMonthlyPayoutResponse{} } +func (m *QueryProviderMonthlyPayoutResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProviderMonthlyPayoutResponse) ProtoMessage() {} +func (*QueryProviderMonthlyPayoutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{17} +} +func (m *QueryProviderMonthlyPayoutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProviderMonthlyPayoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProviderMonthlyPayoutResponse.Marshal(b, m, deterministic) + } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -980,42 +981,49 @@ func (m *QueryAllEpochPaymentsRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryAllEpochPaymentsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllEpochPaymentsRequest.Merge(m, src) +func (m *QueryProviderMonthlyPayoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderMonthlyPayoutResponse.Merge(m, src) } -func (m *QueryAllEpochPaymentsRequest) XXX_Size() int { +func (m *QueryProviderMonthlyPayoutResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllEpochPaymentsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllEpochPaymentsRequest.DiscardUnknown(m) +func (m *QueryProviderMonthlyPayoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderMonthlyPayoutResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllEpochPaymentsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryProviderMonthlyPayoutResponse proto.InternalMessageInfo + +func (m *QueryProviderMonthlyPayoutResponse) GetTotal() uint64 { + if m != nil { + return m.Total + } + return 0 +} -func (m *QueryAllEpochPaymentsRequest) GetPagination() *query.PageRequest { +func (m *QueryProviderMonthlyPayoutResponse) GetDetails() []*SubscriptionPayout { if m != nil { - return m.Pagination + return m.Details } return nil } -type QueryAllEpochPaymentsResponse struct { - EpochPayments []EpochPayments `protobuf:"bytes,1,rep,name=epochPayments,proto3" json:"epochPayments"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +type ProviderPayout struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` } -func (m *QueryAllEpochPaymentsResponse) Reset() { *m = QueryAllEpochPaymentsResponse{} } -func (m *QueryAllEpochPaymentsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllEpochPaymentsResponse) ProtoMessage() {} -func (*QueryAllEpochPaymentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{19} +func (m *ProviderPayout) Reset() { *m = ProviderPayout{} } +func (m *ProviderPayout) String() string { return proto.CompactTextString(m) } +func (*ProviderPayout) ProtoMessage() {} +func (*ProviderPayout) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{18} } -func (m *QueryAllEpochPaymentsResponse) XXX_Unmarshal(b []byte) error { +func (m *ProviderPayout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllEpochPaymentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProviderPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllEpochPaymentsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ProviderPayout.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1025,50 +1033,49 @@ func (m *QueryAllEpochPaymentsResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryAllEpochPaymentsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllEpochPaymentsResponse.Merge(m, src) +func (m *ProviderPayout) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderPayout.Merge(m, src) } -func (m *QueryAllEpochPaymentsResponse) XXX_Size() int { +func (m *ProviderPayout) XXX_Size() int { return m.Size() } -func (m *QueryAllEpochPaymentsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllEpochPaymentsResponse.DiscardUnknown(m) +func (m *ProviderPayout) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderPayout.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllEpochPaymentsResponse proto.InternalMessageInfo +var xxx_messageInfo_ProviderPayout proto.InternalMessageInfo -func (m *QueryAllEpochPaymentsResponse) GetEpochPayments() []EpochPayments { +func (m *ProviderPayout) GetProvider() string { if m != nil { - return m.EpochPayments + return m.Provider } - return nil + return "" } -func (m *QueryAllEpochPaymentsResponse) GetPagination() *query.PageResponse { +func (m *ProviderPayout) GetAmount() uint64 { if m != nil { - return m.Pagination + return m.Amount } - return nil + return 0 } -type QueryUserEntryRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` +type ChainIDPayout struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Payouts []*ProviderPayout `protobuf:"bytes,2,rep,name=payouts,proto3" json:"payouts,omitempty"` } -func (m *QueryUserEntryRequest) Reset() { *m = QueryUserEntryRequest{} } -func (m *QueryUserEntryRequest) String() string { return proto.CompactTextString(m) } -func (*QueryUserEntryRequest) ProtoMessage() {} -func (*QueryUserEntryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{20} +func (m *ChainIDPayout) Reset() { *m = ChainIDPayout{} } +func (m *ChainIDPayout) String() string { return proto.CompactTextString(m) } +func (*ChainIDPayout) ProtoMessage() {} +func (*ChainIDPayout) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{19} } -func (m *QueryUserEntryRequest) XXX_Unmarshal(b []byte) error { +func (m *ChainIDPayout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryUserEntryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ChainIDPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryUserEntryRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ChainIDPayout.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1078,56 +1085,95 @@ func (m *QueryUserEntryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryUserEntryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUserEntryRequest.Merge(m, src) +func (m *ChainIDPayout) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainIDPayout.Merge(m, src) } -func (m *QueryUserEntryRequest) XXX_Size() int { +func (m *ChainIDPayout) XXX_Size() int { return m.Size() } -func (m *QueryUserEntryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUserEntryRequest.DiscardUnknown(m) +func (m *ChainIDPayout) XXX_DiscardUnknown() { + xxx_messageInfo_ChainIDPayout.DiscardUnknown(m) } -var xxx_messageInfo_QueryUserEntryRequest proto.InternalMessageInfo +var xxx_messageInfo_ChainIDPayout proto.InternalMessageInfo -func (m *QueryUserEntryRequest) GetAddress() string { +func (m *ChainIDPayout) GetChainId() string { if m != nil { - return m.Address + return m.ChainId } return "" } -func (m *QueryUserEntryRequest) GetChainID() string { +func (m *ChainIDPayout) GetPayouts() []*ProviderPayout { if m != nil { - return m.ChainID + return m.Payouts } - return "" + return nil } -func (m *QueryUserEntryRequest) GetBlock() uint64 { +type QuerySubscriptionMonthlyPayoutRequest struct { + Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` +} + +func (m *QuerySubscriptionMonthlyPayoutRequest) Reset() { *m = QuerySubscriptionMonthlyPayoutRequest{} } +func (m *QuerySubscriptionMonthlyPayoutRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySubscriptionMonthlyPayoutRequest) ProtoMessage() {} +func (*QuerySubscriptionMonthlyPayoutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e149ce9d21da0d8, []int{20} +} +func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.Merge(m, src) +} +func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest proto.InternalMessageInfo + +func (m *QuerySubscriptionMonthlyPayoutRequest) GetConsumer() string { if m != nil { - return m.Block + return m.Consumer } - return 0 + return "" } -type QueryUserEntryResponse struct { - Consumer types.StakeEntry `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer"` - MaxCU uint64 `protobuf:"varint,2,opt,name=maxCU,proto3" json:"maxCU,omitempty"` +type QuerySubscriptionMonthlyPayoutResponse struct { + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Details []*ChainIDPayout `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (m *QueryUserEntryResponse) Reset() { *m = QueryUserEntryResponse{} } -func (m *QueryUserEntryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryUserEntryResponse) ProtoMessage() {} -func (*QueryUserEntryResponse) Descriptor() ([]byte, []int) { +func (m *QuerySubscriptionMonthlyPayoutResponse) Reset() { + *m = QuerySubscriptionMonthlyPayoutResponse{} +} +func (m *QuerySubscriptionMonthlyPayoutResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySubscriptionMonthlyPayoutResponse) ProtoMessage() {} +func (*QuerySubscriptionMonthlyPayoutResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{21} } -func (m *QueryUserEntryResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryUserEntryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryUserEntryResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1137,48 +1183,47 @@ func (m *QueryUserEntryResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryUserEntryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUserEntryResponse.Merge(m, src) +func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.Merge(m, src) } -func (m *QueryUserEntryResponse) XXX_Size() int { +func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Size() int { return m.Size() } -func (m *QueryUserEntryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUserEntryResponse.DiscardUnknown(m) +func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryUserEntryResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse proto.InternalMessageInfo -func (m *QueryUserEntryResponse) GetConsumer() types.StakeEntry { +func (m *QuerySubscriptionMonthlyPayoutResponse) GetTotal() uint64 { if m != nil { - return m.Consumer + return m.Total } - return types.StakeEntry{} + return 0 } -func (m *QueryUserEntryResponse) GetMaxCU() uint64 { +func (m *QuerySubscriptionMonthlyPayoutResponse) GetDetails() []*ChainIDPayout { if m != nil { - return m.MaxCU + return m.Details } - return 0 + return nil } -type QueryStaticProvidersListRequest struct { - ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` +type QueryProvidersEpochCuRequest struct { } -func (m *QueryStaticProvidersListRequest) Reset() { *m = QueryStaticProvidersListRequest{} } -func (m *QueryStaticProvidersListRequest) String() string { return proto.CompactTextString(m) } -func (*QueryStaticProvidersListRequest) ProtoMessage() {} -func (*QueryStaticProvidersListRequest) Descriptor() ([]byte, []int) { +func (m *QueryProvidersEpochCuRequest) Reset() { *m = QueryProvidersEpochCuRequest{} } +func (m *QueryProvidersEpochCuRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProvidersEpochCuRequest) ProtoMessage() {} +func (*QueryProvidersEpochCuRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{22} } -func (m *QueryStaticProvidersListRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryProvidersEpochCuRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryStaticProvidersListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryProvidersEpochCuRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryStaticProvidersListRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryProvidersEpochCuRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1188,41 +1233,34 @@ func (m *QueryStaticProvidersListRequest) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *QueryStaticProvidersListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStaticProvidersListRequest.Merge(m, src) +func (m *QueryProvidersEpochCuRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProvidersEpochCuRequest.Merge(m, src) } -func (m *QueryStaticProvidersListRequest) XXX_Size() int { +func (m *QueryProvidersEpochCuRequest) XXX_Size() int { return m.Size() } -func (m *QueryStaticProvidersListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStaticProvidersListRequest.DiscardUnknown(m) +func (m *QueryProvidersEpochCuRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProvidersEpochCuRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryStaticProvidersListRequest proto.InternalMessageInfo - -func (m *QueryStaticProvidersListRequest) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} +var xxx_messageInfo_QueryProvidersEpochCuRequest proto.InternalMessageInfo -type QueryStaticProvidersListResponse struct { - Providers []types.StakeEntry `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers"` +type QueryProvidersEpochCuResponse struct { + Info []ProviderCuInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"` } -func (m *QueryStaticProvidersListResponse) Reset() { *m = QueryStaticProvidersListResponse{} } -func (m *QueryStaticProvidersListResponse) String() string { return proto.CompactTextString(m) } -func (*QueryStaticProvidersListResponse) ProtoMessage() {} -func (*QueryStaticProvidersListResponse) Descriptor() ([]byte, []int) { +func (m *QueryProvidersEpochCuResponse) Reset() { *m = QueryProvidersEpochCuResponse{} } +func (m *QueryProvidersEpochCuResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProvidersEpochCuResponse) ProtoMessage() {} +func (*QueryProvidersEpochCuResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{23} } -func (m *QueryStaticProvidersListResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryProvidersEpochCuResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryStaticProvidersListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryProvidersEpochCuResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryStaticProvidersListResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryProvidersEpochCuResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1232,42 +1270,42 @@ func (m *QueryStaticProvidersListResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QueryStaticProvidersListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStaticProvidersListResponse.Merge(m, src) +func (m *QueryProvidersEpochCuResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProvidersEpochCuResponse.Merge(m, src) } -func (m *QueryStaticProvidersListResponse) XXX_Size() int { +func (m *QueryProvidersEpochCuResponse) XXX_Size() int { return m.Size() } -func (m *QueryStaticProvidersListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStaticProvidersListResponse.DiscardUnknown(m) +func (m *QueryProvidersEpochCuResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProvidersEpochCuResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryStaticProvidersListResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryProvidersEpochCuResponse proto.InternalMessageInfo -func (m *QueryStaticProvidersListResponse) GetProviders() []types.StakeEntry { +func (m *QueryProvidersEpochCuResponse) GetInfo() []ProviderCuInfo { if m != nil { - return m.Providers + return m.Info } return nil } -type QueryEffectivePolicyRequest struct { - Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` - SpecID string `protobuf:"bytes,2,opt,name=specID,proto3" json:"specID,omitempty"` +type ProviderCuInfo struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + Cu uint64 `protobuf:"varint,2,opt,name=cu,proto3" json:"cu,omitempty"` } -func (m *QueryEffectivePolicyRequest) Reset() { *m = QueryEffectivePolicyRequest{} } -func (m *QueryEffectivePolicyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryEffectivePolicyRequest) ProtoMessage() {} -func (*QueryEffectivePolicyRequest) Descriptor() ([]byte, []int) { +func (m *ProviderCuInfo) Reset() { *m = ProviderCuInfo{} } +func (m *ProviderCuInfo) String() string { return proto.CompactTextString(m) } +func (*ProviderCuInfo) ProtoMessage() {} +func (*ProviderCuInfo) Descriptor() ([]byte, []int) { return fileDescriptor_9e149ce9d21da0d8, []int{24} } -func (m *QueryEffectivePolicyRequest) XXX_Unmarshal(b []byte) error { +func (m *ProviderCuInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryEffectivePolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProviderCuInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryEffectivePolicyRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ProviderCuInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1277,1357 +1315,1140 @@ func (m *QueryEffectivePolicyRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryEffectivePolicyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEffectivePolicyRequest.Merge(m, src) +func (m *ProviderCuInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderCuInfo.Merge(m, src) } -func (m *QueryEffectivePolicyRequest) XXX_Size() int { +func (m *ProviderCuInfo) XXX_Size() int { return m.Size() } -func (m *QueryEffectivePolicyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEffectivePolicyRequest.DiscardUnknown(m) +func (m *ProviderCuInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderCuInfo.DiscardUnknown(m) } -var xxx_messageInfo_QueryEffectivePolicyRequest proto.InternalMessageInfo +var xxx_messageInfo_ProviderCuInfo proto.InternalMessageInfo -func (m *QueryEffectivePolicyRequest) GetConsumer() string { +func (m *ProviderCuInfo) GetProvider() string { if m != nil { - return m.Consumer + return m.Provider } return "" } -func (m *QueryEffectivePolicyRequest) GetSpecID() string { +func (m *ProviderCuInfo) GetCu() uint64 { if m != nil { - return m.SpecID + return m.Cu } - return "" + return 0 } -type QueryEffectivePolicyResponse struct { - Policy *types1.Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` - PendingPolicy *types1.Policy `protobuf:"bytes,2,opt,name=pending_policy,json=pendingPolicy,proto3" json:"pending_policy,omitempty"` +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.pairing.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.pairing.QueryParamsResponse") + proto.RegisterType((*QueryProvidersRequest)(nil), "lavanet.lava.pairing.QueryProvidersRequest") + proto.RegisterType((*QueryProvidersResponse)(nil), "lavanet.lava.pairing.QueryProvidersResponse") + proto.RegisterType((*QueryGetPairingRequest)(nil), "lavanet.lava.pairing.QueryGetPairingRequest") + proto.RegisterType((*QueryGetPairingResponse)(nil), "lavanet.lava.pairing.QueryGetPairingResponse") + proto.RegisterType((*QueryVerifyPairingRequest)(nil), "lavanet.lava.pairing.QueryVerifyPairingRequest") + proto.RegisterType((*QueryVerifyPairingResponse)(nil), "lavanet.lava.pairing.QueryVerifyPairingResponse") + proto.RegisterType((*QueryUserEntryRequest)(nil), "lavanet.lava.pairing.QueryUserEntryRequest") + proto.RegisterType((*QueryUserEntryResponse)(nil), "lavanet.lava.pairing.QueryUserEntryResponse") + proto.RegisterType((*QueryStaticProvidersListRequest)(nil), "lavanet.lava.pairing.QueryStaticProvidersListRequest") + proto.RegisterType((*QueryStaticProvidersListResponse)(nil), "lavanet.lava.pairing.QueryStaticProvidersListResponse") + proto.RegisterType((*QueryEffectivePolicyRequest)(nil), "lavanet.lava.pairing.QueryEffectivePolicyRequest") + proto.RegisterType((*QueryEffectivePolicyResponse)(nil), "lavanet.lava.pairing.QueryEffectivePolicyResponse") + proto.RegisterType((*QuerySdkPairingResponse)(nil), "lavanet.lava.pairing.QuerySdkPairingResponse") + proto.RegisterType((*QueryProviderMonthlyPayoutRequest)(nil), "lavanet.lava.pairing.QueryProviderMonthlyPayoutRequest") + proto.RegisterType((*SubscriptionPayout)(nil), "lavanet.lava.pairing.SubscriptionPayout") + proto.RegisterType((*QueryProviderMonthlyPayoutResponse)(nil), "lavanet.lava.pairing.QueryProviderMonthlyPayoutResponse") + proto.RegisterType((*ProviderPayout)(nil), "lavanet.lava.pairing.ProviderPayout") + proto.RegisterType((*ChainIDPayout)(nil), "lavanet.lava.pairing.ChainIDPayout") + proto.RegisterType((*QuerySubscriptionMonthlyPayoutRequest)(nil), "lavanet.lava.pairing.QuerySubscriptionMonthlyPayoutRequest") + proto.RegisterType((*QuerySubscriptionMonthlyPayoutResponse)(nil), "lavanet.lava.pairing.QuerySubscriptionMonthlyPayoutResponse") + proto.RegisterType((*QueryProvidersEpochCuRequest)(nil), "lavanet.lava.pairing.QueryProvidersEpochCuRequest") + proto.RegisterType((*QueryProvidersEpochCuResponse)(nil), "lavanet.lava.pairing.QueryProvidersEpochCuResponse") + proto.RegisterType((*ProviderCuInfo)(nil), "lavanet.lava.pairing.ProviderCuInfo") } -func (m *QueryEffectivePolicyResponse) Reset() { *m = QueryEffectivePolicyResponse{} } -func (m *QueryEffectivePolicyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryEffectivePolicyResponse) ProtoMessage() {} -func (*QueryEffectivePolicyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{25} -} -func (m *QueryEffectivePolicyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEffectivePolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEffectivePolicyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryEffectivePolicyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEffectivePolicyResponse.Merge(m, src) +func init() { proto.RegisterFile("lavanet/lava/pairing/query.proto", fileDescriptor_9e149ce9d21da0d8) } + +var fileDescriptor_9e149ce9d21da0d8 = []byte{ + // 1615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4d, 0x73, 0xd4, 0x46, + 0x1a, 0xb6, 0xc6, 0x63, 0xe3, 0x79, 0xc1, 0x36, 0xd5, 0xd8, 0x60, 0x6b, 0xcd, 0x60, 0x64, 0x58, + 0x6c, 0xcc, 0x8e, 0xb0, 0x59, 0x3e, 0x0a, 0x0c, 0xbb, 0xd8, 0xb0, 0x94, 0x59, 0xef, 0xae, 0x2d, + 0x2f, 0x7b, 0xd8, 0x8b, 0x4a, 0x96, 0x7a, 0xc6, 0xc2, 0x33, 0x6a, 0x21, 0xb5, 0x06, 0x3b, 0xae, + 0x49, 0xaa, 0x92, 0x3f, 0x90, 0xaa, 0x24, 0x87, 0xdc, 0xa9, 0xca, 0x89, 0x7f, 0x90, 0x9c, 0x52, + 0x95, 0xe2, 0x90, 0x03, 0x55, 0xb9, 0xe4, 0x90, 0x4a, 0xa5, 0x20, 0x7f, 0x20, 0xff, 0x20, 0xa5, + 0xee, 0x96, 0x46, 0x1a, 0x6b, 0x34, 0x36, 0xe1, 0xe2, 0x99, 0x96, 0xde, 0xa7, 0xfb, 0x79, 0x9f, + 0x7e, 0xbf, 0xc6, 0x30, 0x5d, 0x37, 0x9a, 0x86, 0x83, 0xa9, 0x1a, 0x7e, 0xaa, 0xae, 0x61, 0x7b, + 0xb6, 0x53, 0x53, 0x9f, 0x05, 0xd8, 0xdb, 0xab, 0xb8, 0x1e, 0xa1, 0x04, 0x8d, 0x09, 0x8b, 0x4a, + 0xf8, 0x59, 0x11, 0x16, 0xf2, 0x58, 0x8d, 0xd4, 0x08, 0x33, 0x50, 0xc3, 0x6f, 0xdc, 0x56, 0x9e, + 0xaa, 0x11, 0x52, 0xab, 0x63, 0xd5, 0x70, 0x6d, 0xd5, 0x70, 0x1c, 0x42, 0x0d, 0x6a, 0x13, 0xc7, + 0x17, 0x6f, 0x2f, 0x9b, 0xc4, 0x6f, 0x10, 0x5f, 0xdd, 0x32, 0x7c, 0xcc, 0x8f, 0x50, 0x9b, 0x0b, + 0x5b, 0x98, 0x1a, 0x0b, 0xaa, 0x6b, 0xd4, 0x6c, 0x87, 0x19, 0x0b, 0xdb, 0xf3, 0x99, 0xbc, 0x5c, + 0xc3, 0x33, 0x1a, 0xd1, 0x76, 0x53, 0x29, 0x13, 0xdf, 0xc5, 0x26, 0xfb, 0x23, 0xde, 0x9e, 0x4b, + 0x6f, 0x50, 0x37, 0x1c, 0x5f, 0x75, 0x49, 0xdd, 0x36, 0x85, 0x5f, 0xf2, 0x7c, 0xca, 0x00, 0xbb, + 0xc4, 0xdc, 0xf6, 0x29, 0xf1, 0x8c, 0x1a, 0x56, 0x7d, 0x6a, 0xec, 0x60, 0x1d, 0x3b, 0x34, 0x12, + 0x41, 0xbe, 0x92, 0x3e, 0x2b, 0xd8, 0xf2, 0x4d, 0xcf, 0x76, 0x43, 0xbe, 0xa9, 0x85, 0xb0, 0x9e, + 0x49, 0x9f, 0xed, 0x91, 0xa7, 0xd8, 0xa4, 0x7e, 0xf4, 0x45, 0x18, 0x5d, 0x4a, 0x19, 0x59, 0xe4, + 0xb9, 0x43, 0xed, 0x06, 0x56, 0x9b, 0x0b, 0xf1, 0x77, 0x6e, 0xa8, 0x8c, 0x01, 0xda, 0x08, 0xc5, + 0x5a, 0x67, 0xce, 0x6b, 0xf8, 0x59, 0x80, 0x7d, 0xaa, 0x6c, 0xc0, 0xa9, 0xd4, 0x53, 0xdf, 0x25, + 0x8e, 0x8f, 0xd1, 0x6d, 0x18, 0xe4, 0x22, 0x4d, 0x48, 0xd3, 0xd2, 0xec, 0xf1, 0xc5, 0xa9, 0x4a, + 0xd6, 0xf5, 0x55, 0x38, 0x6a, 0xb9, 0xf8, 0xea, 0xe7, 0x73, 0x7d, 0x9a, 0x40, 0x28, 0x1b, 0x30, + 0xce, 0xb7, 0xf4, 0x48, 0xd3, 0xb6, 0xb0, 0x17, 0x9d, 0x85, 0x26, 0xe0, 0x98, 0xb9, 0x6d, 0xd8, + 0xce, 0xea, 0x03, 0xb6, 0x6b, 0x49, 0x8b, 0x96, 0xa8, 0x0c, 0xe0, 0x6f, 0x93, 0xe7, 0xff, 0xf0, + 0xc8, 0x07, 0xd8, 0x99, 0x28, 0x4c, 0x4b, 0xb3, 0x43, 0x5a, 0xe2, 0x89, 0xb2, 0x03, 0xa7, 0x3b, + 0xb7, 0x14, 0x44, 0xff, 0x09, 0xc0, 0x64, 0x7e, 0x18, 0xaa, 0x3c, 0x21, 0x4d, 0xf7, 0xcf, 0x1e, + 0x5f, 0xbc, 0x98, 0x26, 0x9b, 0xbc, 0x93, 0xca, 0x66, 0x6c, 0x2c, 0x58, 0x27, 0xe0, 0x8f, 0x8b, + 0x43, 0x85, 0x93, 0xfd, 0xca, 0x63, 0x71, 0xd8, 0x23, 0x4c, 0xd7, 0xb9, 0x9f, 0xbd, 0x1d, 0x38, + 0x0d, 0x83, 0x66, 0xdd, 0xc6, 0x0e, 0x65, 0xe4, 0x4b, 0x9a, 0x58, 0x29, 0x2f, 0x0b, 0x70, 0xe6, + 0xc0, 0x66, 0x82, 0xfa, 0x2a, 0x94, 0xdc, 0xc8, 0x9f, 0x77, 0x61, 0xde, 0x46, 0xa3, 0x19, 0x18, + 0x36, 0x03, 0xcf, 0xc3, 0x0e, 0xd5, 0x19, 0x86, 0xb1, 0x28, 0x6a, 0x27, 0xc4, 0xc3, 0x87, 0xe1, + 0x33, 0x74, 0x0b, 0x26, 0xc3, 0x70, 0xd0, 0xeb, 0xb8, 0x4a, 0x75, 0x4a, 0x74, 0x07, 0xef, 0x52, + 0x5d, 0xdc, 0xe4, 0x44, 0x3f, 0x03, 0x8c, 0x87, 0x06, 0x6b, 0xb8, 0x4a, 0xff, 0x4b, 0xfe, 0x8d, + 0x77, 0x23, 0xc6, 0xe8, 0x3a, 0x9c, 0x09, 0x53, 0x42, 0xaf, 0x1b, 0x3e, 0xd5, 0x03, 0xd7, 0x32, + 0x28, 0xb6, 0xf4, 0xad, 0x3a, 0x31, 0x77, 0x26, 0x8a, 0x0c, 0x37, 0x16, 0xbe, 0x5e, 0x33, 0x7c, + 0xfa, 0x84, 0xbf, 0x5c, 0x0e, 0xdf, 0xa1, 0x05, 0x18, 0x67, 0x46, 0x3a, 0xa9, 0xa6, 0x0f, 0x1b, + 0x60, 0x20, 0xc4, 0x5e, 0xfe, 0xa7, 0x9a, 0x38, 0x49, 0xf9, 0x08, 0x26, 0x99, 0x5c, 0xff, 0xc3, + 0x9e, 0x5d, 0xdd, 0xfb, 0xa3, 0xf2, 0x23, 0x19, 0x86, 0x22, 0x91, 0x98, 0x87, 0x25, 0x2d, 0x5e, + 0xa3, 0x31, 0x18, 0x48, 0xba, 0xc0, 0x17, 0xca, 0x0b, 0x09, 0xe4, 0x2c, 0x06, 0xe2, 0xce, 0xc6, + 0x60, 0xa0, 0x69, 0xd4, 0x6d, 0x8b, 0x11, 0x18, 0xd2, 0xf8, 0x02, 0xcd, 0xc1, 0xc9, 0xd0, 0x35, + 0x6c, 0xe9, 0xed, 0x0b, 0xe5, 0x82, 0x8e, 0xf2, 0xe7, 0x71, 0xdc, 0xa2, 0x69, 0x38, 0x61, 0x06, + 0xba, 0x8b, 0x3d, 0x71, 0x51, 0xfc, 0x70, 0x30, 0x83, 0x75, 0xec, 0xf1, 0x6b, 0x3a, 0x0b, 0x20, + 0x32, 0x5c, 0xb7, 0x2d, 0x26, 0x55, 0x89, 0x5d, 0x75, 0xf8, 0x64, 0xd5, 0x12, 0x31, 0x6a, 0x88, + 0x1c, 0x7b, 0xe2, 0x63, 0x8f, 0xc5, 0x44, 0x42, 0x23, 0xc3, 0xb2, 0x3c, 0xec, 0xfb, 0x91, 0x46, + 0x62, 0x99, 0x54, 0xaf, 0x90, 0x56, 0x2f, 0x56, 0xa2, 0x3f, 0xa9, 0xc4, 0x73, 0x91, 0x06, 0x89, + 0x23, 0x84, 0x08, 0x8f, 0x60, 0xc8, 0x24, 0x8e, 0x1f, 0x34, 0xb0, 0x27, 0xca, 0xc3, 0x91, 0xe2, + 0x36, 0x06, 0x87, 0x07, 0x37, 0x8c, 0xdd, 0x95, 0x27, 0x22, 0x5c, 0xf9, 0x42, 0xb9, 0x03, 0xe7, + 0xd8, 0xc1, 0x9b, 0x61, 0xd9, 0x37, 0x63, 0xe9, 0xd6, 0x6c, 0x9f, 0xf6, 0x8c, 0x04, 0xa5, 0x01, + 0xd3, 0xdd, 0xc1, 0xef, 0x3d, 0xf1, 0x94, 0x0d, 0xf8, 0x13, 0x3b, 0xee, 0x61, 0xb5, 0x8a, 0x4d, + 0x6a, 0x37, 0xf1, 0x3a, 0xeb, 0x0d, 0x11, 0x4f, 0xb9, 0x43, 0xa9, 0x52, 0xc2, 0xf9, 0xd3, 0x30, + 0x18, 0x66, 0x4d, 0x7c, 0x1d, 0x62, 0xa5, 0x7c, 0x21, 0xc1, 0x54, 0xf6, 0x9e, 0x82, 0xfe, 0x22, + 0x0c, 0xf2, 0x0e, 0x24, 0xc4, 0x97, 0x3b, 0x6a, 0x73, 0xd8, 0xa3, 0x2a, 0x02, 0x23, 0x2c, 0xd1, + 0x7d, 0x18, 0x71, 0xb1, 0x63, 0xd9, 0x4e, 0x4d, 0x17, 0xd8, 0x42, 0x4f, 0xec, 0xb0, 0x40, 0xf0, + 0xa5, 0xf2, 0x9b, 0x24, 0x4a, 0xd9, 0xa6, 0xb5, 0xd3, 0x99, 0x16, 0x8f, 0xe0, 0x58, 0x94, 0xdb, + 0x9c, 0xd3, 0x5f, 0xb2, 0xfb, 0x45, 0x97, 0x52, 0xa8, 0x45, 0x68, 0x34, 0x0e, 0x83, 0x0d, 0x63, + 0x57, 0x37, 0x83, 0x64, 0x48, 0x04, 0x68, 0x1e, 0x8a, 0xa1, 0x3a, 0x2c, 0x40, 0x8f, 0x2f, 0x9e, + 0x49, 0x6f, 0xce, 0xba, 0xf5, 0xa6, 0x8b, 0x4d, 0x8d, 0x19, 0xa1, 0x55, 0x18, 0x8d, 0x5a, 0x9f, + 0x2e, 0x9a, 0x58, 0x91, 0xe1, 0xa6, 0xd3, 0xb8, 0xb8, 0x3f, 0x36, 0x17, 0x44, 0x23, 0xd3, 0x46, + 0xa2, 0x67, 0x7c, 0xad, 0xfc, 0x0d, 0xce, 0xa7, 0xfa, 0xce, 0xbf, 0x88, 0x43, 0xb7, 0xeb, 0x7b, + 0xeb, 0xc6, 0x1e, 0x09, 0x68, 0xe2, 0x92, 0xe3, 0x22, 0x23, 0xa5, 0x8b, 0x8c, 0xb2, 0x03, 0x68, + 0x33, 0xd1, 0xd8, 0x39, 0x10, 0x29, 0x70, 0x22, 0xd9, 0xee, 0x05, 0x2a, 0xf5, 0x0c, 0x4d, 0xc2, + 0x10, 0x8b, 0xe9, 0xb0, 0x08, 0xa4, 0xf2, 0xd5, 0x0a, 0x23, 0xc7, 0x68, 0x90, 0xc0, 0xa1, 0x22, + 0x61, 0xc5, 0x4a, 0xf9, 0x10, 0x94, 0x3c, 0xb6, 0xed, 0x12, 0x46, 0x09, 0x35, 0xea, 0xec, 0xd4, + 0xa2, 0xc6, 0x17, 0x68, 0x19, 0x8e, 0x59, 0x98, 0x1a, 0x76, 0xdd, 0x9f, 0x28, 0xb0, 0x8c, 0x98, + 0xcd, 0xbe, 0xc1, 0x83, 0xde, 0x68, 0x11, 0x50, 0x79, 0x00, 0x23, 0xd1, 0xd1, 0xc2, 0xd1, 0x1c, + 0x69, 0x12, 0x5e, 0x14, 0x52, 0x5e, 0x3c, 0x85, 0xe1, 0x15, 0x9e, 0xcc, 0x62, 0x93, 0xa4, 0x12, + 0x52, 0x5a, 0x89, 0x7b, 0x61, 0xdc, 0x85, 0x46, 0x11, 0xeb, 0x0b, 0x5d, 0xe6, 0x94, 0x14, 0x2d, + 0x2d, 0x02, 0x29, 0x2b, 0x70, 0x91, 0x87, 0x74, 0xc2, 0xab, 0x6e, 0x77, 0xdc, 0x2d, 0x91, 0x95, + 0x16, 0xfc, 0xb9, 0xd7, 0x26, 0xb9, 0xd2, 0xdf, 0xed, 0x94, 0x7e, 0x26, 0xdb, 0x89, 0x94, 0x2a, + 0x6d, 0xd5, 0xcb, 0xa2, 0x5c, 0xc4, 0xb5, 0x8e, 0xb5, 0x91, 0x95, 0x20, 0x9a, 0xf0, 0x74, 0x38, + 0xdb, 0xe5, 0xbd, 0x60, 0x75, 0x0f, 0x8a, 0xb6, 0x53, 0x25, 0xa2, 0x12, 0xf6, 0x50, 0x70, 0x25, + 0x58, 0x75, 0xaa, 0x44, 0x14, 0x42, 0x86, 0x53, 0x96, 0xda, 0xd7, 0xce, 0xdf, 0xe6, 0x5e, 0xfb, + 0x08, 0x14, 0xe2, 0xec, 0x2e, 0x98, 0xc1, 0xe2, 0x37, 0xa3, 0x30, 0xc0, 0xf8, 0xa1, 0x4f, 0x24, + 0x18, 0xe4, 0x79, 0x87, 0x66, 0x73, 0xca, 0x47, 0x6a, 0x7e, 0x95, 0xe7, 0x0e, 0x61, 0xc9, 0xfd, + 0x54, 0x2e, 0x7c, 0xfc, 0xc3, 0xaf, 0x9f, 0x15, 0xca, 0x68, 0x4a, 0xcd, 0xf9, 0x51, 0x80, 0xbe, + 0x94, 0xa0, 0xd4, 0x6e, 0xd7, 0xf3, 0x79, 0xdb, 0x77, 0xcc, 0xb7, 0xf2, 0x95, 0xc3, 0x19, 0x0b, + 0x3a, 0x0b, 0x8c, 0xce, 0x3c, 0x9a, 0xeb, 0x42, 0x27, 0x02, 0xa8, 0xfb, 0xa2, 0xb7, 0xb5, 0xd0, + 0x57, 0x12, 0x40, 0xbb, 0x7a, 0xa2, 0x2b, 0x87, 0x2c, 0xb2, 0x9c, 0xdd, 0xd1, 0x4a, 0xb2, 0xb2, + 0xc4, 0xe8, 0xdd, 0x40, 0x7f, 0xcd, 0xa6, 0x57, 0xc3, 0xf1, 0x38, 0xd7, 0x26, 0xa8, 0xee, 0xf3, + 0xb9, 0xab, 0x85, 0xbe, 0x93, 0x60, 0x38, 0x35, 0x41, 0x21, 0x35, 0xe7, 0xf8, 0xac, 0x69, 0x4f, + 0xbe, 0x7a, 0x78, 0x80, 0xa0, 0xac, 0x31, 0xca, 0x6b, 0xe8, 0x71, 0x36, 0xe5, 0x26, 0x03, 0xe5, + 0xb0, 0x56, 0xf7, 0x23, 0xd1, 0x5b, 0xea, 0x3e, 0x1b, 0x82, 0x5a, 0xe8, 0x85, 0x04, 0xa5, 0x78, + 0x02, 0xca, 0x0d, 0x87, 0xce, 0x51, 0x2c, 0x37, 0x1c, 0x0e, 0x0c, 0x55, 0xbd, 0xf4, 0x0e, 0xfc, + 0x70, 0x64, 0x0c, 0x11, 0xea, 0xbe, 0x98, 0xe8, 0x5a, 0x89, 0xc8, 0xf8, 0x56, 0x82, 0x53, 0x19, + 0x23, 0x0f, 0xba, 0x9e, 0xc3, 0xa1, 0xfb, 0x7c, 0x25, 0xdf, 0x38, 0x2a, 0x4c, 0x38, 0x71, 0x97, + 0x39, 0x71, 0x13, 0x5d, 0xcf, 0x76, 0xc2, 0x67, 0xd0, 0xf6, 0x90, 0xac, 0xd7, 0x6d, 0x9f, 0x26, + 0xbc, 0xf8, 0x5a, 0x82, 0xd1, 0x8e, 0xa9, 0x07, 0x2d, 0xe4, 0x50, 0xc9, 0x9e, 0xba, 0xe4, 0xc5, + 0xa3, 0x40, 0x04, 0xf3, 0x65, 0xc6, 0x7c, 0x09, 0xdd, 0xce, 0x66, 0x8e, 0x23, 0x98, 0x18, 0x9f, + 0xd4, 0xfd, 0xa8, 0xfc, 0xb7, 0xd4, 0x7d, 0x3e, 0xb8, 0xb5, 0xd0, 0xf7, 0x12, 0x8c, 0x67, 0xf6, + 0x5e, 0x74, 0xf3, 0x10, 0x95, 0x21, 0xab, 0xef, 0xc8, 0xb7, 0x8e, 0x0e, 0x14, 0x0e, 0xfd, 0x9d, + 0x39, 0x74, 0x1b, 0xdd, 0xca, 0x2f, 0x2f, 0x7a, 0x83, 0xa3, 0x75, 0xde, 0x12, 0x13, 0x29, 0x80, + 0x7e, 0x92, 0x60, 0xb2, 0x6b, 0x4f, 0x43, 0x77, 0xf2, 0x42, 0xa4, 0x47, 0x3b, 0x95, 0x97, 0xde, + 0x0d, 0x2c, 0x5c, 0x7b, 0xc0, 0x5c, 0xbb, 0x87, 0x96, 0xba, 0x44, 0x59, 0x62, 0x83, 0x03, 0xee, + 0xc5, 0xd7, 0x86, 0x3e, 0x97, 0x00, 0xda, 0xa3, 0xec, 0x7b, 0x2c, 0xa6, 0x07, 0xe7, 0x63, 0x65, + 0x8e, 0x31, 0x9e, 0x41, 0xe7, 0xbb, 0x30, 0xb6, 0x76, 0xa2, 0xb2, 0x84, 0x5e, 0x4a, 0x70, 0xb2, + 0xb3, 0x55, 0xa3, 0xc5, 0xc3, 0x74, 0x96, 0x74, 0xdf, 0x97, 0xaf, 0x1d, 0x09, 0x23, 0x88, 0x5e, + 0x65, 0x44, 0x2f, 0xa3, 0xd9, 0x1e, 0x4d, 0x89, 0xff, 0x7a, 0xd5, 0xcd, 0x60, 0xf9, 0xfe, 0xab, + 0x37, 0x65, 0xe9, 0xf5, 0x9b, 0xb2, 0xf4, 0xcb, 0x9b, 0xb2, 0xf4, 0xe9, 0xdb, 0x72, 0xdf, 0xeb, + 0xb7, 0xe5, 0xbe, 0x1f, 0xdf, 0x96, 0xfb, 0xfe, 0x7f, 0xa9, 0x66, 0xd3, 0xed, 0x60, 0xab, 0x62, + 0x92, 0x46, 0x7a, 0xb7, 0xdd, 0x78, 0x3f, 0xba, 0xe7, 0x62, 0x7f, 0x6b, 0x90, 0xfd, 0x83, 0xea, + 0xda, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xa2, 0x9a, 0x9b, 0x45, 0x14, 0x00, 0x00, } -func (m *QueryEffectivePolicyResponse) XXX_Size() int { - return m.Size() + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Providers items. + Providers(ctx context.Context, in *QueryProvidersRequest, opts ...grpc.CallOption) (*QueryProvidersResponse, error) + // Queries a list of GetPairing items. + GetPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QueryGetPairingResponse, error) + // Queries a list of VerifyPairing items. + VerifyPairing(ctx context.Context, in *QueryVerifyPairingRequest, opts ...grpc.CallOption) (*QueryVerifyPairingResponse, error) + // Queries a UserEntry items. + UserEntry(ctx context.Context, in *QueryUserEntryRequest, opts ...grpc.CallOption) (*QueryUserEntryResponse, error) + // Queries a list of StaticProvidersList items. + StaticProvidersList(ctx context.Context, in *QueryStaticProvidersListRequest, opts ...grpc.CallOption) (*QueryStaticProvidersListResponse, error) + // Queries a list of EffectivePolicy items. + EffectivePolicy(ctx context.Context, in *QueryEffectivePolicyRequest, opts ...grpc.CallOption) (*QueryEffectivePolicyResponse, error) + // Queries the expected monthly payout of a specific provider + ProviderMonthlyPayout(ctx context.Context, in *QueryProviderMonthlyPayoutRequest, opts ...grpc.CallOption) (*QueryProviderMonthlyPayoutResponse, error) + // Queries the expected monthly payout of a specific subscription + SubscriptionMonthlyPayout(ctx context.Context, in *QuerySubscriptionMonthlyPayoutRequest, opts ...grpc.CallOption) (*QuerySubscriptionMonthlyPayoutResponse, error) + // Queries a list of SdkPairing items. + SdkPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QuerySdkPairingResponse, error) + // Queries a for the aggregated CU of all ProviderEpochCu objects all the providers. + ProvidersEpochCu(ctx context.Context, in *QueryProvidersEpochCuRequest, opts ...grpc.CallOption) (*QueryProvidersEpochCuResponse, error) } -func (m *QueryEffectivePolicyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEffectivePolicyResponse.DiscardUnknown(m) + +type queryClient struct { + cc grpc1.ClientConn } -var xxx_messageInfo_QueryEffectivePolicyResponse proto.InternalMessageInfo +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} -func (m *QueryEffectivePolicyResponse) GetPolicy() *types1.Policy { - if m != nil { - return m.Policy +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/Params", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *QueryEffectivePolicyResponse) GetPendingPolicy() *types1.Policy { - if m != nil { - return m.PendingPolicy +func (c *queryClient) Providers(ctx context.Context, in *QueryProvidersRequest, opts ...grpc.CallOption) (*QueryProvidersResponse, error) { + out := new(QueryProvidersResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/Providers", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -type QuerySdkPairingResponse struct { - Pairing *QueryGetPairingResponse `protobuf:"bytes,1,opt,name=pairing,proto3" json:"pairing,omitempty"` - MaxCu uint64 `protobuf:"varint,2,opt,name=max_cu,json=maxCu,proto3" json:"max_cu,omitempty"` - Spec *types2.Spec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` - DowntimeParams *v1.Params `protobuf:"bytes,4,opt,name=downtime_params,json=downtimeParams,proto3" json:"downtime_params,omitempty"` +func (c *queryClient) GetPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QueryGetPairingResponse, error) { + out := new(QueryGetPairingResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/GetPairing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QuerySdkPairingResponse) Reset() { *m = QuerySdkPairingResponse{} } -func (m *QuerySdkPairingResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySdkPairingResponse) ProtoMessage() {} -func (*QuerySdkPairingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{26} -} -func (m *QuerySdkPairingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySdkPairingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySdkPairingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (c *queryClient) VerifyPairing(ctx context.Context, in *QueryVerifyPairingRequest, opts ...grpc.CallOption) (*QueryVerifyPairingResponse, error) { + out := new(QueryVerifyPairingResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/VerifyPairing", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *QuerySdkPairingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySdkPairingResponse.Merge(m, src) -} -func (m *QuerySdkPairingResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySdkPairingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySdkPairingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySdkPairingResponse proto.InternalMessageInfo -func (m *QuerySdkPairingResponse) GetPairing() *QueryGetPairingResponse { - if m != nil { - return m.Pairing +func (c *queryClient) UserEntry(ctx context.Context, in *QueryUserEntryRequest, opts ...grpc.CallOption) (*QueryUserEntryResponse, error) { + out := new(QueryUserEntryResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/UserEntry", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *QuerySdkPairingResponse) GetMaxCu() uint64 { - if m != nil { - return m.MaxCu +func (c *queryClient) StaticProvidersList(ctx context.Context, in *QueryStaticProvidersListRequest, opts ...grpc.CallOption) (*QueryStaticProvidersListResponse, error) { + out := new(QueryStaticProvidersListResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/StaticProvidersList", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *QuerySdkPairingResponse) GetSpec() *types2.Spec { - if m != nil { - return m.Spec +func (c *queryClient) EffectivePolicy(ctx context.Context, in *QueryEffectivePolicyRequest, opts ...grpc.CallOption) (*QueryEffectivePolicyResponse, error) { + out := new(QueryEffectivePolicyResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/EffectivePolicy", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *QuerySdkPairingResponse) GetDowntimeParams() *v1.Params { - if m != nil { - return m.DowntimeParams +func (c *queryClient) ProviderMonthlyPayout(ctx context.Context, in *QueryProviderMonthlyPayoutRequest, opts ...grpc.CallOption) (*QueryProviderMonthlyPayoutResponse, error) { + out := new(QueryProviderMonthlyPayoutResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/ProviderMonthlyPayout", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -type QueryProviderMonthlyPayoutRequest struct { - Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` +func (c *queryClient) SubscriptionMonthlyPayout(ctx context.Context, in *QuerySubscriptionMonthlyPayoutRequest, opts ...grpc.CallOption) (*QuerySubscriptionMonthlyPayoutResponse, error) { + out := new(QuerySubscriptionMonthlyPayoutResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/SubscriptionMonthlyPayout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryProviderMonthlyPayoutRequest) Reset() { *m = QueryProviderMonthlyPayoutRequest{} } -func (m *QueryProviderMonthlyPayoutRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProviderMonthlyPayoutRequest) ProtoMessage() {} -func (*QueryProviderMonthlyPayoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{27} -} -func (m *QueryProviderMonthlyPayoutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProviderMonthlyPayoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProviderMonthlyPayoutRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (c *queryClient) SdkPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QuerySdkPairingResponse, error) { + out := new(QuerySdkPairingResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/SdkPairing", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *QueryProviderMonthlyPayoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProviderMonthlyPayoutRequest.Merge(m, src) -} -func (m *QueryProviderMonthlyPayoutRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProviderMonthlyPayoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProviderMonthlyPayoutRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProviderMonthlyPayoutRequest proto.InternalMessageInfo -func (m *QueryProviderMonthlyPayoutRequest) GetProvider() string { - if m != nil { - return m.Provider +func (c *queryClient) ProvidersEpochCu(ctx context.Context, in *QueryProvidersEpochCuRequest, opts ...grpc.CallOption) (*QueryProvidersEpochCuResponse, error) { + out := new(QueryProvidersEpochCuResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/ProvidersEpochCu", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -type SubscriptionPayout struct { - Subscription string `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Providers items. + Providers(context.Context, *QueryProvidersRequest) (*QueryProvidersResponse, error) + // Queries a list of GetPairing items. + GetPairing(context.Context, *QueryGetPairingRequest) (*QueryGetPairingResponse, error) + // Queries a list of VerifyPairing items. + VerifyPairing(context.Context, *QueryVerifyPairingRequest) (*QueryVerifyPairingResponse, error) + // Queries a UserEntry items. + UserEntry(context.Context, *QueryUserEntryRequest) (*QueryUserEntryResponse, error) + // Queries a list of StaticProvidersList items. + StaticProvidersList(context.Context, *QueryStaticProvidersListRequest) (*QueryStaticProvidersListResponse, error) + // Queries a list of EffectivePolicy items. + EffectivePolicy(context.Context, *QueryEffectivePolicyRequest) (*QueryEffectivePolicyResponse, error) + // Queries the expected monthly payout of a specific provider + ProviderMonthlyPayout(context.Context, *QueryProviderMonthlyPayoutRequest) (*QueryProviderMonthlyPayoutResponse, error) + // Queries the expected monthly payout of a specific subscription + SubscriptionMonthlyPayout(context.Context, *QuerySubscriptionMonthlyPayoutRequest) (*QuerySubscriptionMonthlyPayoutResponse, error) + // Queries a list of SdkPairing items. + SdkPairing(context.Context, *QueryGetPairingRequest) (*QuerySdkPairingResponse, error) + // Queries a for the aggregated CU of all ProviderEpochCu objects all the providers. + ProvidersEpochCu(context.Context, *QueryProvidersEpochCuRequest) (*QueryProvidersEpochCuResponse, error) } -func (m *SubscriptionPayout) Reset() { *m = SubscriptionPayout{} } -func (m *SubscriptionPayout) String() string { return proto.CompactTextString(m) } -func (*SubscriptionPayout) ProtoMessage() {} -func (*SubscriptionPayout) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{28} -} -func (m *SubscriptionPayout) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscriptionPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscriptionPayout.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscriptionPayout) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscriptionPayout.Merge(m, src) -} -func (m *SubscriptionPayout) XXX_Size() int { - return m.Size() -} -func (m *SubscriptionPayout) XXX_DiscardUnknown() { - xxx_messageInfo_SubscriptionPayout.DiscardUnknown(m) +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -var xxx_messageInfo_SubscriptionPayout proto.InternalMessageInfo - -func (m *SubscriptionPayout) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } - -func (m *SubscriptionPayout) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" +func (*UnimplementedQueryServer) Providers(ctx context.Context, req *QueryProvidersRequest) (*QueryProvidersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Providers not implemented") } - -func (m *SubscriptionPayout) GetAmount() uint64 { - if m != nil { - return m.Amount - } - return 0 +func (*UnimplementedQueryServer) GetPairing(ctx context.Context, req *QueryGetPairingRequest) (*QueryGetPairingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPairing not implemented") } - -type QueryProviderMonthlyPayoutResponse struct { - Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Details []*SubscriptionPayout `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` +func (*UnimplementedQueryServer) VerifyPairing(ctx context.Context, req *QueryVerifyPairingRequest) (*QueryVerifyPairingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyPairing not implemented") } - -func (m *QueryProviderMonthlyPayoutResponse) Reset() { *m = QueryProviderMonthlyPayoutResponse{} } -func (m *QueryProviderMonthlyPayoutResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProviderMonthlyPayoutResponse) ProtoMessage() {} -func (*QueryProviderMonthlyPayoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{29} +func (*UnimplementedQueryServer) UserEntry(ctx context.Context, req *QueryUserEntryRequest) (*QueryUserEntryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserEntry not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (*UnimplementedQueryServer) StaticProvidersList(ctx context.Context, req *QueryStaticProvidersListRequest) (*QueryStaticProvidersListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StaticProvidersList not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProviderMonthlyPayoutResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (*UnimplementedQueryServer) EffectivePolicy(ctx context.Context, req *QueryEffectivePolicyRequest) (*QueryEffectivePolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EffectivePolicy not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProviderMonthlyPayoutResponse.Merge(m, src) +func (*UnimplementedQueryServer) ProviderMonthlyPayout(ctx context.Context, req *QueryProviderMonthlyPayoutRequest) (*QueryProviderMonthlyPayoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProviderMonthlyPayout not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) XXX_Size() int { - return m.Size() +func (*UnimplementedQueryServer) SubscriptionMonthlyPayout(ctx context.Context, req *QuerySubscriptionMonthlyPayoutRequest) (*QuerySubscriptionMonthlyPayoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubscriptionMonthlyPayout not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProviderMonthlyPayoutResponse.DiscardUnknown(m) +func (*UnimplementedQueryServer) SdkPairing(ctx context.Context, req *QueryGetPairingRequest) (*QuerySdkPairingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SdkPairing not implemented") } - -var xxx_messageInfo_QueryProviderMonthlyPayoutResponse proto.InternalMessageInfo - -func (m *QueryProviderMonthlyPayoutResponse) GetTotal() uint64 { - if m != nil { - return m.Total - } - return 0 +func (*UnimplementedQueryServer) ProvidersEpochCu(ctx context.Context, req *QueryProvidersEpochCuRequest) (*QueryProvidersEpochCuResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProvidersEpochCu not implemented") } -func (m *QueryProviderMonthlyPayoutResponse) GetDetails() []*SubscriptionPayout { - if m != nil { - return m.Details - } - return nil +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) } -type ProviderPayout struct { - Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ProviderPayout) Reset() { *m = ProviderPayout{} } -func (m *ProviderPayout) String() string { return proto.CompactTextString(m) } -func (*ProviderPayout) ProtoMessage() {} -func (*ProviderPayout) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{30} -} -func (m *ProviderPayout) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProviderPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProviderPayout.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _Query_Providers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProvidersRequest) + if err := dec(in); err != nil { + return nil, err } + if interceptor == nil { + return srv.(QueryServer).Providers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/Providers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Providers(ctx, req.(*QueryProvidersRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ProviderPayout) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProviderPayout.Merge(m, src) -} -func (m *ProviderPayout) XXX_Size() int { - return m.Size() -} -func (m *ProviderPayout) XXX_DiscardUnknown() { - xxx_messageInfo_ProviderPayout.DiscardUnknown(m) -} - -var xxx_messageInfo_ProviderPayout proto.InternalMessageInfo -func (m *ProviderPayout) GetProvider() string { - if m != nil { - return m.Provider +func _Query_GetPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPairingRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(QueryServer).GetPairing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/GetPairing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetPairing(ctx, req.(*QueryGetPairingRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ProviderPayout) GetAmount() uint64 { - if m != nil { - return m.Amount +func _Query_VerifyPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVerifyPairingRequest) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(QueryServer).VerifyPairing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/VerifyPairing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).VerifyPairing(ctx, req.(*QueryVerifyPairingRequest)) + } + return interceptor(ctx, in, info, handler) } -type ChainIDPayout struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Payouts []*ProviderPayout `protobuf:"bytes,2,rep,name=payouts,proto3" json:"payouts,omitempty"` +func _Query_UserEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUserEntryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UserEntry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/UserEntry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UserEntry(ctx, req.(*QueryUserEntryRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ChainIDPayout) Reset() { *m = ChainIDPayout{} } -func (m *ChainIDPayout) String() string { return proto.CompactTextString(m) } -func (*ChainIDPayout) ProtoMessage() {} -func (*ChainIDPayout) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{31} -} -func (m *ChainIDPayout) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainIDPayout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainIDPayout.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _Query_StaticProvidersList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryStaticProvidersListRequest) + if err := dec(in); err != nil { + return nil, err } + if interceptor == nil { + return srv.(QueryServer).StaticProvidersList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/StaticProvidersList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StaticProvidersList(ctx, req.(*QueryStaticProvidersListRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ChainIDPayout) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainIDPayout.Merge(m, src) -} -func (m *ChainIDPayout) XXX_Size() int { - return m.Size() -} -func (m *ChainIDPayout) XXX_DiscardUnknown() { - xxx_messageInfo_ChainIDPayout.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainIDPayout proto.InternalMessageInfo -func (m *ChainIDPayout) GetChainId() string { - if m != nil { - return m.ChainId +func _Query_EffectivePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEffectivePolicyRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(QueryServer).EffectivePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/EffectivePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EffectivePolicy(ctx, req.(*QueryEffectivePolicyRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *ChainIDPayout) GetPayouts() []*ProviderPayout { - if m != nil { - return m.Payouts +func _Query_ProviderMonthlyPayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProviderMonthlyPayoutRequest) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(QueryServer).ProviderMonthlyPayout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/ProviderMonthlyPayout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProviderMonthlyPayout(ctx, req.(*QueryProviderMonthlyPayoutRequest)) + } + return interceptor(ctx, in, info, handler) } -type QuerySubscriptionMonthlyPayoutRequest struct { - Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` +func _Query_SubscriptionMonthlyPayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySubscriptionMonthlyPayoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SubscriptionMonthlyPayout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/SubscriptionMonthlyPayout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SubscriptionMonthlyPayout(ctx, req.(*QuerySubscriptionMonthlyPayoutRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QuerySubscriptionMonthlyPayoutRequest) Reset() { *m = QuerySubscriptionMonthlyPayoutRequest{} } -func (m *QuerySubscriptionMonthlyPayoutRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySubscriptionMonthlyPayoutRequest) ProtoMessage() {} -func (*QuerySubscriptionMonthlyPayoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{32} -} -func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func _Query_SdkPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPairingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SdkPairing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/SdkPairing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SdkPairing(ctx, req.(*QueryGetPairingRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func _Query_ProvidersEpochCu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProvidersEpochCuRequest) + if err := dec(in); err != nil { + return nil, err } + if interceptor == nil { + return srv.(QueryServer).ProvidersEpochCu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Query/ProvidersEpochCu", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProvidersEpochCu(ctx, req.(*QueryProvidersEpochCuRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.Merge(m, src) + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "lavanet.lava.pairing.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Providers", + Handler: _Query_Providers_Handler, + }, + { + MethodName: "GetPairing", + Handler: _Query_GetPairing_Handler, + }, + { + MethodName: "VerifyPairing", + Handler: _Query_VerifyPairing_Handler, + }, + { + MethodName: "UserEntry", + Handler: _Query_UserEntry_Handler, + }, + { + MethodName: "StaticProvidersList", + Handler: _Query_StaticProvidersList_Handler, + }, + { + MethodName: "EffectivePolicy", + Handler: _Query_EffectivePolicy_Handler, + }, + { + MethodName: "ProviderMonthlyPayout", + Handler: _Query_ProviderMonthlyPayout_Handler, + }, + { + MethodName: "SubscriptionMonthlyPayout", + Handler: _Query_SubscriptionMonthlyPayout_Handler, + }, + { + MethodName: "SdkPairing", + Handler: _Query_SdkPairing_Handler, + }, + { + MethodName: "ProvidersEpochCu", + Handler: _Query_ProvidersEpochCu_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "lavanet/lava/pairing/query.proto", } -func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_Size() int { - return m.Size() + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *QuerySubscriptionMonthlyPayoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest.DiscardUnknown(m) + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_QuerySubscriptionMonthlyPayoutRequest proto.InternalMessageInfo +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} -func (m *QuerySubscriptionMonthlyPayoutRequest) GetConsumer() string { - if m != nil { - return m.Consumer +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return "" + return dAtA[:n], nil } -type QuerySubscriptionMonthlyPayoutResponse struct { - Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Details []*ChainIDPayout `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QuerySubscriptionMonthlyPayoutResponse) Reset() { - *m = QuerySubscriptionMonthlyPayoutResponse{} -} -func (m *QuerySubscriptionMonthlyPayoutResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySubscriptionMonthlyPayoutResponse) ProtoMessage() {} -func (*QuerySubscriptionMonthlyPayoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e149ce9d21da0d8, []int{33} -} -func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.Merge(m, src) -} -func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySubscriptionMonthlyPayoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubscriptionMonthlyPayoutResponse proto.InternalMessageInfo - -func (m *QuerySubscriptionMonthlyPayoutResponse) GetTotal() uint64 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *QuerySubscriptionMonthlyPayoutResponse) GetDetails() []*ChainIDPayout { - if m != nil { - return m.Details - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.pairing.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.pairing.QueryParamsResponse") - proto.RegisterType((*QueryProvidersRequest)(nil), "lavanet.lava.pairing.QueryProvidersRequest") - proto.RegisterType((*QueryProvidersResponse)(nil), "lavanet.lava.pairing.QueryProvidersResponse") - proto.RegisterType((*QueryGetPairingRequest)(nil), "lavanet.lava.pairing.QueryGetPairingRequest") - proto.RegisterType((*QueryGetPairingResponse)(nil), "lavanet.lava.pairing.QueryGetPairingResponse") - proto.RegisterType((*QueryVerifyPairingRequest)(nil), "lavanet.lava.pairing.QueryVerifyPairingRequest") - proto.RegisterType((*QueryVerifyPairingResponse)(nil), "lavanet.lava.pairing.QueryVerifyPairingResponse") - proto.RegisterType((*QueryGetUniquePaymentStorageClientProviderRequest)(nil), "lavanet.lava.pairing.QueryGetUniquePaymentStorageClientProviderRequest") - proto.RegisterType((*QueryGetUniquePaymentStorageClientProviderResponse)(nil), "lavanet.lava.pairing.QueryGetUniquePaymentStorageClientProviderResponse") - proto.RegisterType((*QueryAllUniquePaymentStorageClientProviderRequest)(nil), "lavanet.lava.pairing.QueryAllUniquePaymentStorageClientProviderRequest") - proto.RegisterType((*QueryAllUniquePaymentStorageClientProviderResponse)(nil), "lavanet.lava.pairing.QueryAllUniquePaymentStorageClientProviderResponse") - proto.RegisterType((*QueryGetProviderPaymentStorageRequest)(nil), "lavanet.lava.pairing.QueryGetProviderPaymentStorageRequest") - proto.RegisterType((*QueryGetProviderPaymentStorageResponse)(nil), "lavanet.lava.pairing.QueryGetProviderPaymentStorageResponse") - proto.RegisterType((*QueryAllProviderPaymentStorageRequest)(nil), "lavanet.lava.pairing.QueryAllProviderPaymentStorageRequest") - proto.RegisterType((*QueryAllProviderPaymentStorageResponse)(nil), "lavanet.lava.pairing.QueryAllProviderPaymentStorageResponse") - proto.RegisterType((*QueryGetEpochPaymentsRequest)(nil), "lavanet.lava.pairing.QueryGetEpochPaymentsRequest") - proto.RegisterType((*QueryGetEpochPaymentsResponse)(nil), "lavanet.lava.pairing.QueryGetEpochPaymentsResponse") - proto.RegisterType((*QueryAllEpochPaymentsRequest)(nil), "lavanet.lava.pairing.QueryAllEpochPaymentsRequest") - proto.RegisterType((*QueryAllEpochPaymentsResponse)(nil), "lavanet.lava.pairing.QueryAllEpochPaymentsResponse") - proto.RegisterType((*QueryUserEntryRequest)(nil), "lavanet.lava.pairing.QueryUserEntryRequest") - proto.RegisterType((*QueryUserEntryResponse)(nil), "lavanet.lava.pairing.QueryUserEntryResponse") - proto.RegisterType((*QueryStaticProvidersListRequest)(nil), "lavanet.lava.pairing.QueryStaticProvidersListRequest") - proto.RegisterType((*QueryStaticProvidersListResponse)(nil), "lavanet.lava.pairing.QueryStaticProvidersListResponse") - proto.RegisterType((*QueryEffectivePolicyRequest)(nil), "lavanet.lava.pairing.QueryEffectivePolicyRequest") - proto.RegisterType((*QueryEffectivePolicyResponse)(nil), "lavanet.lava.pairing.QueryEffectivePolicyResponse") - proto.RegisterType((*QuerySdkPairingResponse)(nil), "lavanet.lava.pairing.QuerySdkPairingResponse") - proto.RegisterType((*QueryProviderMonthlyPayoutRequest)(nil), "lavanet.lava.pairing.QueryProviderMonthlyPayoutRequest") - proto.RegisterType((*SubscriptionPayout)(nil), "lavanet.lava.pairing.SubscriptionPayout") - proto.RegisterType((*QueryProviderMonthlyPayoutResponse)(nil), "lavanet.lava.pairing.QueryProviderMonthlyPayoutResponse") - proto.RegisterType((*ProviderPayout)(nil), "lavanet.lava.pairing.ProviderPayout") - proto.RegisterType((*ChainIDPayout)(nil), "lavanet.lava.pairing.ChainIDPayout") - proto.RegisterType((*QuerySubscriptionMonthlyPayoutRequest)(nil), "lavanet.lava.pairing.QuerySubscriptionMonthlyPayoutRequest") - proto.RegisterType((*QuerySubscriptionMonthlyPayoutResponse)(nil), "lavanet.lava.pairing.QuerySubscriptionMonthlyPayoutResponse") -} - -func init() { proto.RegisterFile("lavanet/lava/pairing/query.proto", fileDescriptor_9e149ce9d21da0d8) } - -var fileDescriptor_9e149ce9d21da0d8 = []byte{ - // 2001 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcb, 0x6f, 0xdc, 0x6a, - 0x15, 0xaf, 0x27, 0x8f, 0x26, 0xa7, 0x4d, 0x5b, 0x7d, 0x37, 0x49, 0x13, 0x93, 0x9b, 0xa6, 0x5f, - 0x5f, 0x09, 0x0d, 0xe3, 0x9b, 0xe9, 0xe3, 0x46, 0x7d, 0x41, 0xd2, 0x17, 0x29, 0x81, 0x9b, 0x4c, - 0x08, 0x0b, 0x36, 0x96, 0xe3, 0xf9, 0x32, 0x71, 0xe3, 0xb1, 0x5d, 0x3f, 0xa6, 0x09, 0xa3, 0x01, - 0x04, 0x62, 0x7b, 0x85, 0xc4, 0x65, 0x81, 0xc4, 0xf2, 0x4a, 0x88, 0x05, 0xec, 0x91, 0xd8, 0x21, - 0xd0, 0x5d, 0x20, 0x74, 0xa5, 0x6e, 0x58, 0x00, 0x42, 0x2d, 0xff, 0x00, 0xff, 0x01, 0xf2, 0xf7, - 0x1d, 0x7b, 0xec, 0x89, 0xc7, 0x33, 0xd3, 0x44, 0x6c, 0xda, 0x7c, 0xf6, 0x79, 0xfc, 0xce, 0xef, - 0x1c, 0xfb, 0x9c, 0xe3, 0x81, 0x39, 0x53, 0xab, 0x6b, 0x16, 0xf3, 0x95, 0xf0, 0x7f, 0xc5, 0xd1, - 0x0c, 0xd7, 0xb0, 0xaa, 0xca, 0xab, 0x80, 0xb9, 0x87, 0x45, 0xc7, 0xb5, 0x7d, 0x9b, 0x8c, 0xa3, - 0x44, 0x31, 0xfc, 0xbf, 0x88, 0x12, 0xf2, 0x78, 0xd5, 0xae, 0xda, 0x5c, 0x40, 0x09, 0xff, 0x12, - 0xb2, 0xf2, 0x4c, 0xd5, 0xb6, 0xab, 0x26, 0x53, 0x34, 0xc7, 0x50, 0x34, 0xcb, 0xb2, 0x7d, 0xcd, - 0x37, 0x6c, 0xcb, 0xc3, 0xbb, 0x5f, 0xd5, 0x6d, 0xaf, 0x66, 0x7b, 0xca, 0x8e, 0xe6, 0x31, 0xe1, - 0x42, 0xa9, 0x2f, 0xed, 0x30, 0x5f, 0x5b, 0x52, 0x1c, 0xad, 0x6a, 0x58, 0x5c, 0x18, 0x65, 0x2f, - 0x67, 0xe2, 0x72, 0x34, 0x57, 0xab, 0x45, 0xe6, 0x16, 0x32, 0x45, 0x98, 0x63, 0xeb, 0x7b, 0xaa, - 0xa3, 0x1d, 0xd6, 0x98, 0xe5, 0x47, 0xa2, 0x33, 0x29, 0x51, 0xcf, 0x61, 0x3a, 0xff, 0x07, 0xef, - 0x5e, 0x4a, 0x1b, 0x32, 0x35, 0xcb, 0x53, 0x1c, 0xdb, 0x34, 0x74, 0xa4, 0x40, 0xbe, 0x95, 0x0d, - 0xc6, 0xb5, 0xeb, 0x46, 0x85, 0xb9, 0x91, 0x33, 0xd5, 0xf3, 0x6d, 0x57, 0xab, 0x32, 0x54, 0x5a, - 0xc9, 0x54, 0x0a, 0x2c, 0xe3, 0x55, 0xc0, 0xda, 0x55, 0x54, 0xdd, 0x34, 0xc2, 0x63, 0x64, 0x12, - 0x4d, 0xdc, 0x4c, 0x99, 0xe0, 0x91, 0xa1, 0x82, 0xe2, 0xf9, 0xda, 0x3e, 0x53, 0x99, 0xe5, 0x47, - 0x79, 0x92, 0x17, 0xd3, 0x31, 0x06, 0x3b, 0x9e, 0xee, 0x1a, 0x4e, 0x48, 0x69, 0xea, 0x80, 0xd2, - 0x57, 0xd2, 0xe8, 0x5c, 0xfb, 0x25, 0xd3, 0x7d, 0x2f, 0xfa, 0x03, 0x85, 0x6e, 0xa4, 0x84, 0x2a, - 0xf6, 0x6b, 0xcb, 0x37, 0x6a, 0x4c, 0xa9, 0x2f, 0xc5, 0x7f, 0x0b, 0x41, 0x3a, 0x0e, 0x64, 0x33, - 0xcc, 0xe7, 0x06, 0xcf, 0x4f, 0x99, 0xbd, 0x0a, 0x98, 0xe7, 0xd3, 0x4d, 0xf8, 0x20, 0x75, 0xd5, - 0x73, 0x6c, 0xcb, 0x63, 0xe4, 0x1e, 0x0c, 0x8b, 0x3c, 0x4e, 0x49, 0x73, 0xd2, 0xfc, 0x99, 0xd2, - 0x4c, 0x31, 0xab, 0xc2, 0x8a, 0x42, 0x6b, 0x75, 0xf0, 0x8b, 0x7f, 0x5d, 0x3a, 0x55, 0x46, 0x0d, - 0xba, 0x09, 0x13, 0xc2, 0x24, 0x12, 0x15, 0xf9, 0x22, 0x53, 0x70, 0x5a, 0xdf, 0xd3, 0x0c, 0x6b, - 0xed, 0x09, 0xb7, 0x3a, 0x5a, 0x8e, 0x8e, 0x64, 0x16, 0xc0, 0xdb, 0xb3, 0x5f, 0x3f, 0x73, 0xed, - 0x1f, 0x30, 0x6b, 0xaa, 0x30, 0x27, 0xcd, 0x8f, 0x94, 0x13, 0x57, 0xe8, 0x3e, 0x4c, 0xb6, 0x9b, - 0x44, 0xa0, 0xdf, 0x02, 0xe0, 0x34, 0x3f, 0x0d, 0x59, 0x9e, 0x92, 0xe6, 0x06, 0xe6, 0xcf, 0x94, - 0xae, 0xa5, 0xc1, 0x26, 0x73, 0x52, 0xdc, 0x8a, 0x85, 0x11, 0x75, 0x42, 0xfd, 0xc5, 0xe0, 0x48, - 0xe1, 0xc2, 0x00, 0x7d, 0x81, 0xce, 0x9e, 0x33, 0x7f, 0x43, 0xc4, 0xd9, 0x3d, 0x80, 0x49, 0x18, - 0x16, 0xe5, 0xc1, 0xc1, 0x8f, 0x96, 0xf1, 0x44, 0x7f, 0x57, 0x80, 0x8b, 0x47, 0x8c, 0x21, 0xf4, - 0x35, 0x18, 0x8d, 0x6a, 0xc9, 0x7b, 0x1f, 0xe4, 0x2d, 0x6d, 0x72, 0x05, 0xc6, 0xf4, 0xc0, 0x75, - 0xc3, 0xf2, 0xe4, 0x3a, 0x1c, 0xc5, 0x60, 0xf9, 0x2c, 0x5e, 0x7c, 0x1a, 0x5e, 0x23, 0xcb, 0x30, - 0x1d, 0x96, 0x83, 0x6a, 0xb2, 0x5d, 0x5f, 0xf5, 0x6d, 0xd5, 0x62, 0x07, 0xbe, 0x8a, 0x99, 0x9c, - 0x1a, 0xe0, 0x0a, 0x13, 0xa1, 0xc0, 0x3a, 0xdb, 0xf5, 0xbf, 0x6b, 0x7f, 0x87, 0x1d, 0x44, 0x88, - 0xc9, 0x1d, 0xb8, 0x18, 0x3e, 0x8a, 0xaa, 0xa9, 0x79, 0xbe, 0x1a, 0x38, 0x15, 0xcd, 0x67, 0x15, - 0x75, 0xc7, 0xb4, 0xf5, 0xfd, 0xa9, 0x41, 0xae, 0x37, 0x1e, 0xde, 0x5e, 0xd7, 0x3c, 0x7f, 0x5b, - 0xdc, 0x5c, 0x0d, 0xef, 0x91, 0x25, 0x98, 0xe0, 0x42, 0xaa, 0xbd, 0x9b, 0x76, 0x36, 0xc4, 0x95, - 0x08, 0xbf, 0xf9, 0xc9, 0x6e, 0xc2, 0x13, 0xfd, 0x11, 0x4c, 0x73, 0xba, 0xbe, 0xc7, 0x5c, 0x63, - 0xf7, 0xf0, 0xb8, 0xf4, 0x13, 0x19, 0x46, 0x22, 0x92, 0x78, 0x84, 0xa3, 0xe5, 0xf8, 0x4c, 0xc6, - 0x61, 0x28, 0x19, 0x82, 0x38, 0xd0, 0xcf, 0x25, 0x90, 0xb3, 0x10, 0x60, 0xce, 0xc6, 0x61, 0xa8, - 0xae, 0x99, 0x46, 0x85, 0x03, 0x18, 0x29, 0x8b, 0x03, 0x59, 0x80, 0x0b, 0x61, 0x68, 0xac, 0xa2, - 0xb6, 0x12, 0x2a, 0x08, 0x3d, 0x2f, 0xae, 0xc7, 0x75, 0x4b, 0xe6, 0xe0, 0xac, 0x1e, 0xa8, 0x0e, - 0x73, 0x31, 0x51, 0xc2, 0x39, 0xe8, 0xc1, 0x06, 0x73, 0x45, 0x9a, 0x3e, 0x04, 0xc0, 0x27, 0x5c, - 0x35, 0x2a, 0x9c, 0xaa, 0x51, 0x9e, 0xea, 0xf0, 0xca, 0x5a, 0x05, 0x6b, 0x74, 0x0d, 0x96, 0xa2, - 0xb2, 0xda, 0xe6, 0x6f, 0xab, 0x0d, 0xf1, 0xb2, 0xda, 0x12, 0xc5, 0xf2, 0x98, 0x87, 0x1f, 0x79, - 0x8d, 0xf8, 0x1b, 0x87, 0x21, 0xc3, 0xaa, 0xb0, 0x03, 0x64, 0x4f, 0x1c, 0xe8, 0x9f, 0x25, 0x28, - 0xf5, 0x63, 0x0b, 0x99, 0xf8, 0x54, 0x02, 0x1a, 0x74, 0x15, 0xc7, 0xd7, 0xc7, 0x72, 0xf6, 0xeb, - 0xa3, 0xbb, 0x3b, 0x2c, 0xf5, 0x1e, 0x3c, 0xd1, 0x06, 0x52, 0xb2, 0x62, 0x9a, 0xbd, 0x53, 0xf2, - 0x0c, 0xa0, 0xd5, 0xd6, 0x10, 0xec, 0xf5, 0xa2, 0xe8, 0x81, 0xc5, 0xb0, 0x07, 0x16, 0x45, 0x9b, - 0xc5, 0x1e, 0x58, 0xdc, 0xd0, 0xaa, 0x0c, 0x75, 0xcb, 0x09, 0x4d, 0xfa, 0x69, 0x01, 0x49, 0xec, - 0xd1, 0x7b, 0xbf, 0x24, 0x0e, 0xfc, 0x7f, 0x48, 0x24, 0xcf, 0x53, 0x7c, 0x14, 0x38, 0x1f, 0x37, - 0xba, 0xf2, 0x21, 0xa2, 0x49, 0x11, 0xf2, 0x10, 0xae, 0xc5, 0xef, 0x3d, 0x34, 0x9e, 0x76, 0x9c, - 0x5f, 0x94, 0x9f, 0x49, 0x70, 0xbd, 0x9b, 0x3e, 0x72, 0xf8, 0x12, 0x26, 0x9d, 0x4c, 0x09, 0x4c, - 0xe7, 0x62, 0x87, 0xd6, 0x95, 0xa9, 0x83, 0x54, 0x75, 0xb0, 0x48, 0x6d, 0x8c, 0x6a, 0xc5, 0x34, - 0xf3, 0xa3, 0x3a, 0xa9, 0xba, 0xfa, 0x67, 0xc4, 0x43, 0x8e, 0xc7, 0x1e, 0x78, 0x18, 0x38, 0x59, - 0x1e, 0x4e, 0xae, 0x4c, 0x6e, 0xc3, 0x4c, 0x94, 0x66, 0xfe, 0xf6, 0x43, 0x3f, 0x5e, 0x7e, 0x75, - 0x38, 0xf0, 0x61, 0x07, 0x2d, 0xe4, 0xe2, 0x13, 0x18, 0x63, 0xc9, 0x1b, 0x98, 0x81, 0x2b, 0xd9, - 0x14, 0xa4, 0x6c, 0x60, 0xe4, 0x69, 0x7d, 0xba, 0x8b, 0x38, 0x57, 0x4c, 0x33, 0x13, 0xe7, 0x49, - 0xe5, 0xfb, 0x0f, 0x12, 0x86, 0x76, 0xd4, 0x51, 0xe7, 0xd0, 0x06, 0x8e, 0x13, 0xda, 0xc9, 0xe5, - 0x52, 0xc3, 0xb9, 0x6f, 0xdb, 0x63, 0x2e, 0x9f, 0x53, 0x12, 0x7d, 0x5b, 0xab, 0x54, 0x5c, 0xe6, - 0x79, 0x51, 0xdf, 0xc6, 0x63, 0xb2, 0xa3, 0x17, 0xd2, 0x1d, 0x3d, 0xee, 0xce, 0x03, 0xc9, 0xee, - 0xfc, 0x1a, 0x47, 0xb3, 0x84, 0x0b, 0xa4, 0xe5, 0x39, 0x8c, 0xe8, 0xb6, 0xe5, 0x05, 0xb5, 0xb8, - 0xe7, 0xf4, 0x35, 0x4b, 0xc5, 0xca, 0xa1, 0xe3, 0x9a, 0x76, 0xf0, 0x78, 0x1b, 0x47, 0x28, 0x71, - 0xa0, 0xf7, 0xe1, 0x12, 0x77, 0xbc, 0x15, 0x6e, 0x4b, 0x7a, 0xdc, 0xce, 0xd7, 0x0d, 0xcf, 0xef, - 0x3a, 0x9d, 0xd0, 0x1a, 0xcc, 0x75, 0x56, 0x3e, 0xf1, 0x61, 0x90, 0x6e, 0xc2, 0x57, 0xb8, 0xbb, - 0xa7, 0xbb, 0xbb, 0x4c, 0xf7, 0x8d, 0x3a, 0xdb, 0xe0, 0x7b, 0x52, 0x84, 0x53, 0x6e, 0x63, 0x6a, - 0x34, 0x11, 0xfc, 0x24, 0x0c, 0x87, 0x93, 0x5c, 0x9c, 0x0e, 0x3c, 0xd1, 0x5f, 0x4a, 0x58, 0xff, - 0x47, 0x6c, 0x22, 0xfc, 0x12, 0x0c, 0x8b, 0x6d, 0x0c, 0xc9, 0x97, 0xdb, 0xca, 0x31, 0xdc, 0xd7, - 0x8a, 0xa8, 0x83, 0x92, 0x64, 0x05, 0xce, 0x39, 0xcc, 0xaa, 0x18, 0x56, 0x55, 0x45, 0xdd, 0x42, - 0x57, 0xdd, 0x31, 0xd4, 0x10, 0x47, 0xfa, 0x5f, 0x09, 0xc7, 0xeb, 0xad, 0xca, 0x7e, 0xfb, 0xa8, - 0xf6, 0x1c, 0x4e, 0x47, 0xf3, 0xa6, 0xc0, 0xf4, 0xb5, 0xec, 0x47, 0xa4, 0xc3, 0x78, 0x5e, 0x8e, - 0xb4, 0xc9, 0x04, 0x0c, 0xd7, 0xb4, 0x03, 0x55, 0x0f, 0x92, 0x25, 0x11, 0x90, 0x9b, 0x30, 0x18, - 0xb2, 0xc3, 0x0b, 0xf4, 0x4c, 0xe9, 0x62, 0xda, 0x38, 0xdf, 0x5c, 0xb7, 0x1c, 0xa6, 0x97, 0xb9, - 0x10, 0x59, 0x83, 0xf3, 0xd1, 0x3a, 0xa6, 0xe2, 0x62, 0x35, 0xc8, 0xf5, 0xe6, 0xd2, 0x7a, 0xf1, - 0xce, 0x56, 0x5f, 0xc2, 0xe5, 0xaa, 0x7c, 0x2e, 0xba, 0x26, 0xce, 0xf4, 0xeb, 0x70, 0x39, 0xb5, - 0x0b, 0x7d, 0xdb, 0xb6, 0xfc, 0x3d, 0xf3, 0x70, 0x43, 0x3b, 0xb4, 0x03, 0x3f, 0x91, 0x64, 0x27, - 0x39, 0x82, 0x25, 0x06, 0x5f, 0xba, 0x0f, 0x64, 0x2b, 0xb1, 0x6c, 0x0a, 0x45, 0x42, 0xe1, 0x6c, - 0x72, 0x05, 0x45, 0xad, 0xd4, 0x35, 0x32, 0x0d, 0x23, 0xbc, 0xa6, 0xc3, 0xc1, 0x34, 0xf5, 0xbc, - 0x56, 0xc2, 0xca, 0xd1, 0x6a, 0x76, 0x60, 0xf9, 0xf8, 0xc0, 0xe2, 0x89, 0xfe, 0x10, 0x68, 0x1e, - 0xda, 0xd6, 0x58, 0xed, 0xdb, 0xbe, 0x66, 0x72, 0xaf, 0x83, 0x65, 0x71, 0x20, 0xab, 0x70, 0xba, - 0xc2, 0x7c, 0xcd, 0x30, 0xbd, 0xa9, 0x02, 0x7f, 0x22, 0xe6, 0xb3, 0x33, 0x78, 0x34, 0x9a, 0x72, - 0xa4, 0x48, 0x9f, 0xc0, 0xb9, 0x44, 0x87, 0x0b, 0x03, 0xcd, 0xa1, 0x26, 0x11, 0x45, 0x21, 0x15, - 0xc5, 0x4b, 0x18, 0x7b, 0x2c, 0x1e, 0x66, 0x34, 0x92, 0x64, 0x42, 0x4a, 0x33, 0xf1, 0x28, 0xac, - 0xbb, 0x50, 0x28, 0x42, 0x7d, 0xb5, 0x6b, 0xe3, 0xe5, 0x88, 0x51, 0x89, 0x3e, 0xc6, 0x19, 0x23, - 0x19, 0x55, 0xa7, 0x1c, 0x77, 0x7a, 0x90, 0x69, 0x13, 0xc7, 0x86, 0x1c, 0x23, 0xb9, 0xd4, 0x3f, - 0x6c, 0xa7, 0xbe, 0x43, 0x7f, 0x49, 0xb1, 0x12, 0xb3, 0x5e, 0xfa, 0xf5, 0x14, 0x0c, 0x71, 0xff, - 0xe4, 0xa7, 0x12, 0x0c, 0x8b, 0xc2, 0x25, 0xf3, 0x39, 0xcf, 0x5f, 0xea, 0xa3, 0x84, 0xbc, 0xd0, - 0x83, 0xa4, 0x80, 0x4f, 0xaf, 0xfe, 0xe4, 0xcd, 0x7f, 0x7e, 0x51, 0x98, 0x25, 0x33, 0x4a, 0xce, - 0xc7, 0x28, 0xf2, 0x2b, 0x09, 0x46, 0x5b, 0x3b, 0xd8, 0xcd, 0x3c, 0xf3, 0x6d, 0x1f, 0x2d, 0xe4, - 0xc5, 0xde, 0x84, 0x11, 0xce, 0x12, 0x87, 0x73, 0x93, 0x2c, 0x28, 0xb9, 0x9f, 0xa3, 0x3c, 0xa5, - 0x81, 0xcd, 0xa1, 0x49, 0x7e, 0x23, 0x01, 0xb4, 0x5e, 0x3f, 0x64, 0xb1, 0xc7, 0xb7, 0x94, 0x40, - 0xd7, 0xdf, 0x3b, 0x8d, 0x3e, 0xe0, 0xf0, 0xee, 0x92, 0xdb, 0xd9, 0xf0, 0xaa, 0x2c, 0xde, 0xd1, - 0x5b, 0x00, 0x95, 0x86, 0x58, 0xa6, 0x9b, 0xe4, 0x2f, 0x12, 0x8c, 0xa5, 0xd6, 0x62, 0xa2, 0xe4, - 0xb8, 0xcf, 0x5a, 0xe1, 0xe5, 0x8f, 0x7a, 0x57, 0x40, 0xc8, 0x65, 0x0e, 0x79, 0x9d, 0xbc, 0xc8, - 0x86, 0x5c, 0xe7, 0x4a, 0x39, 0xa8, 0x95, 0x46, 0x44, 0x7a, 0x53, 0x69, 0xf0, 0x29, 0xa2, 0x49, - 0x7e, 0x56, 0x00, 0xba, 0xdd, 0xc3, 0x32, 0x94, 0x4f, 0x6e, 0xcf, 0x5b, 0xa6, 0xfc, 0xcd, 0xe3, - 0x1b, 0x42, 0x36, 0xd6, 0x39, 0x1b, 0xcf, 0xc8, 0x13, 0xe5, 0x18, 0x5f, 0x2e, 0x95, 0x06, 0x1f, - 0xa3, 0x9b, 0xe4, 0xc7, 0x05, 0xb8, 0xd6, 0xdd, 0xf9, 0x8a, 0x69, 0xe6, 0x52, 0xd1, 0xcf, 0xc2, - 0x9d, 0x4b, 0x45, 0x5f, 0xbb, 0x33, 0x7d, 0xc2, 0xa9, 0x78, 0x44, 0x1e, 0x1c, 0x87, 0x0a, 0xf2, - 0x46, 0x82, 0xc9, 0xec, 0x15, 0x88, 0xdc, 0xef, 0xf2, 0x6c, 0xe5, 0x2d, 0x80, 0xf2, 0x83, 0xf7, - 0x53, 0xc6, 0xd8, 0x1e, 0xf1, 0xd8, 0x96, 0xc9, 0x5d, 0xa5, 0xaf, 0xaf, 0xda, 0x71, 0x62, 0xff, - 0x26, 0xc1, 0x74, 0xb6, 0x8b, 0x30, 0x99, 0xf7, 0xf3, 0x73, 0xf0, 0xfe, 0x81, 0x75, 0x5d, 0x52, - 0xe9, 0x5d, 0x1e, 0xd8, 0x47, 0xa4, 0xd8, 0x5f, 0x60, 0xe4, 0xf7, 0x12, 0x8c, 0xa5, 0x76, 0x19, - 0x52, 0xca, 0x27, 0x38, 0x6b, 0x4b, 0x93, 0x6f, 0xf5, 0xa5, 0x83, 0x90, 0x6f, 0x73, 0xc8, 0x45, - 0xb2, 0xa8, 0xf4, 0xf0, 0x5b, 0x46, 0x9c, 0x81, 0xdf, 0x4a, 0x70, 0x21, 0x65, 0x2f, 0x24, 0xbe, - 0x94, 0xcf, 0x5d, 0xdf, 0x98, 0x3b, 0x2d, 0x89, 0x74, 0x91, 0x63, 0xbe, 0x4e, 0xae, 0xf6, 0x82, - 0x99, 0x7c, 0x2e, 0xc1, 0x68, 0xbc, 0x51, 0xe5, 0x76, 0xc7, 0xf6, 0xd5, 0x2e, 0xb7, 0x3b, 0x1e, - 0x59, 0xd2, 0xba, 0xb5, 0x9f, 0xc0, 0x63, 0xae, 0xf8, 0xb9, 0x44, 0x69, 0xe0, 0x86, 0xd8, 0x4c, - 0x34, 0xca, 0x3f, 0x49, 0xf0, 0x41, 0xc6, 0x0a, 0x45, 0xee, 0xe4, 0x60, 0xe8, 0xbc, 0xaf, 0xc9, - 0x77, 0xfb, 0x55, 0xc3, 0x20, 0x1e, 0xf2, 0x20, 0x3e, 0x26, 0x77, 0xb2, 0x83, 0xf0, 0xb8, 0x6a, - 0xeb, 0x43, 0xb0, 0x6a, 0x1a, 0x9e, 0x9f, 0x88, 0xe2, 0x8f, 0x12, 0x9c, 0x6f, 0xdb, 0xa2, 0xc8, - 0x52, 0x0e, 0x94, 0xec, 0x2d, 0x4e, 0x2e, 0xf5, 0xa3, 0x82, 0xc8, 0x57, 0x39, 0xf2, 0x07, 0xe4, - 0x5e, 0x87, 0xaa, 0x88, 0xd4, 0x70, 0x1d, 0x53, 0x1a, 0xd1, 0x38, 0xd9, 0x54, 0x1a, 0x62, 0x11, - 0x6c, 0x92, 0xbf, 0x4a, 0x30, 0x91, 0x39, 0xcb, 0x93, 0x8f, 0x7b, 0x18, 0x94, 0xb2, 0xe6, 0x58, - 0x79, 0xb9, 0x7f, 0x45, 0x0c, 0xe8, 0x1b, 0x3c, 0xa0, 0x7b, 0x64, 0xb9, 0xcb, 0xdb, 0xa4, 0x26, - 0xb4, 0x55, 0x31, 0x62, 0x27, 0x26, 0x02, 0xf2, 0x0f, 0x09, 0xa6, 0x3b, 0xce, 0xc8, 0xb9, 0x2f, - 0xca, 0x6e, 0xe3, 0x79, 0xee, 0x8b, 0xb2, 0xeb, 0x58, 0xde, 0xad, 0xbb, 0x25, 0xd7, 0xb2, 0x23, - 0xe1, 0xc5, 0x69, 0x23, 0x9f, 0x49, 0x00, 0xad, 0xd5, 0xf8, 0x04, 0x67, 0xcb, 0xa3, 0xfb, 0x36, - 0x5d, 0xe0, 0x88, 0xaf, 0x90, 0xcb, 0x1d, 0x10, 0x57, 0xf6, 0xa3, 0x29, 0x6d, 0x75, 0xe5, 0x8b, - 0xb7, 0xb3, 0xd2, 0x97, 0x6f, 0x67, 0xa5, 0x7f, 0xbf, 0x9d, 0x95, 0x7e, 0xfe, 0x6e, 0xf6, 0xd4, - 0x97, 0xef, 0x66, 0x4f, 0xfd, 0xfd, 0xdd, 0xec, 0xa9, 0xef, 0xdf, 0xa8, 0x1a, 0xfe, 0x5e, 0xb0, - 0x53, 0xd4, 0xed, 0x5a, 0xda, 0xcc, 0x41, 0x6c, 0xc8, 0x3f, 0x74, 0x98, 0xb7, 0x33, 0xcc, 0x7f, - 0xd4, 0xbc, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x5f, 0xe2, 0xef, 0x1c, 0x1f, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of Providers items. - Providers(ctx context.Context, in *QueryProvidersRequest, opts ...grpc.CallOption) (*QueryProvidersResponse, error) - // Queries a list of GetPairing items. - GetPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QueryGetPairingResponse, error) - // Queries a list of VerifyPairing items. - VerifyPairing(ctx context.Context, in *QueryVerifyPairingRequest, opts ...grpc.CallOption) (*QueryVerifyPairingResponse, error) - // Queries a UniquePaymentStorageClientProvider by index. - UniquePaymentStorageClientProvider(ctx context.Context, in *QueryGetUniquePaymentStorageClientProviderRequest, opts ...grpc.CallOption) (*QueryGetUniquePaymentStorageClientProviderResponse, error) - // Queries a list of UniquePaymentStorageClientProvider items. - UniquePaymentStorageClientProviderAll(ctx context.Context, in *QueryAllUniquePaymentStorageClientProviderRequest, opts ...grpc.CallOption) (*QueryAllUniquePaymentStorageClientProviderResponse, error) - // Queries a ProviderPaymentStorage by index. - ProviderPaymentStorage(ctx context.Context, in *QueryGetProviderPaymentStorageRequest, opts ...grpc.CallOption) (*QueryGetProviderPaymentStorageResponse, error) - // Queries a list of ProviderPaymentStorage items. - ProviderPaymentStorageAll(ctx context.Context, in *QueryAllProviderPaymentStorageRequest, opts ...grpc.CallOption) (*QueryAllProviderPaymentStorageResponse, error) - // Queries a EpochPayments by index. - EpochPayments(ctx context.Context, in *QueryGetEpochPaymentsRequest, opts ...grpc.CallOption) (*QueryGetEpochPaymentsResponse, error) - // Queries a list of EpochPayments items. - EpochPaymentsAll(ctx context.Context, in *QueryAllEpochPaymentsRequest, opts ...grpc.CallOption) (*QueryAllEpochPaymentsResponse, error) - // Queries a UserEntry items. - UserEntry(ctx context.Context, in *QueryUserEntryRequest, opts ...grpc.CallOption) (*QueryUserEntryResponse, error) - // Queries a list of StaticProvidersList items. - StaticProvidersList(ctx context.Context, in *QueryStaticProvidersListRequest, opts ...grpc.CallOption) (*QueryStaticProvidersListResponse, error) - // Queries a list of EffectivePolicy items. - EffectivePolicy(ctx context.Context, in *QueryEffectivePolicyRequest, opts ...grpc.CallOption) (*QueryEffectivePolicyResponse, error) - // Queries the expected monthly payout of a specific provider - ProviderMonthlyPayout(ctx context.Context, in *QueryProviderMonthlyPayoutRequest, opts ...grpc.CallOption) (*QueryProviderMonthlyPayoutResponse, error) - // Queries the expected monthly payout of a specific subscription - SubscriptionMonthlyPayout(ctx context.Context, in *QuerySubscriptionMonthlyPayoutRequest, opts ...grpc.CallOption) (*QuerySubscriptionMonthlyPayoutResponse, error) - // this line is used by starport scaffolding # 2 - // Queries a list of SdkPairing items. - SdkPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QuerySdkPairingResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/Params", in, out, opts...) +func (m *QueryProvidersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *queryClient) Providers(ctx context.Context, in *QueryProvidersRequest, opts ...grpc.CallOption) (*QueryProvidersResponse, error) { - out := new(QueryProvidersResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/Providers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QueryProvidersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *queryClient) GetPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QueryGetPairingResponse, error) { - out := new(QueryGetPairingResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/GetPairing", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryProvidersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ShowFrozen { + i-- + if m.ShowFrozen { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 } - return out, nil -} - -func (c *queryClient) VerifyPairing(ctx context.Context, in *QueryVerifyPairingRequest, opts ...grpc.CallOption) (*QueryVerifyPairingResponse, error) { - out := new(QueryVerifyPairingResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/VerifyPairing", in, out, opts...) - if err != nil { - return nil, err + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil } -func (c *queryClient) UniquePaymentStorageClientProvider(ctx context.Context, in *QueryGetUniquePaymentStorageClientProviderRequest, opts ...grpc.CallOption) (*QueryGetUniquePaymentStorageClientProviderResponse, error) { - out := new(QueryGetUniquePaymentStorageClientProviderResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/UniquePaymentStorageClientProvider", in, out, opts...) +func (m *QueryProvidersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *queryClient) UniquePaymentStorageClientProviderAll(ctx context.Context, in *QueryAllUniquePaymentStorageClientProviderRequest, opts ...grpc.CallOption) (*QueryAllUniquePaymentStorageClientProviderResponse, error) { - out := new(QueryAllUniquePaymentStorageClientProviderResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/UniquePaymentStorageClientProviderAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QueryProvidersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *queryClient) ProviderPaymentStorage(ctx context.Context, in *QueryGetProviderPaymentStorageRequest, opts ...grpc.CallOption) (*QueryGetProviderPaymentStorageResponse, error) { - out := new(QueryGetProviderPaymentStorageResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/ProviderPaymentStorage", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryProvidersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StakeEntry) > 0 { + for iNdEx := len(m.StakeEntry) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StakeEntry[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return out, nil + return len(dAtA) - i, nil } -func (c *queryClient) ProviderPaymentStorageAll(ctx context.Context, in *QueryAllProviderPaymentStorageRequest, opts ...grpc.CallOption) (*QueryAllProviderPaymentStorageResponse, error) { - out := new(QueryAllProviderPaymentStorageResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/ProviderPaymentStorageAll", in, out, opts...) +func (m *QueryGetPairingRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *queryClient) EpochPayments(ctx context.Context, in *QueryGetEpochPaymentsRequest, opts ...grpc.CallOption) (*QueryGetEpochPaymentsResponse, error) { - out := new(QueryGetEpochPaymentsResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/EpochPayments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QueryGetPairingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *queryClient) EpochPaymentsAll(ctx context.Context, in *QueryAllEpochPaymentsRequest, opts ...grpc.CallOption) (*QueryAllEpochPaymentsResponse, error) { - out := new(QueryAllEpochPaymentsResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/EpochPaymentsAll", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGetPairingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Client) > 0 { + i -= len(m.Client) + copy(dAtA[i:], m.Client) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Client))) + i-- + dAtA[i] = 0x12 } - return out, nil -} - -func (c *queryClient) UserEntry(ctx context.Context, in *QueryUserEntryRequest, opts ...grpc.CallOption) (*QueryUserEntryResponse, error) { - out := new(QueryUserEntryResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/UserEntry", in, out, opts...) - if err != nil { - return nil, err + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil } -func (c *queryClient) StaticProvidersList(ctx context.Context, in *QueryStaticProvidersListRequest, opts ...grpc.CallOption) (*QueryStaticProvidersListResponse, error) { - out := new(QueryStaticProvidersListResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/StaticProvidersList", in, out, opts...) +func (m *QueryGetPairingResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *queryClient) EffectivePolicy(ctx context.Context, in *QueryEffectivePolicyRequest, opts ...grpc.CallOption) (*QueryEffectivePolicyResponse, error) { - out := new(QueryEffectivePolicyResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/EffectivePolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QueryGetPairingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *queryClient) ProviderMonthlyPayout(ctx context.Context, in *QueryProviderMonthlyPayoutRequest, opts ...grpc.CallOption) (*QueryProviderMonthlyPayoutResponse, error) { - out := new(QueryProviderMonthlyPayoutResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/ProviderMonthlyPayout", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGetPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockOfNextPairing != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockOfNextPairing)) + i-- + dAtA[i] = 0x28 } - return out, nil -} - -func (c *queryClient) SubscriptionMonthlyPayout(ctx context.Context, in *QuerySubscriptionMonthlyPayoutRequest, opts ...grpc.CallOption) (*QuerySubscriptionMonthlyPayoutResponse, error) { - out := new(QuerySubscriptionMonthlyPayoutResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/SubscriptionMonthlyPayout", in, out, opts...) - if err != nil { - return nil, err + if m.SpecLastUpdatedBlock != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SpecLastUpdatedBlock)) + i-- + dAtA[i] = 0x20 } - return out, nil + if m.TimeLeftToNextPairing != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TimeLeftToNextPairing)) + i-- + dAtA[i] = 0x18 + } + if m.CurrentEpoch != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x10 + } + if len(m.Providers) > 0 { + for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Providers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } -func (c *queryClient) SdkPairing(ctx context.Context, in *QueryGetPairingRequest, opts ...grpc.CallOption) (*QuerySdkPairingResponse, error) { - out := new(QuerySdkPairingResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Query/SdkPairing", in, out, opts...) +func (m *QueryVerifyPairingRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Providers items. - Providers(context.Context, *QueryProvidersRequest) (*QueryProvidersResponse, error) - // Queries a list of GetPairing items. - GetPairing(context.Context, *QueryGetPairingRequest) (*QueryGetPairingResponse, error) - // Queries a list of VerifyPairing items. - VerifyPairing(context.Context, *QueryVerifyPairingRequest) (*QueryVerifyPairingResponse, error) - // Queries a UniquePaymentStorageClientProvider by index. - UniquePaymentStorageClientProvider(context.Context, *QueryGetUniquePaymentStorageClientProviderRequest) (*QueryGetUniquePaymentStorageClientProviderResponse, error) - // Queries a list of UniquePaymentStorageClientProvider items. - UniquePaymentStorageClientProviderAll(context.Context, *QueryAllUniquePaymentStorageClientProviderRequest) (*QueryAllUniquePaymentStorageClientProviderResponse, error) - // Queries a ProviderPaymentStorage by index. - ProviderPaymentStorage(context.Context, *QueryGetProviderPaymentStorageRequest) (*QueryGetProviderPaymentStorageResponse, error) - // Queries a list of ProviderPaymentStorage items. - ProviderPaymentStorageAll(context.Context, *QueryAllProviderPaymentStorageRequest) (*QueryAllProviderPaymentStorageResponse, error) - // Queries a EpochPayments by index. - EpochPayments(context.Context, *QueryGetEpochPaymentsRequest) (*QueryGetEpochPaymentsResponse, error) - // Queries a list of EpochPayments items. - EpochPaymentsAll(context.Context, *QueryAllEpochPaymentsRequest) (*QueryAllEpochPaymentsResponse, error) - // Queries a UserEntry items. - UserEntry(context.Context, *QueryUserEntryRequest) (*QueryUserEntryResponse, error) - // Queries a list of StaticProvidersList items. - StaticProvidersList(context.Context, *QueryStaticProvidersListRequest) (*QueryStaticProvidersListResponse, error) - // Queries a list of EffectivePolicy items. - EffectivePolicy(context.Context, *QueryEffectivePolicyRequest) (*QueryEffectivePolicyResponse, error) - // Queries the expected monthly payout of a specific provider - ProviderMonthlyPayout(context.Context, *QueryProviderMonthlyPayoutRequest) (*QueryProviderMonthlyPayoutResponse, error) - // Queries the expected monthly payout of a specific subscription - SubscriptionMonthlyPayout(context.Context, *QuerySubscriptionMonthlyPayoutRequest) (*QuerySubscriptionMonthlyPayoutResponse, error) - // this line is used by starport scaffolding # 2 - // Queries a list of SdkPairing items. - SdkPairing(context.Context, *QueryGetPairingRequest) (*QuerySdkPairingResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Providers(ctx context.Context, req *QueryProvidersRequest) (*QueryProvidersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Providers not implemented") -} -func (*UnimplementedQueryServer) GetPairing(ctx context.Context, req *QueryGetPairingRequest) (*QueryGetPairingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPairing not implemented") -} -func (*UnimplementedQueryServer) VerifyPairing(ctx context.Context, req *QueryVerifyPairingRequest) (*QueryVerifyPairingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyPairing not implemented") -} -func (*UnimplementedQueryServer) UniquePaymentStorageClientProvider(ctx context.Context, req *QueryGetUniquePaymentStorageClientProviderRequest) (*QueryGetUniquePaymentStorageClientProviderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UniquePaymentStorageClientProvider not implemented") -} -func (*UnimplementedQueryServer) UniquePaymentStorageClientProviderAll(ctx context.Context, req *QueryAllUniquePaymentStorageClientProviderRequest) (*QueryAllUniquePaymentStorageClientProviderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UniquePaymentStorageClientProviderAll not implemented") -} -func (*UnimplementedQueryServer) ProviderPaymentStorage(ctx context.Context, req *QueryGetProviderPaymentStorageRequest) (*QueryGetProviderPaymentStorageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProviderPaymentStorage not implemented") -} -func (*UnimplementedQueryServer) ProviderPaymentStorageAll(ctx context.Context, req *QueryAllProviderPaymentStorageRequest) (*QueryAllProviderPaymentStorageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProviderPaymentStorageAll not implemented") -} -func (*UnimplementedQueryServer) EpochPayments(ctx context.Context, req *QueryGetEpochPaymentsRequest) (*QueryGetEpochPaymentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EpochPayments not implemented") -} -func (*UnimplementedQueryServer) EpochPaymentsAll(ctx context.Context, req *QueryAllEpochPaymentsRequest) (*QueryAllEpochPaymentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EpochPaymentsAll not implemented") -} -func (*UnimplementedQueryServer) UserEntry(ctx context.Context, req *QueryUserEntryRequest) (*QueryUserEntryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserEntry not implemented") -} -func (*UnimplementedQueryServer) StaticProvidersList(ctx context.Context, req *QueryStaticProvidersListRequest) (*QueryStaticProvidersListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StaticProvidersList not implemented") -} -func (*UnimplementedQueryServer) EffectivePolicy(ctx context.Context, req *QueryEffectivePolicyRequest) (*QueryEffectivePolicyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EffectivePolicy not implemented") -} -func (*UnimplementedQueryServer) ProviderMonthlyPayout(ctx context.Context, req *QueryProviderMonthlyPayoutRequest) (*QueryProviderMonthlyPayoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProviderMonthlyPayout not implemented") -} -func (*UnimplementedQueryServer) SubscriptionMonthlyPayout(ctx context.Context, req *QuerySubscriptionMonthlyPayoutRequest) (*QuerySubscriptionMonthlyPayoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubscriptionMonthlyPayout not implemented") -} -func (*UnimplementedQueryServer) SdkPairing(ctx context.Context, req *QueryGetPairingRequest) (*QuerySdkPairingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SdkPairing not implemented") + return dAtA[:n], nil } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +func (m *QueryVerifyPairingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err +func (m *QueryVerifyPairingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x20 } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x1a } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/Params", + if len(m.Client) > 0 { + i -= len(m.Client) + copy(dAtA[i:], m.Client) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Client))) + i-- + dAtA[i] = 0x12 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _Query_Providers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProvidersRequest) - if err := dec(in); err != nil { +func (m *QueryVerifyPairingResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).Providers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/Providers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Providers(ctx, req.(*QueryProvidersRequest)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _Query_GetPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPairingRequest) - if err := dec(in); err != nil { - return nil, err +func (m *QueryVerifyPairingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVerifyPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProjectId) > 0 { + i -= len(m.ProjectId) + copy(dAtA[i:], m.ProjectId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProjectId))) + i-- + dAtA[i] = 0x2a } - if interceptor == nil { - return srv.(QueryServer).GetPairing(ctx, in) + if m.CuPerEpoch != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CuPerEpoch)) + i-- + dAtA[i] = 0x20 } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/GetPairing", + if m.PairedProviders != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PairedProviders)) + i-- + dAtA[i] = 0x18 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetPairing(ctx, req.(*QueryGetPairingRequest)) + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _Query_VerifyPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVerifyPairingRequest) - if err := dec(in); err != nil { +func (m *QueryUserEntryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).VerifyPairing(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/VerifyPairing", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).VerifyPairing(ctx, req.(*QueryVerifyPairingRequest)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _Query_UniquePaymentStorageClientProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetUniquePaymentStorageClientProviderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).UniquePaymentStorageClientProvider(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/UniquePaymentStorageClientProvider", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UniquePaymentStorageClientProvider(ctx, req.(*QueryGetUniquePaymentStorageClientProviderRequest)) - } - return interceptor(ctx, in, info, handler) +func (m *QueryUserEntryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Query_UniquePaymentStorageClientProviderAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllUniquePaymentStorageClientProviderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).UniquePaymentStorageClientProviderAll(ctx, in) +func (m *QueryUserEntryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x18 } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/UniquePaymentStorageClientProviderAll", + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0x12 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UniquePaymentStorageClientProviderAll(ctx, req.(*QueryAllUniquePaymentStorageClientProviderRequest)) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _Query_ProviderPaymentStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetProviderPaymentStorageRequest) - if err := dec(in); err != nil { +func (m *QueryUserEntryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).ProviderPaymentStorage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/ProviderPaymentStorage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ProviderPaymentStorage(ctx, req.(*QueryGetProviderPaymentStorageRequest)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _Query_ProviderPaymentStorageAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllProviderPaymentStorageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ProviderPaymentStorageAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/ProviderPaymentStorageAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ProviderPaymentStorageAll(ctx, req.(*QueryAllProviderPaymentStorageRequest)) - } - return interceptor(ctx, in, info, handler) +func (m *QueryUserEntryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Query_EpochPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetEpochPaymentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).EpochPayments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/EpochPayments", +func (m *QueryUserEntryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxCU != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.MaxCU)) + i-- + dAtA[i] = 0x10 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EpochPayments(ctx, req.(*QueryGetEpochPaymentsRequest)) + { + size, err := m.Consumer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return interceptor(ctx, in, info, handler) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func _Query_EpochPaymentsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllEpochPaymentsRequest) - if err := dec(in); err != nil { +func (m *QueryStaticProvidersListRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).EpochPaymentsAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/EpochPaymentsAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EpochPaymentsAll(ctx, req.(*QueryAllEpochPaymentsRequest)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _Query_UserEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUserEntryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).UserEntry(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/UserEntry", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UserEntry(ctx, req.(*QueryUserEntryRequest)) - } - return interceptor(ctx, in, info, handler) +func (m *QueryStaticProvidersListRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Query_StaticProvidersList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryStaticProvidersListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).StaticProvidersList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/StaticProvidersList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).StaticProvidersList(ctx, req.(*QueryStaticProvidersListRequest)) +func (m *QueryStaticProvidersListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _Query_EffectivePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEffectivePolicyRequest) - if err := dec(in); err != nil { +func (m *QueryStaticProvidersListResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).EffectivePolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/EffectivePolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EffectivePolicy(ctx, req.(*QueryEffectivePolicyRequest)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _Query_ProviderMonthlyPayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProviderMonthlyPayoutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ProviderMonthlyPayout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/ProviderMonthlyPayout", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ProviderMonthlyPayout(ctx, req.(*QueryProviderMonthlyPayoutRequest)) - } - return interceptor(ctx, in, info, handler) +func (m *QueryStaticProvidersListResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Query_SubscriptionMonthlyPayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySubscriptionMonthlyPayoutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SubscriptionMonthlyPayout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/SubscriptionMonthlyPayout", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SubscriptionMonthlyPayout(ctx, req.(*QuerySubscriptionMonthlyPayoutRequest)) +func (m *QueryStaticProvidersListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Providers) > 0 { + for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Providers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _Query_SdkPairing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPairingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SdkPairing(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.pairing.Query/SdkPairing", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SdkPairing(ctx, req.(*QueryGetPairingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lavanet.lava.pairing.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Providers", - Handler: _Query_Providers_Handler, - }, - { - MethodName: "GetPairing", - Handler: _Query_GetPairing_Handler, - }, - { - MethodName: "VerifyPairing", - Handler: _Query_VerifyPairing_Handler, - }, - { - MethodName: "UniquePaymentStorageClientProvider", - Handler: _Query_UniquePaymentStorageClientProvider_Handler, - }, - { - MethodName: "UniquePaymentStorageClientProviderAll", - Handler: _Query_UniquePaymentStorageClientProviderAll_Handler, - }, - { - MethodName: "ProviderPaymentStorage", - Handler: _Query_ProviderPaymentStorage_Handler, - }, - { - MethodName: "ProviderPaymentStorageAll", - Handler: _Query_ProviderPaymentStorageAll_Handler, - }, - { - MethodName: "EpochPayments", - Handler: _Query_EpochPayments_Handler, - }, - { - MethodName: "EpochPaymentsAll", - Handler: _Query_EpochPaymentsAll_Handler, - }, - { - MethodName: "UserEntry", - Handler: _Query_UserEntry_Handler, - }, - { - MethodName: "StaticProvidersList", - Handler: _Query_StaticProvidersList_Handler, - }, - { - MethodName: "EffectivePolicy", - Handler: _Query_EffectivePolicy_Handler, - }, - { - MethodName: "ProviderMonthlyPayout", - Handler: _Query_ProviderMonthlyPayout_Handler, - }, - { - MethodName: "SubscriptionMonthlyPayout", - Handler: _Query_SubscriptionMonthlyPayout_Handler, - }, - { - MethodName: "SdkPairing", - Handler: _Query_SdkPairing_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "lavanet/lava/pairing/query.proto", -} - -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func (m *QueryEffectivePolicyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } return dAtA[:n], nil } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryEffectivePolicyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryEffectivePolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.SpecID) > 0 { + i -= len(m.SpecID) + copy(dAtA[i:], m.SpecID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SpecID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Consumer) > 0 { + i -= len(m.Consumer) + copy(dAtA[i:], m.Consumer) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryEffectivePolicyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2637,30 +2458,44 @@ func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryEffectivePolicyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryEffectivePolicyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.PendingPolicy != nil { + { + size, err := m.PendingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Policy != nil { + { + size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryProvidersRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySdkPairingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2670,37 +2505,61 @@ func (m *QueryProvidersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryProvidersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySdkPairingResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryProvidersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySdkPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ShowFrozen { + if m.DowntimeParams != nil { + { + size, err := m.DowntimeParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- - if m.ShowFrozen { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x22 + } + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if m.MaxCu != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.MaxCu)) + i-- dAtA[i] = 0x10 } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + if m.Pairing != nil { + { + size, err := m.Pairing.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryProvidersResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryProviderMonthlyPayoutRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2710,34 +2569,27 @@ func (m *QueryProvidersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryProvidersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryProviderMonthlyPayoutRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryProvidersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryProviderMonthlyPayoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.StakeEntry) > 0 { - for iNdEx := len(m.StakeEntry) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StakeEntry[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetPairingRequest) Marshal() (dAtA []byte, err error) { +func (m *SubscriptionPayout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2747,34 +2599,39 @@ func (m *QueryGetPairingRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPairingRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *SubscriptionPayout) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPairingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SubscriptionPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Client) > 0 { - i -= len(m.Client) - copy(dAtA[i:], m.Client) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Client))) + if m.Amount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x18 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0x12 } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + if len(m.Subscription) > 0 { + i -= len(m.Subscription) + copy(dAtA[i:], m.Subscription) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subscription))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetPairingResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryProviderMonthlyPayoutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2784,54 +2641,39 @@ func (m *QueryGetPairingResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPairingResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryProviderMonthlyPayoutResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryProviderMonthlyPayoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.BlockOfNextPairing != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.BlockOfNextPairing)) - i-- - dAtA[i] = 0x28 + if len(m.Details) > 0 { + for iNdEx := len(m.Details) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Details[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - if m.SpecLastUpdatedBlock != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.SpecLastUpdatedBlock)) - i-- - dAtA[i] = 0x20 - } - if m.TimeLeftToNextPairing != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TimeLeftToNextPairing)) - i-- - dAtA[i] = 0x18 - } - if m.CurrentEpoch != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CurrentEpoch)) + if m.Total != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Total)) i-- - dAtA[i] = 0x10 - } - if len(m.Providers) > 0 { - for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Providers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *QueryVerifyPairingRequest) Marshal() (dAtA []byte, err error) { +func (m *ProviderPayout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2841,46 +2683,32 @@ func (m *QueryVerifyPairingRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVerifyPairingRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ProviderPayout) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVerifyPairingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProviderPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Block != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + if m.Amount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Amount)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x10 } if len(m.Provider) > 0 { i -= len(m.Provider) copy(dAtA[i:], m.Provider) i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) i-- - dAtA[i] = 0x1a - } - if len(m.Client) > 0 { - i -= len(m.Client) - copy(dAtA[i:], m.Client) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Client))) - i-- - dAtA[i] = 0x12 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryVerifyPairingResponse) Marshal() (dAtA []byte, err error) { +func (m *ChainIDPayout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2890,47 +2718,41 @@ func (m *QueryVerifyPairingResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVerifyPairingResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ChainIDPayout) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVerifyPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ChainIDPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ProjectId) > 0 { - i -= len(m.ProjectId) - copy(dAtA[i:], m.ProjectId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ProjectId))) - i-- - dAtA[i] = 0x2a - } - if m.CuPerEpoch != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CuPerEpoch)) - i-- - dAtA[i] = 0x20 - } - if m.PairedProviders != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PairedProviders)) - i-- - dAtA[i] = 0x18 - } - if m.Valid { - i-- - if m.Valid { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Payouts) > 0 { + for iNdEx := len(m.Payouts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payouts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySubscriptionMonthlyPayoutRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2940,27 +2762,27 @@ func (m *QueryGetUniquePaymentStorageClientProviderRequest) Marshal() (dAtA []by return dAtA[:n], nil } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySubscriptionMonthlyPayoutRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetUniquePaymentStorageClientProviderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySubscriptionMonthlyPayoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + if len(m.Consumer) > 0 { + i -= len(m.Consumer) + copy(dAtA[i:], m.Consumer) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) Marshal() (dAtA []byte, err error) { +func (m *QuerySubscriptionMonthlyPayoutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2970,30 +2792,39 @@ func (m *QueryGetUniquePaymentStorageClientProviderResponse) Marshal() (dAtA []b return dAtA[:n], nil } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySubscriptionMonthlyPayoutResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetUniquePaymentStorageClientProviderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySubscriptionMonthlyPayoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.UniquePaymentStorageClientProvider.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Details) > 0 { + for iNdEx := len(m.Details) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Details[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa + if m.Total != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryProvidersEpochCuRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3003,32 +2834,20 @@ func (m *QueryAllUniquePaymentStorageClientProviderRequest) Marshal() (dAtA []by return dAtA[:n], nil } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryProvidersEpochCuRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllUniquePaymentStorageClientProviderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryProvidersEpochCuRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryProvidersEpochCuResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3038,32 +2857,20 @@ func (m *QueryAllUniquePaymentStorageClientProviderResponse) Marshal() (dAtA []b return dAtA[:n], nil } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryProvidersEpochCuResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryProvidersEpochCuResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.UniquePaymentStorageClientProvider) > 0 { - for iNdEx := len(m.UniquePaymentStorageClientProvider) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.UniquePaymentStorageClientProvider[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3077,7 +2884,7 @@ func (m *QueryAllUniquePaymentStorageClientProviderResponse) MarshalToSizedBuffe return len(dAtA) - i, nil } -func (m *QueryGetProviderPaymentStorageRequest) Marshal() (dAtA []byte, err error) { +func (m *ProviderCuInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3087,2563 +2894,467 @@ func (m *QueryGetProviderPaymentStorageRequest) Marshal() (dAtA []byte, err erro return dAtA[:n], nil } -func (m *QueryGetProviderPaymentStorageRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ProviderCuInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetProviderPaymentStorageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProviderCuInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + if m.Cu != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Cu)) + i-- + dAtA[i] = 0x10 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetProviderPaymentStorageResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *QueryGetProviderPaymentStorageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *QueryGetProviderPaymentStorageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - { - size, err := m.ProviderPaymentStorage.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *QueryAllProviderPaymentStorageRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n } -func (m *QueryAllProviderPaymentStorageRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryProvidersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ShowFrozen { + n += 2 + } + return n } -func (m *QueryAllProviderPaymentStorageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryProvidersResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.StakeEntry) > 0 { + for _, e := range m.StakeEntry { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + return n } -func (m *QueryAllProviderPaymentStorageResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGetPairingRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAllProviderPaymentStorageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Client) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAllProviderPaymentStorageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryGetPairingResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Providers) > 0 { + for _, e := range m.Providers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0x12 } - if len(m.ProviderPaymentStorage) > 0 { - for iNdEx := len(m.ProviderPaymentStorage) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProviderPaymentStorage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if m.CurrentEpoch != 0 { + n += 1 + sovQuery(uint64(m.CurrentEpoch)) } - return len(dAtA) - i, nil -} - -func (m *QueryGetEpochPaymentsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.TimeLeftToNextPairing != 0 { + n += 1 + sovQuery(uint64(m.TimeLeftToNextPairing)) } - return dAtA[:n], nil -} - -func (m *QueryGetEpochPaymentsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if m.SpecLastUpdatedBlock != 0 { + n += 1 + sovQuery(uint64(m.SpecLastUpdatedBlock)) + } + if m.BlockOfNextPairing != 0 { + n += 1 + sovQuery(uint64(m.BlockOfNextPairing)) + } + return n } -func (m *QueryGetEpochPaymentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryVerifyPairingRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *QueryGetEpochPaymentsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.Client) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return dAtA[:n], nil + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n } -func (m *QueryGetEpochPaymentsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryVerifyPairingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Valid { + n += 2 + } + if m.PairedProviders != 0 { + n += 1 + sovQuery(uint64(m.PairedProviders)) + } + if m.CuPerEpoch != 0 { + n += 1 + sovQuery(uint64(m.CuPerEpoch)) + } + l = len(m.ProjectId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryGetEpochPaymentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryUserEntryRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - { - size, err := m.EpochPayments.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n } -func (m *QueryAllEpochPaymentsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryUserEntryResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = m.Consumer.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.MaxCU != 0 { + n += 1 + sovQuery(uint64(m.MaxCU)) + } + return n } -func (m *QueryAllEpochPaymentsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryStaticProvidersListRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAllEpochPaymentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryStaticProvidersListResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Providers) > 0 { + for _, e := range m.Providers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + return n } -func (m *QueryAllEpochPaymentsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryEffectivePolicyRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAllEpochPaymentsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllEpochPaymentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + l = len(m.Consumer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - if len(m.EpochPayments) > 0 { - for iNdEx := len(m.EpochPayments) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EpochPayments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + l = len(m.SpecID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryUserEntryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryEffectivePolicyResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryUserEntryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.Policy != nil { + l = m.Policy.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.PendingPolicy != nil { + l = m.PendingPolicy.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryUserEntryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QuerySdkPairingResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Block != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 + if m.Pairing != nil { + l = m.Pairing.Size() + n += 1 + l + sovQuery(uint64(l)) } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 + if m.MaxCu != 0 { + n += 1 + sovQuery(uint64(m.MaxCu)) } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa + if m.Spec != nil { + l = m.Spec.Size() + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + if m.DowntimeParams != nil { + l = m.DowntimeParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryUserEntryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryProviderMonthlyPayoutRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryUserEntryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SubscriptionPayout) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subscription) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovQuery(uint64(m.Amount)) + } + return n } -func (m *QueryUserEntryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryProviderMonthlyPayoutResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.MaxCU != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MaxCU)) - i-- - dAtA[i] = 0x10 + if m.Total != 0 { + n += 1 + sovQuery(uint64(m.Total)) } - { - size, err := m.Consumer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Details) > 0 { + for _, e := range m.Details { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *QueryStaticProvidersListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *ProviderPayout) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryStaticProvidersListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryStaticProvidersListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0xa + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *QueryStaticProvidersListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Amount != 0 { + n += 1 + sovQuery(uint64(m.Amount)) } - return dAtA[:n], nil -} - -func (m *QueryStaticProvidersListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *QueryStaticProvidersListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *ChainIDPayout) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Providers) > 0 { - for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Providers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Payouts) > 0 { + for _, e := range m.Payouts { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } } - return len(dAtA) - i, nil + return n } -func (m *QueryEffectivePolicyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QuerySubscriptionMonthlyPayoutRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryEffectivePolicyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEffectivePolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.SpecID) > 0 { - i -= len(m.SpecID) - copy(dAtA[i:], m.SpecID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SpecID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0xa + l = len(m.Consumer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryEffectivePolicyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QuerySubscriptionMonthlyPayoutResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryEffectivePolicyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEffectivePolicyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.PendingPolicy != nil { - { - size, err := m.PendingPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Policy != nil { - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySdkPairingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySdkPairingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySdkPairingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DowntimeParams != nil { - { - size, err := m.DowntimeParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.MaxCu != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MaxCu)) - i-- - dAtA[i] = 0x10 - } - if m.Pairing != nil { - { - size, err := m.Pairing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryProviderMonthlyPayoutRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryProviderMonthlyPayoutRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProviderMonthlyPayoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SubscriptionPayout) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscriptionPayout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscriptionPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Amount != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x18 - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryProviderMonthlyPayoutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryProviderMonthlyPayoutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProviderMonthlyPayoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Details) > 0 { - for iNdEx := len(m.Details) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Details[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } if m.Total != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ProviderPayout) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProviderPayout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProviderPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Amount != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x10 - } - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChainIDPayout) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChainIDPayout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainIDPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payouts) > 0 { - for iNdEx := len(m.Payouts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Payouts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubscriptionMonthlyPayoutRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySubscriptionMonthlyPayoutRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubscriptionMonthlyPayoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubscriptionMonthlyPayoutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySubscriptionMonthlyPayoutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubscriptionMonthlyPayoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Details) > 0 { - for iNdEx := len(m.Details) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Details[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Total != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryProvidersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.ShowFrozen { - n += 2 - } - return n -} - -func (m *QueryProvidersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.StakeEntry) > 0 { - for _, e := range m.StakeEntry { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryGetPairingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Client) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetPairingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Providers) > 0 { - for _, e := range m.Providers { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.CurrentEpoch != 0 { - n += 1 + sovQuery(uint64(m.CurrentEpoch)) - } - if m.TimeLeftToNextPairing != 0 { - n += 1 + sovQuery(uint64(m.TimeLeftToNextPairing)) - } - if m.SpecLastUpdatedBlock != 0 { - n += 1 + sovQuery(uint64(m.SpecLastUpdatedBlock)) - } - if m.BlockOfNextPairing != 0 { - n += 1 + sovQuery(uint64(m.BlockOfNextPairing)) - } - return n -} - -func (m *QueryVerifyPairingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Client) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovQuery(uint64(m.Block)) - } - return n -} - -func (m *QueryVerifyPairingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Valid { - n += 2 - } - if m.PairedProviders != 0 { - n += 1 + sovQuery(uint64(m.PairedProviders)) - } - if m.CuPerEpoch != 0 { - n += 1 + sovQuery(uint64(m.CuPerEpoch)) - } - l = len(m.ProjectId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetUniquePaymentStorageClientProviderRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetUniquePaymentStorageClientProviderResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.UniquePaymentStorageClientProvider.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllUniquePaymentStorageClientProviderRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllUniquePaymentStorageClientProviderResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.UniquePaymentStorageClientProvider) > 0 { - for _, e := range m.UniquePaymentStorageClientProvider { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetProviderPaymentStorageRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetProviderPaymentStorageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ProviderPaymentStorage.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllProviderPaymentStorageRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllProviderPaymentStorageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ProviderPaymentStorage) > 0 { - for _, e := range m.ProviderPaymentStorage { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetEpochPaymentsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetEpochPaymentsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.EpochPayments.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllEpochPaymentsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllEpochPaymentsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.EpochPayments) > 0 { - for _, e := range m.EpochPayments { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryUserEntryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovQuery(uint64(m.Block)) - } - return n -} - -func (m *QueryUserEntryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Consumer.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.MaxCU != 0 { - n += 1 + sovQuery(uint64(m.MaxCU)) - } - return n -} - -func (m *QueryStaticProvidersListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryStaticProvidersListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Providers) > 0 { - for _, e := range m.Providers { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryEffectivePolicyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SpecID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryEffectivePolicyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Policy != nil { - l = m.Policy.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.PendingPolicy != nil { - l = m.PendingPolicy.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySdkPairingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pairing != nil { - l = m.Pairing.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.MaxCu != 0 { - n += 1 + sovQuery(uint64(m.MaxCu)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.DowntimeParams != nil { - l = m.DowntimeParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProviderMonthlyPayoutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *SubscriptionPayout) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Amount != 0 { - n += 1 + sovQuery(uint64(m.Amount)) - } - return n -} - -func (m *QueryProviderMonthlyPayoutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovQuery(uint64(m.Total)) - } - if len(m.Details) > 0 { - for _, e := range m.Details { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *ProviderPayout) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Amount != 0 { - n += 1 + sovQuery(uint64(m.Amount)) - } - return n -} - -func (m *ChainIDPayout) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Payouts) > 0 { - for _, e := range m.Payouts { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QuerySubscriptionMonthlyPayoutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySubscriptionMonthlyPayoutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovQuery(uint64(m.Total)) - } - if len(m.Details) > 0 { - for _, e := range m.Details { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProvidersRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryProvidersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProvidersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShowFrozen", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ShowFrozen = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProvidersResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryProvidersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProvidersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeEntry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakeEntry = append(m.StakeEntry, types.StakeEntry{}) - if err := m.StakeEntry[len(m.StakeEntry)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPairingRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetPairingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPairingRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Client = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPairingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetPairingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPairingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Providers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Providers = append(m.Providers, types.StakeEntry{}) - if err := m.Providers[len(m.Providers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) - } - m.CurrentEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentEpoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeLeftToNextPairing", wireType) - } - m.TimeLeftToNextPairing = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeLeftToNextPairing |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SpecLastUpdatedBlock", wireType) - } - m.SpecLastUpdatedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SpecLastUpdatedBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockOfNextPairing", wireType) - } - m.BlockOfNextPairing = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockOfNextPairing |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVerifyPairingRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryVerifyPairingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVerifyPairingRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Client = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVerifyPairingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryVerifyPairingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVerifyPairingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Valid = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PairedProviders", wireType) - } - m.PairedProviders = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PairedProviders |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CuPerEpoch", wireType) - } - m.CuPerEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CuPerEpoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetUniquePaymentStorageClientProviderRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetUniquePaymentStorageClientProviderRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetUniquePaymentStorageClientProviderRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetUniquePaymentStorageClientProviderResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetUniquePaymentStorageClientProviderResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetUniquePaymentStorageClientProviderResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UniquePaymentStorageClientProvider", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.UniquePaymentStorageClientProvider.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllUniquePaymentStorageClientProviderRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllUniquePaymentStorageClientProviderRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUniquePaymentStorageClientProviderRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + n += 1 + sovQuery(uint64(m.Total)) + } + if len(m.Details) > 0 { + for _, e := range m.Details { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *QueryProvidersEpochCuRequest) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n +} + +func (m *QueryProvidersEpochCuResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *ProviderCuInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Cu != 0 { + n += 1 + sovQuery(uint64(m.Cu)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryAllUniquePaymentStorageClientProviderResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5666,82 +3377,12 @@ func (m *QueryAllUniquePaymentStorageClientProviderResponse) Unmarshal(dAtA []by fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllUniquePaymentStorageClientProviderResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUniquePaymentStorageClientProviderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UniquePaymentStorageClientProvider", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UniquePaymentStorageClientProvider = append(m.UniquePaymentStorageClientProvider, UniquePaymentStorageClientProvider{}) - if err := m.UniquePaymentStorageClientProvider[len(m.UniquePaymentStorageClientProvider)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5763,7 +3404,7 @@ func (m *QueryAllUniquePaymentStorageClientProviderResponse) Unmarshal(dAtA []by } return nil } -func (m *QueryGetProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5786,17 +3427,17 @@ func (m *QueryGetProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetProviderPaymentStorageRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetProviderPaymentStorageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5806,23 +3447,24 @@ func (m *QueryGetProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Index = string(dAtA[iNdEx:postIndex]) + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -5845,7 +3487,7 @@ func (m *QueryGetProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { +func (m *QueryProvidersRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5868,17 +3510,17 @@ func (m *QueryGetProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetProviderPaymentStorageResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryProvidersRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetProviderPaymentStorageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryProvidersRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderPaymentStorage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5888,80 +3530,29 @@ func (m *QueryGetProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ProviderPaymentStorage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChainID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllProviderPaymentStorageRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllProviderPaymentStorageRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShowFrozen", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5971,28 +3562,12 @@ func (m *QueryAllProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.ShowFrozen = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6014,7 +3589,7 @@ func (m *QueryAllProviderPaymentStorageRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { +func (m *QueryProvidersResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6037,49 +3612,15 @@ func (m *QueryAllProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllProviderPaymentStorageResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryProvidersResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllProviderPaymentStorageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryProvidersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderPaymentStorage", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderPaymentStorage = append(m.ProviderPaymentStorage, ProviderPaymentStorage{}) - if err := m.ProviderPaymentStorage[len(m.ProviderPaymentStorage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEntry", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6106,10 +3647,8 @@ func (m *QueryAllProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.StakeEntry = append(m.StakeEntry, types.StakeEntry{}) + if err := m.StakeEntry[len(m.StakeEntry)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6134,7 +3673,7 @@ func (m *QueryAllProviderPaymentStorageResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetEpochPaymentsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetPairingRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6157,15 +3696,47 @@ func (m *QueryGetEpochPaymentsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetEpochPaymentsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPairingRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetEpochPaymentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPairingRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6193,7 +3764,7 @@ func (m *QueryGetEpochPaymentsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Index = string(dAtA[iNdEx:postIndex]) + m.Client = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6216,7 +3787,7 @@ func (m *QueryGetEpochPaymentsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetEpochPaymentsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetPairingResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6239,15 +3810,15 @@ func (m *QueryGetEpochPaymentsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetEpochPaymentsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPairingResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetEpochPaymentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPairingResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochPayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Providers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6274,10 +3845,87 @@ func (m *QueryGetEpochPaymentsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EpochPayments.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Providers = append(m.Providers, types.StakeEntry{}) + if err := m.Providers[len(m.Providers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeLeftToNextPairing", wireType) + } + m.TimeLeftToNextPairing = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeLeftToNextPairing |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpecLastUpdatedBlock", wireType) + } + m.SpecLastUpdatedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpecLastUpdatedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockOfNextPairing", wireType) + } + m.BlockOfNextPairing = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockOfNextPairing |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6299,7 +3947,7 @@ func (m *QueryGetEpochPaymentsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllEpochPaymentsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryVerifyPairingRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6322,17 +3970,17 @@ func (m *QueryAllEpochPaymentsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllEpochPaymentsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryVerifyPairingRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllEpochPaymentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryVerifyPairingRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6342,28 +3990,107 @@ func (m *QueryAllEpochPaymentsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Client = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6385,7 +4112,7 @@ func (m *QueryAllEpochPaymentsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllEpochPaymentsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryVerifyPairingResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6408,17 +4135,56 @@ func (m *QueryAllEpochPaymentsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllEpochPaymentsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryVerifyPairingResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllEpochPaymentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryVerifyPairingResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochPayments", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PairedProviders", wireType) + } + m.PairedProviders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PairedProviders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CuPerEpoch", wireType) } - var msglen int + m.CuPerEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6428,31 +4194,16 @@ func (m *QueryAllEpochPaymentsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.CuPerEpoch |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochPayments = append(m.EpochPayments, EpochPayments{}) - if err := m.EpochPayments[len(m.EpochPayments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProjectId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6462,27 +4213,23 @@ func (m *QueryAllEpochPaymentsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ProjectId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8039,6 +5786,241 @@ func (m *QuerySubscriptionMonthlyPayoutResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProvidersEpochCuRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProvidersEpochCuRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProvidersEpochCuRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProvidersEpochCuResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProvidersEpochCuResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProvidersEpochCuResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = append(m.Info, ProviderCuInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProviderCuInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProviderCuInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderCuInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cu", wireType) + } + m.Cu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Cu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/pairing/types/query.pb.gw.go b/x/pairing/types/query.pb.gw.go index 303045306c..322ea6338e 100644 --- a/x/pairing/types/query.pb.gw.go +++ b/x/pairing/types/query.pb.gw.go @@ -319,276 +319,6 @@ func local_request_Query_VerifyPairing_0(ctx context.Context, marshaler runtime. } -func request_Query_UniquePaymentStorageClientProvider_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetUniquePaymentStorageClientProviderRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.UniquePaymentStorageClientProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_UniquePaymentStorageClientProvider_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetUniquePaymentStorageClientProviderRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.UniquePaymentStorageClientProvider(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_UniquePaymentStorageClientProviderAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_UniquePaymentStorageClientProviderAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllUniquePaymentStorageClientProviderRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UniquePaymentStorageClientProviderAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UniquePaymentStorageClientProviderAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_UniquePaymentStorageClientProviderAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllUniquePaymentStorageClientProviderRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UniquePaymentStorageClientProviderAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UniquePaymentStorageClientProviderAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ProviderPaymentStorage_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProviderPaymentStorageRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.ProviderPaymentStorage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ProviderPaymentStorage_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProviderPaymentStorageRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.ProviderPaymentStorage(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ProviderPaymentStorageAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_ProviderPaymentStorageAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllProviderPaymentStorageRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ProviderPaymentStorageAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProviderPaymentStorageAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ProviderPaymentStorageAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllProviderPaymentStorageRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ProviderPaymentStorageAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProviderPaymentStorageAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_EpochPayments_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetEpochPaymentsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.EpochPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EpochPayments_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetEpochPaymentsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.EpochPayments(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_EpochPaymentsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_EpochPaymentsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllEpochPaymentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EpochPaymentsAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.EpochPaymentsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EpochPaymentsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllEpochPaymentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EpochPaymentsAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.EpochPaymentsAll(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_UserEntry_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "chainID": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) @@ -957,6 +687,24 @@ func local_request_Query_SdkPairing_0(ctx context.Context, marshaler runtime.Mar } +func request_Query_ProvidersEpochCu_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProvidersEpochCuRequest + var metadata runtime.ServerMetadata + + msg, err := client.ProvidersEpochCu(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ProvidersEpochCu_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProvidersEpochCuRequest + var metadata runtime.ServerMetadata + + msg, err := server.ProvidersEpochCu(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1055,122 +803,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_UniquePaymentStorageClientProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_UniquePaymentStorageClientProvider_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UniquePaymentStorageClientProvider_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_UniquePaymentStorageClientProviderAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_UniquePaymentStorageClientProviderAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UniquePaymentStorageClientProviderAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ProviderPaymentStorage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ProviderPaymentStorage_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ProviderPaymentStorage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ProviderPaymentStorageAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ProviderPaymentStorageAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ProviderPaymentStorageAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EpochPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_EpochPayments_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_EpochPayments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EpochPaymentsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_UserEntry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1181,7 +814,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_EpochPaymentsAll_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_UserEntry_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1189,11 +822,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_EpochPaymentsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_UserEntry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_UserEntry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_StaticProvidersList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1204,7 +837,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_UserEntry_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_StaticProvidersList_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1212,11 +845,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_UserEntry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_StaticProvidersList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_StaticProvidersList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_EffectivePolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1227,7 +860,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_StaticProvidersList_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_EffectivePolicy_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1235,11 +868,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_StaticProvidersList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_EffectivePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_EffectivePolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ProviderMonthlyPayout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1250,7 +883,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_EffectivePolicy_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ProviderMonthlyPayout_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1258,11 +891,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_EffectivePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ProviderMonthlyPayout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ProviderMonthlyPayout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_SubscriptionMonthlyPayout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1273,7 +906,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ProviderMonthlyPayout_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_SubscriptionMonthlyPayout_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1281,11 +914,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ProviderMonthlyPayout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SubscriptionMonthlyPayout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_SubscriptionMonthlyPayout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_SdkPairing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1296,7 +929,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_SubscriptionMonthlyPayout_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_SdkPairing_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1304,11 +937,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_SubscriptionMonthlyPayout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SdkPairing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_SdkPairing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ProvidersEpochCu_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1319,7 +952,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_SdkPairing_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ProvidersEpochCu_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1327,7 +960,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_SdkPairing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ProvidersEpochCu_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1452,126 +1085,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_UniquePaymentStorageClientProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_UniquePaymentStorageClientProvider_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UniquePaymentStorageClientProvider_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_UniquePaymentStorageClientProviderAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_UniquePaymentStorageClientProviderAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UniquePaymentStorageClientProviderAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ProviderPaymentStorage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ProviderPaymentStorage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ProviderPaymentStorage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ProviderPaymentStorageAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ProviderPaymentStorageAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ProviderPaymentStorageAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EpochPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_EpochPayments_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_EpochPayments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EpochPaymentsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_EpochPaymentsAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_EpochPaymentsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_UserEntry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1692,6 +1205,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ProvidersEpochCu_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ProvidersEpochCu_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProvidersEpochCu_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1704,18 +1237,6 @@ var ( pattern_Query_VerifyPairing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"lavanet", "lava", "pairing", "verify_pairing", "chainID", "client", "provider", "block"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UniquePaymentStorageClientProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "pairing", "unique_payment_storage_client_provider", "index"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_UniquePaymentStorageClientProviderAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "pairing", "unique_payment_storage_client_provider"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ProviderPaymentStorage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "pairing", "provider_payment_storage", "index"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ProviderPaymentStorageAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "pairing", "provider_payment_storage"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_EpochPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "pairing", "epoch_payments", "index"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_EpochPaymentsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "pairing", "epoch_payments"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserEntry_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lavanet", "lava", "pairing", "user_entry", "address", "chainID"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_StaticProvidersList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "pairing", "static_providers_list", "chainID"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1727,6 +1248,8 @@ var ( pattern_Query_SubscriptionMonthlyPayout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "pairing", "subscription_monthly_payout", "consumer"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SdkPairing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "pairing", "sdk_pairing"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ProvidersEpochCu_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "pairing", "providers_epoch_cu"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1738,18 +1261,6 @@ var ( forward_Query_VerifyPairing_0 = runtime.ForwardResponseMessage - forward_Query_UniquePaymentStorageClientProvider_0 = runtime.ForwardResponseMessage - - forward_Query_UniquePaymentStorageClientProviderAll_0 = runtime.ForwardResponseMessage - - forward_Query_ProviderPaymentStorage_0 = runtime.ForwardResponseMessage - - forward_Query_ProviderPaymentStorageAll_0 = runtime.ForwardResponseMessage - - forward_Query_EpochPayments_0 = runtime.ForwardResponseMessage - - forward_Query_EpochPaymentsAll_0 = runtime.ForwardResponseMessage - forward_Query_UserEntry_0 = runtime.ForwardResponseMessage forward_Query_StaticProvidersList_0 = runtime.ForwardResponseMessage @@ -1761,4 +1272,6 @@ var ( forward_Query_SubscriptionMonthlyPayout_0 = runtime.ForwardResponseMessage forward_Query_SdkPairing_0 = runtime.ForwardResponseMessage + + forward_Query_ProvidersEpochCu_0 = runtime.ForwardResponseMessage ) diff --git a/x/subscription/keeper/subscription_test.go b/x/subscription/keeper/subscription_test.go index 111d77ef0a..336dd60c45 100644 --- a/x/subscription/keeper/subscription_test.go +++ b/x/subscription/keeper/subscription_test.go @@ -670,6 +670,7 @@ func TestAddDelProjectForSubscription(t *testing.T) { } func TestDelProjectEndSubscription(t *testing.T) { + keepertest.SetFixedTime() ts := newTester(t) ts.SetupAccounts(1, 0, 0) // 1 sub, 0 adm, 0 dev @@ -1173,6 +1174,7 @@ func TestSubAutoRenewalDifferentPlanIndexOnAutoRenewTx(t *testing.T) { // scenario - buy 3 subs: 2 at the same time, and one a little after. The query should return the two subs // then, expire those and expect to get the last one from the query func TestNextToMonthExpiryQuery(t *testing.T) { + keepertest.SetFixedTime() ts := newTester(t) ts.SetupAccounts(3, 0, 0) // 1 sub, 0 adm, 0 dev months := 1 @@ -2317,6 +2319,7 @@ func TestBuySubscriptionImmediatelyAfterExpiration(t *testing.T) { // since policy changes are applied after an epoch, the policy changes "after" the sub is expired // the expected result should be no unexpected errors and the project change should not exist func TestChangeProjectJustBeforeSubExpiry(t *testing.T) { + keepertest.SetFixedTime() ts := newTester(t) ts.SetupAccounts(1, 0, 0) // 1 sub, 0 adm, 0 dev _, consumerAddr := ts.Account("sub1")