From 3a7315cf184c77fe81257954260f632600ca8061 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 11 Sep 2024 10:57:42 +0200 Subject: [PATCH 01/77] test: make stake_supplier.feature idempotent --- e2e/tests/stake_supplier.feature | 3 +++ 1 file changed, 3 insertions(+) diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index 8a9aff15d..0cb143140 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -34,3 +34,6 @@ Feature: Stake Supplier Namespace But the session for application "app1" and service "anvil" does not contain "supplier2" When the user waits for supplier "supplier2" to become active for service "anvil" Then the session for application "app1" and service "anvil" contains the supplier "supplier2" + # Cleanup to make this feature idempotent. + And the user unstakes a "supplier" from the account "supplier2" + And the user waits for the supplier for account "supplier2" unbonding period to finish From 97068770ce22e2383a7179307fe1af765e98bac8 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 11 Sep 2024 10:57:52 +0200 Subject: [PATCH 02/77] test: speed up stake_supplier.feature --- e2e/tests/stake_supplier.feature | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index 0cb143140..8fbb97ac2 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -14,6 +14,21 @@ Feature: Stake Supplier Namespace Scenario: User can unstake a Supplier Given the user has the pocketd binary installed + # Reduce the application unbonding period to avoid timeouts and speed up scenarios. + And an authz grant from the "gov" "module" account to the "pnf" "user" account for each module MsgUpdateParam message exists + # NB: If new parameters are added to the shared module, they + # MUST be included here; otherwise, this step will fail. + And the "pnf" account sends an authz exec message to update all "shared" module params + | name | value | type | + | num_blocks_per_session | 2 | int64 | + | grace_period_end_offset_blocks | 0 | int64 | + | claim_window_open_offset_blocks | 0 | int64 | + | claim_window_close_offset_blocks | 1 | int64 | + | proof_window_open_offset_blocks | 0 | int64 | + | proof_window_close_offset_blocks | 1 | int64 | + | supplier_unbonding_period_sessions | 1 | int64 | + | application_unbonding_period_sessions | 1 | int64 | + And all "shared" module params should be updated And the "supplier" for account "supplier2" is staked with "1000070" uPOKT And an account exists for "supplier2" When the user unstakes a "supplier" from the account "supplier2" @@ -27,6 +42,21 @@ Feature: Stake Supplier Namespace Scenario: User can restake a Supplier waiting for it to become active again Given the user has the pocketd binary installed + # Reduce the application unbonding period to avoid timeouts and speed up scenarios. + And an authz grant from the "gov" "module" account to the "pnf" "user" account for each module MsgUpdateParam message exists + # NB: If new parameters are added to the shared module, they + # MUST be included here; otherwise, this step will fail. + And the "pnf" account sends an authz exec message to update all "shared" module params + | name | value | type | + | num_blocks_per_session | 2 | int64 | + | grace_period_end_offset_blocks | 0 | int64 | + | claim_window_open_offset_blocks | 0 | int64 | + | claim_window_close_offset_blocks | 1 | int64 | + | proof_window_open_offset_blocks | 0 | int64 | + | proof_window_close_offset_blocks | 1 | int64 | + | supplier_unbonding_period_sessions | 1 | int64 | + | application_unbonding_period_sessions | 1 | int64 | + And all "shared" module params should be updated And the user verifies the "supplier" for account "supplier2" is not staked Then the user stakes a "supplier" with "1000070" uPOKT for "anvil" service from the account "supplier2" And the user should wait for the "supplier" module "StakeSupplier" message to be submitted From f2ec505cd10c4258107780c52dd78e50ff251eca Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 11 Sep 2024 11:00:14 +0200 Subject: [PATCH 03/77] chore: simplification --- e2e/tests/init_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/tests/init_test.go b/e2e/tests/init_test.go index afc4a72ba..8aee69e2e 100644 --- a/e2e/tests/init_test.go +++ b/e2e/tests/init_test.go @@ -38,7 +38,7 @@ import ( prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" - shared "github.com/pokt-network/poktroll/x/shared" + "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -740,8 +740,8 @@ func (s *suite) getSupplierUnbondingHeight(accName string) int64 { var resp sharedtypes.QueryParamsResponse responseBz := []byte(strings.TrimSpace(res.Stdout)) s.cdc.MustUnmarshalJSON(responseBz, &resp) - unbondingHeight := shared.GetSupplierUnbondingHeight(&resp.Params, supplier) - return unbondingHeight + + return shared.GetSupplierUnbondingHeight(&resp.Params, supplier) } // getApplicationInfo returns the application information for a given application address. From e5672c14dadd3b47f3bd6c1105b79964912571d0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 11 Sep 2024 11:00:25 +0200 Subject: [PATCH 04/77] chore: fix typos --- e2e/tests/stake_supplier.feature | 2 +- x/shared/supplier.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index 8fbb97ac2..94f45a731 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -1,6 +1,6 @@ Feature: Stake Supplier Namespace - Scenario: User can stake and unstake a Supplier waiting for it to unbound + Scenario: User can stake a Supplier Given the user has the pocketd binary installed And the user verifies the "supplier" for account "supplier2" is not staked And the account "supplier2" has a balance greater than "1000070" uPOKT diff --git a/x/shared/supplier.go b/x/shared/supplier.go index fc92d872f..f81b7aaff 100644 --- a/x/shared/supplier.go +++ b/x/shared/supplier.go @@ -10,7 +10,7 @@ func GetSupplierUnbondingHeight( sharedParams *sharedtypes.Params, supplier *sharedtypes.Supplier, ) int64 { - supplierUnbondingPeriodSessions := sharedParams.SupplierUnbondingPeriodSessions * sharedParams.NumBlocksPerSession + supplierUnbondingPeriodBlocks := sharedParams.SupplierUnbondingPeriodSessions * sharedParams.NumBlocksPerSession - return int64(supplier.UnstakeSessionEndHeight + supplierUnbondingPeriodSessions) + return int64(supplier.UnstakeSessionEndHeight + supplierUnbondingPeriodBlocks) } From 597f75f1e5842789c6bd1107c210dc5689fa1a01 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:45:53 +0200 Subject: [PATCH 05/77] refactor: supplier feature steps --- e2e/tests/stake_supplier.feature | 30 +------- e2e/tests/stake_supplier_steps_test.go | 98 ++++++++++++++++++++++++++ e2e/tests/update_params_test.go | 26 ++++--- 3 files changed, 117 insertions(+), 37 deletions(-) create mode 100644 e2e/tests/stake_supplier_steps_test.go diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index 94f45a731..f3062ea8c 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -15,20 +15,7 @@ Feature: Stake Supplier Namespace Scenario: User can unstake a Supplier Given the user has the pocketd binary installed # Reduce the application unbonding period to avoid timeouts and speed up scenarios. - And an authz grant from the "gov" "module" account to the "pnf" "user" account for each module MsgUpdateParam message exists - # NB: If new parameters are added to the shared module, they - # MUST be included here; otherwise, this step will fail. - And the "pnf" account sends an authz exec message to update all "shared" module params - | name | value | type | - | num_blocks_per_session | 2 | int64 | - | grace_period_end_offset_blocks | 0 | int64 | - | claim_window_open_offset_blocks | 0 | int64 | - | claim_window_close_offset_blocks | 1 | int64 | - | proof_window_open_offset_blocks | 0 | int64 | - | proof_window_close_offset_blocks | 1 | int64 | - | supplier_unbonding_period_sessions | 1 | int64 | - | application_unbonding_period_sessions | 1 | int64 | - And all "shared" module params should be updated + And the "supplier" unbonding period param is successfully set to "1" sessions of "2" blocks And the "supplier" for account "supplier2" is staked with "1000070" uPOKT And an account exists for "supplier2" When the user unstakes a "supplier" from the account "supplier2" @@ -43,20 +30,7 @@ Feature: Stake Supplier Namespace Scenario: User can restake a Supplier waiting for it to become active again Given the user has the pocketd binary installed # Reduce the application unbonding period to avoid timeouts and speed up scenarios. - And an authz grant from the "gov" "module" account to the "pnf" "user" account for each module MsgUpdateParam message exists - # NB: If new parameters are added to the shared module, they - # MUST be included here; otherwise, this step will fail. - And the "pnf" account sends an authz exec message to update all "shared" module params - | name | value | type | - | num_blocks_per_session | 2 | int64 | - | grace_period_end_offset_blocks | 0 | int64 | - | claim_window_open_offset_blocks | 0 | int64 | - | claim_window_close_offset_blocks | 1 | int64 | - | proof_window_open_offset_blocks | 0 | int64 | - | proof_window_close_offset_blocks | 1 | int64 | - | supplier_unbonding_period_sessions | 1 | int64 | - | application_unbonding_period_sessions | 1 | int64 | - And all "shared" module params should be updated + And the "supplier" unbonding period param is successfully set to "1" sessions of "2" blocks And the user verifies the "supplier" for account "supplier2" is not staked Then the user stakes a "supplier" with "1000070" uPOKT for "anvil" service from the account "supplier2" And the user should wait for the "supplier" module "StakeSupplier" message to be submitted diff --git a/e2e/tests/stake_supplier_steps_test.go b/e2e/tests/stake_supplier_steps_test.go new file mode 100644 index 000000000..15197a25e --- /dev/null +++ b/e2e/tests/stake_supplier_steps_test.go @@ -0,0 +1,98 @@ +//go:build e2e + +package e2e + +import ( + "reflect" + "strings" + "unicode" + + "github.com/stretchr/testify/require" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +func (s *suite) TheUnbondingPeriodParamIsSuccessfullySetToSessionsOfBlocks( + _ string, + supplierUnbondingPeriodSessions, + numBlocksPerSession int64, +) { + require.GreaterOrEqualf(s, numBlocksPerSession, 2, + "num_blocks_per_session MUST be at least 2 to satisfy parameter validation requirements") + + paramModuleName := "shared" + granter := "gov" + grantee := "pnf" + + // Ensure an authz grant is present such that this step may update parameters. + s.AnAuthzGrantFromTheAccountToTheAccountForEachModuleMsgupdateparamMessageExists( + granter, "module", + grantee, "user", + ) + + // NB: If new parameters are added to the shared module, they + // MUST be included here; otherwise, this step will fail. + sharedParams := sharedtypes.Params{ + NumBlocksPerSession: uint64(numBlocksPerSession), + GracePeriodEndOffsetBlocks: 0, + ClaimWindowOpenOffsetBlocks: 0, + ClaimWindowCloseOffsetBlocks: 1, + ProofWindowOpenOffsetBlocks: 0, + ProofWindowCloseOffsetBlocks: 1, + SupplierUnbondingPeriodSessions: uint64(supplierUnbondingPeriodSessions), + ApplicationUnbondingPeriodSessions: 1, + } + + // Convert params struct to the map type expected by + // s.sendAuthzExecToUpdateAllModuleParams(). + paramsMap := paramsAnyMapFromParamsStruct(sharedParams) + s.sendAuthzExecToUpdateAllModuleParams(grantee, paramModuleName, paramsMap) + + // Assert that the parameter values were updated. + s.AllModuleParamsShouldBeUpdated(paramModuleName) +} + +// paramsAnyMapFromParamStruct construct a paramsAnyMap from any +// protobuf Param message type (tx.proto) using reflection. +func paramsAnyMapFromParamsStruct(paramStruct any) paramsAnyMap { + paramsMap := make(paramsAnyMap) + paramsReflectValue := reflect.ValueOf(paramStruct) + for i := 0; i < paramsReflectValue.NumField(); i++ { + fieldValue := paramsReflectValue.Field(i) + fieldStruct := paramsReflectValue.Type().Field(i) + paramName := toSnakeCase(fieldStruct.Name) + + fieldTypeName := fieldStruct.Type.Name() + if fieldTypeName == "uint64" { + fieldTypeName = "int64" + fieldValue = reflect.ValueOf(int64(fieldValue.Interface().(uint64))) + } + + paramsMap[paramName] = paramAny{ + name: paramName, + typeStr: fieldTypeName, + value: fieldValue.Interface(), + } + } + return paramsMap +} + +func toSnakeCase(str string) string { + var result strings.Builder + + for i, runeValue := range str { + if unicode.IsUpper(runeValue) { + // If it's not the first letter, add an underscore + if i > 0 { + result.WriteRune('_') + } + // Convert to lowercase + result.WriteRune(unicode.ToLower(runeValue)) + } else { + // Otherwise, just append the rune as-is + result.WriteRune(runeValue) + } + } + + return result.String() +} diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index c13b1dfc6..74d98168c 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -217,16 +217,9 @@ func (s *suite) AllModuleParamsShouldBeSetToTheirDefaultValues(moduleName string // TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams sends an authz exec // message to update all module params for the given module. func (s *suite) TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams(accountName, moduleName string, table gocuke.DataTable) { - // NB: set s#moduleParamsMap for later assertion. - s.expectedModuleParams = moduleParamsMap{ - moduleName: s.parseParamsTable(table), - } - - // Use the map of params to populate a tx JSON template & write it to a file. - txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) + paramsTableMap := s.parseParamsTable(table) - // Send the authz exec tx to update all module params. - s.sendAuthzExecTx(accountName, txJSONFile.Name()) + s.sendAuthzExecToUpdateAllModuleParams(accountName, moduleName, paramsTableMap) } // AllModuleParamsShouldBeUpdated asserts that all module params have been updated as expected. @@ -479,6 +472,21 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { } } +// sendAuthzExecToUpdateAllModuleParams constructs and sends an authz exec +// tx to update all params for moduleName the given params. +func (s *suite) sendAuthzExecToUpdateAllModuleParams(accountName, moduleName string, params paramsAnyMap) { + // NB: set s#moduleParamsMap for later assertion. + s.expectedModuleParams = moduleParamsMap{ + moduleName: params, + } + + // Use the map of params to populate a tx JSON template & write it to a file. + txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) + + // Send the authz exec tx to update all module params. + s.sendAuthzExecTx(accountName, txJSONFile.Name()) +} + // assertUpdatedParams deserializes the param query response JSON into a // MsgUpdateParams of type P & asserts that it matches the expected params. func assertUpdatedParams[P cosmostypes.Msg]( From f90c752a8fb62c0c8452adbe91521c196f42d679 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:47:43 +0200 Subject: [PATCH 06/77] refactor: rename paramsAnyMap type --- e2e/tests/params_tx_test.go | 4 ++-- e2e/tests/params_types_test.go | 6 +++--- e2e/tests/parse_params_test.go | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/e2e/tests/params_tx_test.go b/e2e/tests/params_tx_test.go index 87e4e2463..926f856e2 100644 --- a/e2e/tests/params_tx_test.go +++ b/e2e/tests/params_tx_test.go @@ -51,7 +51,7 @@ func (s *suite) sendAuthzExecTx(signingKeyName, txJSONFilePath string) { } // newTempUpdateParamsTxJSONFile creates & returns a new temp file with the JSON representation of a tx -// which contains a MsgUpdateParams to update **all module params** for each module & paramsMap +// which contains a MsgUpdateParams to update **all module params** for each module & paramsAnyMap // in the given moduleParamsMap. The returned file is intended for use with the `authz exec` CLI // subcommand: `poktrolld tx authz exec `. func (s *suite) newTempUpdateParamsTxJSONFile(moduleParams moduleParamsMap) *os.File { @@ -76,7 +76,7 @@ func (s *suite) newTempUpdateParamsTxJSONFile(moduleParams moduleParamsMap) *os. } // newTempUpdateParamTxJSONFile creates & returns a new temp file with the JSON representation of a tx -// which contains a MsgUpdateParam to update params **individually** for each module & paramsMap in the +// which contains a MsgUpdateParam to update params **individually** for each module & paramsAnyMap in the // given moduleParamsMap. The returned file is intended for use with the `authz exec` CLI subcommand: // `poktrolld tx authz exec `. func (s *suite) newTempUpdateParamTxJSONFile(moduleParams moduleParamsMap) *os.File { diff --git a/e2e/tests/params_types_test.go b/e2e/tests/params_types_test.go index facd7abca..8da752793 100644 --- a/e2e/tests/params_types_test.go +++ b/e2e/tests/params_types_test.go @@ -9,11 +9,11 @@ type ( paramNameKey = string ) -// paramsMap is a map of param names to param values. -type paramsMap map[paramNameKey]paramAny +// paramsAnyMap is a map of param names to param values. +type paramsAnyMap map[paramNameKey]paramAny // moduleParamsMap is a map of module names to params maps. -type moduleParamsMap map[moduleNameKey]paramsMap +type moduleParamsMap map[moduleNameKey]paramsAnyMap // paramAny is a struct that holds a param type and a param value. type paramAny struct { diff --git a/e2e/tests/parse_params_test.go b/e2e/tests/parse_params_test.go index e33e1e423..b729f91ff 100644 --- a/e2e/tests/parse_params_test.go +++ b/e2e/tests/parse_params_test.go @@ -28,19 +28,19 @@ const ( paramTypeColIdx ) -// parseParamsTable parses a gocuke.DataTable into a paramsMap. -func (s *suite) parseParamsTable(table gocuke.DataTable) paramsMap { +// parseParamsTable parses a gocuke.DataTable into a paramsAnyMap. +func (s *suite) parseParamsTable(table gocuke.DataTable) paramsAnyMap { s.Helper() - paramsMap := make(paramsMap) + params := make(paramsAnyMap) // NB: skip the header row. for rowIdx := 1; rowIdx < table.NumRows(); rowIdx++ { param := s.parseParam(table, rowIdx) - paramsMap[param.name] = param + params[param.name] = param } - return paramsMap + return params } // parseParam parses a row of a gocuke.DataTable into a paramName and a paramAny. @@ -78,9 +78,9 @@ func (s *suite) parseParam(table gocuke.DataTable, rowIdx int) paramAny { } } -// paramsMapToMsgUpdateParams converts a paramsMap into a MsgUpdateParams, which +// paramsMapToMsgUpdateParams converts a paramsAnyMap into a MsgUpdateParams, which // it returns as a proto.Message/cosmostypes.Msg interface type. -func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsMap) (msgUpdateParams cosmostypes.Msg) { +func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsAnyMap) (msgUpdateParams cosmostypes.Msg) { s.Helper() switch moduleName { @@ -104,7 +104,7 @@ func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsMa return msgUpdateParams } -func (s *suite) newTokenomicsMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newTokenomicsMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &tokenomicstypes.MsgUpdateParams{ @@ -123,7 +123,7 @@ func (s *suite) newTokenomicsMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newProofMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newProofMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &prooftypes.MsgUpdateParams{ @@ -150,7 +150,7 @@ func (s *suite) newProofMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newSharedMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &sharedtypes.MsgUpdateParams{ @@ -183,7 +183,7 @@ func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newAppMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newAppMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &apptypes.MsgUpdateParams{ @@ -203,7 +203,7 @@ func (s *suite) newAppMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newServiceMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newServiceMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &servicetypes.MsgUpdateParams{ From 526113b583857af8d83d1e4cfd31ca6e7da5a911 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:48:05 +0200 Subject: [PATCH 07/77] chore: add comment --- e2e/tests/params_tx_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e/tests/params_tx_test.go b/e2e/tests/params_tx_test.go index 926f856e2..6a3bb155a 100644 --- a/e2e/tests/params_tx_test.go +++ b/e2e/tests/params_tx_test.go @@ -41,6 +41,15 @@ func (s *suite) sendAuthzExecTx(signingKeyName, txJSONFilePath string) { // TODO_IMPROVE: wait for the tx to be committed using an events query client // instead of sleeping for a specific amount of time. + // + // First attempt: + // eventAttrMatchFn := newEventAttributeMatchFn("action", "/cosmos.authz.v1beta1.MsgExec") + // s.waitForTxResultEvent(eventAttrMatchFn) + // + // This resulted in observing many more events than expected, even accounting + // for those corresponding to the param reset step, which is automatically + // registered in a s.Cleanup() below. + s.Logf("waiting %d seconds for the authz exec tx to be committed...", txDelaySeconds) time.Sleep(txDelaySeconds * time.Second) From 054d9063b4aa867c79bbefaf19164901a17bad71 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:48:15 +0200 Subject: [PATCH 08/77] chore: add missing param update assertions --- e2e/tests/0_settlement.feature | 2 ++ e2e/tests/session.feature | 1 + 2 files changed, 3 insertions(+) diff --git a/e2e/tests/0_settlement.feature b/e2e/tests/0_settlement.feature index 72d4c4a41..efba9b45f 100644 --- a/e2e/tests/0_settlement.feature +++ b/e2e/tests/0_settlement.feature @@ -25,6 +25,7 @@ Feature: Tokenomics Namespace | proof_requirement_threshold | 19 | int64 | | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | + And all "proof" module params should be updated When the supplier "supplier1" has serviced a session with "20" relays for service "anvil" for application "app1" # Wait for the Claim & Proof lifecycle And the user should wait for the "proof" module "CreateClaim" Message to be submitted @@ -54,6 +55,7 @@ Feature: Tokenomics Namespace | proof_requirement_threshold | 100 | int64 | | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | + And all "proof" module params should be updated # Start servicing When the supplier "supplier1" has serviced a session with "10" relays for service "anvil" for application "app1" # Wait for the Claim & Proof lifecycle diff --git a/e2e/tests/session.feature b/e2e/tests/session.feature index 37d3e279c..adae75846 100644 --- a/e2e/tests/session.feature +++ b/e2e/tests/session.feature @@ -11,6 +11,7 @@ Feature: Session Namespace | proof_requirement_threshold | 4 | int64 | | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | + And all "proof" module params should be updated When the supplier "supplier1" has serviced a session with "5" relays for service "anvil" for application "app1" And the user should wait for the "proof" module "CreateClaim" Message to be submitted And the user should wait for the "proof" module "ClaimCreated" tx event to be broadcast From 8b703c0b6e8784d91784aa4e6d3b9151ac0d7a2f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:55:49 +0200 Subject: [PATCH 09/77] refactor: event waiting test helpers --- e2e/tests/session_steps_test.go | 61 +++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/e2e/tests/session_steps_test.go b/e2e/tests/session_steps_test.go index e3c077850..1d52e0d65 100644 --- a/e2e/tests/session_steps_test.go +++ b/e2e/tests/session_steps_test.go @@ -207,8 +207,7 @@ func (s *suite) waitForTxResultEvent(eventIsMatch func(*abci.Event) bool) (match ctx, cancel := context.WithCancel(s.ctx) // For each observed event, **asynchronously** check if it contains the given action. - channel.ForEach[*abci.TxResult]( - ctx, s.txResultReplayClient.EventsSequence(ctx), + s.forEachTxResult(ctx, func(_ context.Context, txResult *abci.TxResult) { if txResult == nil { return @@ -225,13 +224,6 @@ func (s *suite) waitForTxResultEvent(eventIsMatch func(*abci.Event) bool) (match }, ) - select { - case <-time.After(eventTimeout): - s.Fatalf("ERROR: timed out waiting for tx result event") - case <-ctx.Done(): - s.Log("Success; message detected before timeout.") - } - return matchedEvent } @@ -245,8 +237,7 @@ func (s *suite) waitForNewBlockEvent( ctx, done := context.WithCancel(s.ctx) // For each observed event, **asynchronously** check if it contains the given action. - channel.ForEach[*block.CometNewBlockEvent]( - ctx, s.newBlockEventsReplayClient.EventsSequence(ctx), + s.forEachBlockEvent(ctx, func(_ context.Context, newBlockEvent *block.CometNewBlockEvent) { if newBlockEvent == nil { return @@ -264,13 +255,6 @@ func (s *suite) waitForNewBlockEvent( } }, ) - - select { - case <-time.After(eventTimeout): - s.Fatalf("ERROR: timed out waiting for NewBlock event") - case <-ctx.Done(): - s.Log("Success; message detected before timeout.") - } } // waitForBlockHeight waits for a NewBlock event to be observed whose height is @@ -280,8 +264,7 @@ func (s *suite) waitForBlockHeight(targetHeight int64) { // For each observed event, **asynchronously** check if it is greater than // or equal to the target height - channel.ForEach[*block.CometNewBlockEvent]( - ctx, s.newBlockEventsReplayClient.EventsSequence(ctx), + s.forEachBlockEvent(ctx, func(_ context.Context, newBlockEvent *block.CometNewBlockEvent) { if newBlockEvent == nil { return @@ -293,12 +276,46 @@ func (s *suite) waitForBlockHeight(targetHeight int64) { } }, ) +} + +// forEachBlockEvent calls blockEventFn for each observed block event **asynchronously** +// and blocks on waiting for the given context to be cancelled. If the context is +// not cancelled before eventTimeout, the test will fail. +func (s *suite) forEachBlockEvent( + ctx context.Context, + blockEventFn func(_ context.Context, newBlockEvent *block.CometNewBlockEvent), +) { + channel.ForEach[*block.CometNewBlockEvent](ctx, + s.newBlockEventsReplayClient.EventsSequence(ctx), + blockEventFn, + ) + + select { + case <-time.After(eventTimeout): + s.Fatalf("ERROR: timed out waiting new block event") + case <-ctx.Done(): + s.Log("Success; new block event detected before timeout.") + } +} + +// forEachTxResult calls txResult for each observed tx result **asynchronously** +// and blocks on waiting for the given context to be cancelled. If the context is +// not cancelled before eventTimeout, the test will fail. +func (s *suite) forEachTxResult( + ctx context.Context, + txResultFn func(_ context.Context, txResult *abci.TxResult), +) { + + channel.ForEach[*abci.TxResult](ctx, + s.txResultReplayClient.EventsSequence(ctx), + txResultFn, + ) select { case <-time.After(eventTimeout): - s.Fatalf("ERROR: timed out waiting for block height", targetHeight) + s.Fatalf("ERROR: timed out waiting for tx result") case <-ctx.Done(): - s.Log("Success; height detected before timeout.") + s.Log("Success; tx result detected before timeout.") } } From ba1893c056825737fe4d433a6f3f527b22396dbd Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 09:55:41 +0200 Subject: [PATCH 10/77] feat: add supplier staking events --- api/poktroll/supplier/event.pulsar.go | 1577 +++++++++++++++++ e2e/tests/stake_supplier.feature | 10 +- proto/poktroll/supplier/event.proto | 26 + .../keeper/msg_server_stake_supplier.go | 8 + .../keeper/msg_server_unstake_supplier.go | 7 + x/supplier/keeper/unbond_suppliers.go | 8 + x/supplier/types/event.pb.go | 682 +++++++ 7 files changed, 2315 insertions(+), 3 deletions(-) create mode 100644 api/poktroll/supplier/event.pulsar.go create mode 100644 proto/poktroll/supplier/event.proto create mode 100644 x/supplier/types/event.pb.go diff --git a/api/poktroll/supplier/event.pulsar.go b/api/poktroll/supplier/event.pulsar.go new file mode 100644 index 000000000..510d3671a --- /dev/null +++ b/api/poktroll/supplier/event.pulsar.go @@ -0,0 +1,1577 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + shared "github.com/pokt-network/poktroll/api/poktroll/shared" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventSupplierStaked protoreflect.MessageDescriptor + fd_EventSupplierStaked_supplier protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_event_proto_init() + md_EventSupplierStaked = File_poktroll_supplier_event_proto.Messages().ByName("EventSupplierStaked") + fd_EventSupplierStaked_supplier = md_EventSupplierStaked.Fields().ByName("supplier") +} + +var _ protoreflect.Message = (*fastReflection_EventSupplierStaked)(nil) + +type fastReflection_EventSupplierStaked EventSupplierStaked + +func (x *EventSupplierStaked) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventSupplierStaked)(x) +} + +func (x *EventSupplierStaked) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventSupplierStaked_messageType fastReflection_EventSupplierStaked_messageType +var _ protoreflect.MessageType = fastReflection_EventSupplierStaked_messageType{} + +type fastReflection_EventSupplierStaked_messageType struct{} + +func (x fastReflection_EventSupplierStaked_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventSupplierStaked)(nil) +} +func (x fastReflection_EventSupplierStaked_messageType) New() protoreflect.Message { + return new(fastReflection_EventSupplierStaked) +} +func (x fastReflection_EventSupplierStaked_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierStaked +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventSupplierStaked) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierStaked +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventSupplierStaked) Type() protoreflect.MessageType { + return _fastReflection_EventSupplierStaked_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventSupplierStaked) New() protoreflect.Message { + return new(fastReflection_EventSupplierStaked) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventSupplierStaked) Interface() protoreflect.ProtoMessage { + return (*EventSupplierStaked)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventSupplierStaked) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_EventSupplierStaked_supplier, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventSupplierStaked) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + return x.Supplier != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierStaked) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + x.Supplier = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventSupplierStaked) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierStaked) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + x.Supplier = value.Message().Interface().(*shared.Supplier) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierStaked) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + if x.Supplier == nil { + x.Supplier = new(shared.Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventSupplierStaked) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierStaked.supplier": + m := new(shared.Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierStaked")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierStaked does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventSupplierStaked) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.EventSupplierStaked", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventSupplierStaked) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierStaked) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventSupplierStaked) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventSupplierStaked) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventSupplierStaked) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Supplier != nil { + l = options.Size(x.Supplier) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierStaked) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierStaked) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierStaked: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierStaked: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Supplier == nil { + x.Supplier = &shared.Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventSupplierUnbondingBegin protoreflect.MessageDescriptor + fd_EventSupplierUnbondingBegin_supplier protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_event_proto_init() + md_EventSupplierUnbondingBegin = File_poktroll_supplier_event_proto.Messages().ByName("EventSupplierUnbondingBegin") + fd_EventSupplierUnbondingBegin_supplier = md_EventSupplierUnbondingBegin.Fields().ByName("supplier") +} + +var _ protoreflect.Message = (*fastReflection_EventSupplierUnbondingBegin)(nil) + +type fastReflection_EventSupplierUnbondingBegin EventSupplierUnbondingBegin + +func (x *EventSupplierUnbondingBegin) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventSupplierUnbondingBegin)(x) +} + +func (x *EventSupplierUnbondingBegin) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventSupplierUnbondingBegin_messageType fastReflection_EventSupplierUnbondingBegin_messageType +var _ protoreflect.MessageType = fastReflection_EventSupplierUnbondingBegin_messageType{} + +type fastReflection_EventSupplierUnbondingBegin_messageType struct{} + +func (x fastReflection_EventSupplierUnbondingBegin_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventSupplierUnbondingBegin)(nil) +} +func (x fastReflection_EventSupplierUnbondingBegin_messageType) New() protoreflect.Message { + return new(fastReflection_EventSupplierUnbondingBegin) +} +func (x fastReflection_EventSupplierUnbondingBegin_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierUnbondingBegin +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventSupplierUnbondingBegin) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierUnbondingBegin +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventSupplierUnbondingBegin) Type() protoreflect.MessageType { + return _fastReflection_EventSupplierUnbondingBegin_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventSupplierUnbondingBegin) New() protoreflect.Message { + return new(fastReflection_EventSupplierUnbondingBegin) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventSupplierUnbondingBegin) Interface() protoreflect.ProtoMessage { + return (*EventSupplierUnbondingBegin)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventSupplierUnbondingBegin) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_EventSupplierUnbondingBegin_supplier, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventSupplierUnbondingBegin) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + return x.Supplier != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingBegin) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + x.Supplier = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventSupplierUnbondingBegin) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingBegin) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + x.Supplier = value.Message().Interface().(*shared.Supplier) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingBegin) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + if x.Supplier == nil { + x.Supplier = new(shared.Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventSupplierUnbondingBegin) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": + m := new(shared.Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingBegin does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventSupplierUnbondingBegin) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.EventSupplierUnbondingBegin", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventSupplierUnbondingBegin) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingBegin) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventSupplierUnbondingBegin) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventSupplierUnbondingBegin) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventSupplierUnbondingBegin) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Supplier != nil { + l = options.Size(x.Supplier) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierUnbondingBegin) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierUnbondingBegin) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierUnbondingBegin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierUnbondingBegin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Supplier == nil { + x.Supplier = &shared.Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventSupplierUnbondingEnd protoreflect.MessageDescriptor + fd_EventSupplierUnbondingEnd_supplier protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_event_proto_init() + md_EventSupplierUnbondingEnd = File_poktroll_supplier_event_proto.Messages().ByName("EventSupplierUnbondingEnd") + fd_EventSupplierUnbondingEnd_supplier = md_EventSupplierUnbondingEnd.Fields().ByName("supplier") +} + +var _ protoreflect.Message = (*fastReflection_EventSupplierUnbondingEnd)(nil) + +type fastReflection_EventSupplierUnbondingEnd EventSupplierUnbondingEnd + +func (x *EventSupplierUnbondingEnd) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventSupplierUnbondingEnd)(x) +} + +func (x *EventSupplierUnbondingEnd) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventSupplierUnbondingEnd_messageType fastReflection_EventSupplierUnbondingEnd_messageType +var _ protoreflect.MessageType = fastReflection_EventSupplierUnbondingEnd_messageType{} + +type fastReflection_EventSupplierUnbondingEnd_messageType struct{} + +func (x fastReflection_EventSupplierUnbondingEnd_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventSupplierUnbondingEnd)(nil) +} +func (x fastReflection_EventSupplierUnbondingEnd_messageType) New() protoreflect.Message { + return new(fastReflection_EventSupplierUnbondingEnd) +} +func (x fastReflection_EventSupplierUnbondingEnd_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierUnbondingEnd +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventSupplierUnbondingEnd) Descriptor() protoreflect.MessageDescriptor { + return md_EventSupplierUnbondingEnd +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventSupplierUnbondingEnd) Type() protoreflect.MessageType { + return _fastReflection_EventSupplierUnbondingEnd_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventSupplierUnbondingEnd) New() protoreflect.Message { + return new(fastReflection_EventSupplierUnbondingEnd) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventSupplierUnbondingEnd) Interface() protoreflect.ProtoMessage { + return (*EventSupplierUnbondingEnd)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventSupplierUnbondingEnd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_EventSupplierUnbondingEnd_supplier, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventSupplierUnbondingEnd) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + return x.Supplier != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingEnd) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + x.Supplier = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventSupplierUnbondingEnd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingEnd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + x.Supplier = value.Message().Interface().(*shared.Supplier) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingEnd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + if x.Supplier == nil { + x.Supplier = new(shared.Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventSupplierUnbondingEnd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": + m := new(shared.Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) + } + panic(fmt.Errorf("message poktroll.supplier.EventSupplierUnbondingEnd does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventSupplierUnbondingEnd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.EventSupplierUnbondingEnd", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventSupplierUnbondingEnd) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventSupplierUnbondingEnd) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventSupplierUnbondingEnd) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventSupplierUnbondingEnd) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventSupplierUnbondingEnd) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Supplier != nil { + l = options.Size(x.Supplier) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierUnbondingEnd) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventSupplierUnbondingEnd) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierUnbondingEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSupplierUnbondingEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Supplier == nil { + x.Supplier = &shared.Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/supplier/event.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventSupplierStaked is emitted with the commitment of the supplier is stake message. +type EventSupplierStaked struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (x *EventSupplierStaked) Reset() { + *x = EventSupplierStaked{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventSupplierStaked) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventSupplierStaked) ProtoMessage() {} + +// Deprecated: Use EventSupplierStaked.ProtoReflect.Descriptor instead. +func (*EventSupplierStaked) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_event_proto_rawDescGZIP(), []int{0} +} + +func (x *EventSupplierStaked) GetSupplier() *shared.Supplier { + if x != nil { + return x.Supplier + } + return nil +} + +// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. +type EventSupplierUnbondingBegin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (x *EventSupplierUnbondingBegin) Reset() { + *x = EventSupplierUnbondingBegin{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventSupplierUnbondingBegin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventSupplierUnbondingBegin) ProtoMessage() {} + +// Deprecated: Use EventSupplierUnbondingBegin.ProtoReflect.Descriptor instead. +func (*EventSupplierUnbondingBegin) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_event_proto_rawDescGZIP(), []int{1} +} + +func (x *EventSupplierUnbondingBegin) GetSupplier() *shared.Supplier { + if x != nil { + return x.Supplier + } + return nil +} + +// EventSupplierUnbondingEnd is emitted with the commitment of last block of the +// supplier unbonding period. +type EventSupplierUnbondingEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (x *EventSupplierUnbondingEnd) Reset() { + *x = EventSupplierUnbondingEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventSupplierUnbondingEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventSupplierUnbondingEnd) ProtoMessage() {} + +// Deprecated: Use EventSupplierUnbondingEnd.ProtoReflect.Descriptor instead. +func (*EventSupplierUnbondingEnd) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_event_proto_rawDescGZIP(), []int{2} +} + +func (x *EventSupplierUnbondingEnd) GetSupplier() *shared.Supplier { + if x != nil { + return x.Supplier + } + return nil +} + +var File_poktroll_supplier_event_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_event_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x22, 0x54, 0x0a, 0x1b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, + 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x19, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x45, 0x6e, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0xb0, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_event_proto_rawDescOnce sync.Once + file_poktroll_supplier_event_proto_rawDescData = file_poktroll_supplier_event_proto_rawDesc +) + +func file_poktroll_supplier_event_proto_rawDescGZIP() []byte { + file_poktroll_supplier_event_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_event_proto_rawDescData) + }) + return file_poktroll_supplier_event_proto_rawDescData +} + +var file_poktroll_supplier_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_poktroll_supplier_event_proto_goTypes = []interface{}{ + (*EventSupplierStaked)(nil), // 0: poktroll.supplier.EventSupplierStaked + (*EventSupplierUnbondingBegin)(nil), // 1: poktroll.supplier.EventSupplierUnbondingBegin + (*EventSupplierUnbondingEnd)(nil), // 2: poktroll.supplier.EventSupplierUnbondingEnd + (*shared.Supplier)(nil), // 3: poktroll.shared.Supplier +} +var file_poktroll_supplier_event_proto_depIdxs = []int32{ + 3, // 0: poktroll.supplier.EventSupplierStaked.supplier:type_name -> poktroll.shared.Supplier + 3, // 1: poktroll.supplier.EventSupplierUnbondingBegin.supplier:type_name -> poktroll.shared.Supplier + 3, // 2: poktroll.supplier.EventSupplierUnbondingEnd.supplier:type_name -> poktroll.shared.Supplier + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_poktroll_supplier_event_proto_init() } +func file_poktroll_supplier_event_proto_init() { + if File_poktroll_supplier_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventSupplierStaked); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventSupplierUnbondingBegin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventSupplierUnbondingEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_supplier_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_supplier_event_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_event_proto_depIdxs, + MessageInfos: file_poktroll_supplier_event_proto_msgTypes, + }.Build() + File_poktroll_supplier_event_proto = out.File + file_poktroll_supplier_event_proto_rawDesc = nil + file_poktroll_supplier_event_proto_goTypes = nil + file_poktroll_supplier_event_proto_depIdxs = nil +} diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index f3062ea8c..de0440165 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -9,6 +9,7 @@ Feature: Stake Supplier Namespace And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error And the user should wait for the "supplier" module "StakeSupplier" message to be submitted + And the user should wait for the "supplier" module "SupplierStaked" tx event to be broadcast And the "supplier" for account "supplier2" is staked with "1000070" uPOKT And the account balance of "supplier2" should be "1000070" uPOKT "less" than before @@ -23,8 +24,9 @@ Feature: Stake Supplier Namespace And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error And the supplier for account "supplier2" is unbonding - When the user waits for the supplier for account "supplier2" unbonding period to finish - Then the user verifies the "supplier" for account "supplier2" is not staked + And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast + And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast + And the user verifies the "supplier" for account "supplier2" is not staked And the account balance of "supplier2" should be "1000070" uPOKT "more" than before Scenario: User can restake a Supplier waiting for it to become active again @@ -40,4 +42,6 @@ Feature: Stake Supplier Namespace Then the session for application "app1" and service "anvil" contains the supplier "supplier2" # Cleanup to make this feature idempotent. And the user unstakes a "supplier" from the account "supplier2" - And the user waits for the supplier for account "supplier2" unbonding period to finish + And the supplier for account "supplier2" is unbonding + And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast + And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast diff --git a/proto/poktroll/supplier/event.proto b/proto/poktroll/supplier/event.proto new file mode 100644 index 000000000..970b9b91e --- /dev/null +++ b/proto/poktroll/supplier/event.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package poktroll.supplier; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; +option (gogoproto.stable_marshaler_all) = true; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "poktroll/shared/supplier.proto"; + +// EventSupplierStaked is emitted with the commitment of the supplier is stake message. +message EventSupplierStaked { + poktroll.shared.Supplier supplier = 1; +} + +// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. +message EventSupplierUnbondingBegin { + poktroll.shared.Supplier supplier = 1; +} + +// EventSupplierUnbondingEnd is emitted with the commitment of last block of the +// supplier unbonding period. +message EventSupplierUnbondingEnd { + poktroll.shared.Supplier supplier = 1; +} diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index b3da89899..a31ea9db8 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -122,6 +122,14 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie k.SetSupplier(ctx, supplier) logger.Info(fmt.Sprintf("Successfully updated supplier stake for supplier: %+v", supplier)) + sdkCtx := sdk.UnwrapSDKContext(ctx) + event := &types.EventSupplierStaked{ + Supplier: &supplier, + } + if eventErr := sdkCtx.EventManager().EmitTypedEvent(event); eventErr != nil { + logger.Error(fmt.Sprintf("failed to emit event: %+v; %s", event, eventErr)) + } + isSuccessful = true return &types.MsgStakeSupplierResponse{}, nil } diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 510368baa..fa530172c 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -69,6 +69,13 @@ func (k msgServer) UnstakeSupplier( supplier.UnstakeSessionEndHeight = uint64(shared.GetSessionEndHeight(&sharedParams, currentHeight)) k.SetSupplier(ctx, supplier) + event := &types.EventSupplierUnbondingBegin{ + Supplier: &supplier, + } + if eventErr := sdkCtx.EventManager().EmitTypedEvent(event); eventErr != nil { + logger.Error(fmt.Sprintf("failed to emit event: %+v; %s", event, eventErr)) + } + isSuccessful = true return &types.MsgUnstakeSupplierResponse{}, nil } diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index ba8242e88..62ba7a601 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -5,6 +5,7 @@ import ( "fmt" cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/shared" "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -67,6 +68,13 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { // Remove the supplier from the store. k.RemoveSupplier(ctx, supplierOperatorAddress.String()) logger.Info(fmt.Sprintf("Successfully removed the supplier: %+v", supplier)) + + event := &types.EventSupplierUnbondingEnd{ + Supplier: &supplier, + } + if eventErr := sdkCtx.EventManager().EmitTypedEvent(event); eventErr != nil { + logger.Error(fmt.Sprintf("failed to emit event: %+v; %s", event, eventErr)) + } } return nil diff --git a/x/supplier/types/event.pb.go b/x/supplier/types/event.pb.go new file mode 100644 index 000000000..ede1d3985 --- /dev/null +++ b/x/supplier/types/event.pb.go @@ -0,0 +1,682 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// EventSupplierStaked is emitted with the commitment of the supplier is stake message. +type EventSupplierStaked struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (m *EventSupplierStaked) Reset() { *m = EventSupplierStaked{} } +func (m *EventSupplierStaked) String() string { return proto.CompactTextString(m) } +func (*EventSupplierStaked) ProtoMessage() {} +func (*EventSupplierStaked) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{0} +} +func (m *EventSupplierStaked) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierStaked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierStaked) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierStaked.Merge(m, src) +} +func (m *EventSupplierStaked) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierStaked) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierStaked.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierStaked proto.InternalMessageInfo + +func (m *EventSupplierStaked) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. +type EventSupplierUnbondingBegin struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (m *EventSupplierUnbondingBegin) Reset() { *m = EventSupplierUnbondingBegin{} } +func (m *EventSupplierUnbondingBegin) String() string { return proto.CompactTextString(m) } +func (*EventSupplierUnbondingBegin) ProtoMessage() {} +func (*EventSupplierUnbondingBegin) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{1} +} +func (m *EventSupplierUnbondingBegin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierUnbondingBegin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierUnbondingBegin) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierUnbondingBegin.Merge(m, src) +} +func (m *EventSupplierUnbondingBegin) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierUnbondingBegin) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierUnbondingBegin.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierUnbondingBegin proto.InternalMessageInfo + +func (m *EventSupplierUnbondingBegin) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +// EventSupplierUnbondingEnd is emitted with the commitment of last block of the +// supplier unbonding period. +type EventSupplierUnbondingEnd struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (m *EventSupplierUnbondingEnd) Reset() { *m = EventSupplierUnbondingEnd{} } +func (m *EventSupplierUnbondingEnd) String() string { return proto.CompactTextString(m) } +func (*EventSupplierUnbondingEnd) ProtoMessage() {} +func (*EventSupplierUnbondingEnd) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{2} +} +func (m *EventSupplierUnbondingEnd) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierUnbondingEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierUnbondingEnd) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierUnbondingEnd.Merge(m, src) +} +func (m *EventSupplierUnbondingEnd) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierUnbondingEnd) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierUnbondingEnd.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierUnbondingEnd proto.InternalMessageInfo + +func (m *EventSupplierUnbondingEnd) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +func init() { + proto.RegisterType((*EventSupplierStaked)(nil), "poktroll.supplier.EventSupplierStaked") + proto.RegisterType((*EventSupplierUnbondingBegin)(nil), "poktroll.supplier.EventSupplierUnbondingBegin") + proto.RegisterType((*EventSupplierUnbondingEnd)(nil), "poktroll.supplier.EventSupplierUnbondingEnd") +} + +func init() { proto.RegisterFile("poktroll/supplier/event.proto", fileDescriptor_22d2d1a82853ce0a) } + +var fileDescriptor_22d2d1a82853ce0a = []byte{ + // 247 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x4f, 0x2d, + 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x49, 0xeb, 0xc1, 0xa4, + 0xa5, 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0x0a, 0xf4, 0x21, 0x1c, 0x88, 0x6a, + 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x88, 0x38, 0x88, 0x05, 0x15, 0x95, 0x43, 0x58, 0x91, 0x91, + 0x58, 0x94, 0x9a, 0x02, 0xb7, 0x09, 0x22, 0xaf, 0xe4, 0xc3, 0x25, 0xec, 0x0a, 0xb2, 0x32, 0x18, + 0x2a, 0x1c, 0x5c, 0x92, 0x98, 0x9d, 0x9a, 0x22, 0x64, 0xca, 0xc5, 0x01, 0x53, 0x28, 0xc1, 0xa8, + 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa9, 0x87, 0x70, 0x0d, 0xd8, 0x24, 0x3d, 0x98, 0x96, 0x20, 0xb8, + 0x52, 0xa5, 0x10, 0x2e, 0x69, 0x14, 0xd3, 0x42, 0xf3, 0x92, 0xf2, 0xf3, 0x52, 0x32, 0xf3, 0xd2, + 0x9d, 0x52, 0xd3, 0x33, 0xf3, 0xc8, 0x35, 0x35, 0x88, 0x4b, 0x12, 0xbb, 0xa9, 0xae, 0x79, 0xe4, + 0xba, 0xd4, 0xc9, 0xff, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, + 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, + 0x63, 0x88, 0x32, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0x19, + 0xa6, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0f, 0xcd, 0x0a, 0x44, 0x94, 0x95, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xd3, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xfd, + 0x1f, 0x53, 0xd0, 0xd4, 0x01, 0x00, 0x00, +} + +func (m *EventSupplierStaked) 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 *EventSupplierStaked) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierStaked) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSupplierUnbondingBegin) 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 *EventSupplierUnbondingBegin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierUnbondingBegin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSupplierUnbondingEnd) 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 *EventSupplierUnbondingEnd) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierUnbondingEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventSupplierStaked) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventSupplierUnbondingBegin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventSupplierUnbondingEnd) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventSupplierStaked) 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 ErrIntOverflowEvent + } + 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: EventSupplierStaked: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierStaked: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSupplierUnbondingBegin) 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 ErrIntOverflowEvent + } + 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: EventSupplierUnbondingBegin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierUnbondingBegin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSupplierUnbondingEnd) 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 ErrIntOverflowEvent + } + 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: EventSupplierUnbondingEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierUnbondingEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) From d3d51bec3f4b9b2fad7c4eb8bfeae1b44f6a483a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 12 Sep 2024 19:25:56 +0200 Subject: [PATCH 11/77] fix: test assertion expectation type --- e2e/tests/stake_supplier_steps_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/tests/stake_supplier_steps_test.go b/e2e/tests/stake_supplier_steps_test.go index 15197a25e..75caa3652 100644 --- a/e2e/tests/stake_supplier_steps_test.go +++ b/e2e/tests/stake_supplier_steps_test.go @@ -14,10 +14,11 @@ import ( func (s *suite) TheUnbondingPeriodParamIsSuccessfullySetToSessionsOfBlocks( _ string, - supplierUnbondingPeriodSessions, + unbondingPeriodSessions, numBlocksPerSession int64, ) { - require.GreaterOrEqualf(s, numBlocksPerSession, 2, + s.Logf("numBlocksPerSession: %d, unbondingPeriodSessions: %d", numBlocksPerSession, unbondingPeriodSessions) + require.GreaterOrEqualf(s, numBlocksPerSession, int64(2), "num_blocks_per_session MUST be at least 2 to satisfy parameter validation requirements") paramModuleName := "shared" @@ -39,7 +40,7 @@ func (s *suite) TheUnbondingPeriodParamIsSuccessfullySetToSessionsOfBlocks( ClaimWindowCloseOffsetBlocks: 1, ProofWindowOpenOffsetBlocks: 0, ProofWindowCloseOffsetBlocks: 1, - SupplierUnbondingPeriodSessions: uint64(supplierUnbondingPeriodSessions), + SupplierUnbondingPeriodSessions: uint64(unbondingPeriodSessions), ApplicationUnbondingPeriodSessions: 1, } From adfe8b8bb1236acbaadeecf8c9a32457de13c137 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 13:18:15 +0200 Subject: [PATCH 12/77] refactor: integration app's base app & db construction --- testutil/integration/app.go | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 0f68ccba9..6ba5de572 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -100,6 +100,12 @@ type App struct { DefaultSupplierKeyringKeyringUid string } +// TODO_IN_THIS_COMMIT: godoc... +func NewBaseApp(cdc codec.Codec, logger log.Logger, db dbm.DB) *baseapp.BaseApp { + txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + return baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) +} + // NewIntegrationApp creates a new instance of the App with the provided details // on how the modules should be configured. func NewIntegrationApp( @@ -107,6 +113,7 @@ func NewIntegrationApp( sdkCtx sdk.Context, cdc codec.Codec, registry codectypes.InterfaceRegistry, + bApp *baseapp.BaseApp, logger log.Logger, authority sdk.AccAddress, modules map[string]appmodule.AppModule, @@ -116,8 +123,6 @@ func NewIntegrationApp( ) *App { t.Helper() - db := dbm.NewMemDB() - moduleManager := module.NewManagerFromMap(modules) basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) basicModuleManager.RegisterInterfaces(registry) @@ -141,8 +146,6 @@ func NewIntegrationApp( sdkCtx = sdkCtx.WithProposer(consensusAddr) // Create the base application - txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) - bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) bApp.MountKVStores(keys) bApp.SetInitChainer( @@ -228,9 +231,17 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authtypes.StoreKey, ) - // Prepare the context + // Construct a no-op logger. logger := log.NewNopLogger() // Use this if you need more output: log.NewTestLogger(t) - cms := CreateMultiStore(storeKeys, logger) + + // Prepare the database and multi-store. + db := dbm.NewMemDB() + cms := CreateMultiStore(storeKeys, logger, db) + + // Prepare the base application. + bApp := NewBaseApp(cdc, logger, db) + + // Prepare the context sdkCtx := sdk.NewContext(cms, cmtproto.Header{ ChainID: appName, Height: 1, @@ -454,6 +465,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { sdkCtx, cdc, registry, + bApp, logger, authority, modules, @@ -759,8 +771,11 @@ func (app *App) nextBlockUpdateCtx() { } // CreateMultiStore is a helper for setting up multiple stores for provided modules. -func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore { - db := dbm.NewMemDB() +func CreateMultiStore( + keys map[string]*storetypes.KVStoreKey, + logger log.Logger, + db dbm.DB, +) storetypes.CommitMultiStore { cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics()) for key := range keys { From 7aeb2e96eaf9b6f7c1a13c889d741dc50f2c0774 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 13:18:29 +0200 Subject: [PATCH 13/77] refactor: expose integration app's PreGeneratedAccountsIterator --- testutil/integration/app.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 6ba5de572..614d57286 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -81,14 +81,15 @@ type App struct { *baseapp.BaseApp // Internal state of the App needed for properly configuring the blockchain. - sdkCtx *sdk.Context - cdc codec.Codec - logger log.Logger - authority sdk.AccAddress - moduleManager module.Manager - queryHelper *baseapp.QueryServiceTestHelper - keyRing keyring.Keyring - ringClient crypto.RingClient + sdkCtx *sdk.Context + cdc codec.Codec + logger log.Logger + authority sdk.AccAddress + moduleManager module.Manager + queryHelper *baseapp.QueryServiceTestHelper + keyRing keyring.Keyring + ringClient crypto.RingClient + preGeneratedAccts *testkeyring.PreGeneratedAccountIterator // Some default helper fixtures for general testing. // They're publically exposed and should/could be improve and expand on @@ -524,6 +525,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Create a pre-generated account iterator to create accounts for the test. preGeneratedAccts := testkeyring.PreGeneratedAccounts() + integrationApp.preGeneratedAccts = preGeneratedAccts // Prepare a new default service defaultService := sharedtypes.Service{ @@ -645,6 +647,11 @@ func (app *App) GetAuthority() string { return app.authority.String() } +// GetPreGeneratedAccounts returns the pre-generated accounts iterater used by the application. +func (app *App) GetPreGeneratedAccounts() *testkeyring.PreGeneratedAccountIterator { + return app.preGeneratedAccts +} + // QueryHelper returns the query helper used by the application that can be // used to submit queries to the application. func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper { From f8cfdbedcebd57fb2bdf14e1e9d2ea40dec8bf70 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 13:18:35 +0200 Subject: [PATCH 14/77] refactor: add WithErrorAssertion run config option for integration app --- testutil/integration/app.go | 18 +++++++++++++++++- testutil/integration/options.go | 9 +++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 614d57286..418dfcbc5 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -678,6 +678,11 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp if cfg.AutomaticCommit { defer func() { _, err := app.Commit() + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return + } + require.NoError(t, err, "failed to commit") app.nextBlockUpdateCtx() }() @@ -691,6 +696,12 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp Votes: []cmtabcitypes.VoteInfo{{}}, }, }) + + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return nil + } + require.NoError(t, err, "failed to finalize block") app.emitEvents(t, finalizedBlockResponse) } @@ -700,10 +711,15 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp handler := app.MsgServiceRouter().Handler(msg) require.NotNil(t, handler, "handler not found for message %s", sdk.MsgTypeURL(msg)) + var response *codectypes.Any msgResult, err := handler(*app.sdkCtx, msg) + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return nil + } + require.NoError(t, err, "failed to execute message %s", sdk.MsgTypeURL(msg)) - var response *codectypes.Any if len(msgResult.MsgResponses) > 0 { msgResponse := msgResult.MsgResponses[0] require.NotNil(t, msgResponse, "unexpected nil msg response %s in message result: %s", sdk.MsgTypeURL(msg), msgResult.String()) diff --git a/testutil/integration/options.go b/testutil/integration/options.go index 9e94816e0..5d7b14074 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -4,6 +4,7 @@ package integration type RunConfig struct { AutomaticFinalizeBlock bool AutomaticCommit bool + ErrorAssertion func(error) } // RunOption is a function that can be used to configure the integration app. @@ -23,3 +24,11 @@ func WithAutomaticCommit() RunOption { cfg.AutomaticCommit = true } } + +// WithErrorAssertion registers an error assertion function which is called when +// RunMsg() encounters an error. +func WithErrorAssertion(errAssertFn func(error)) RunOption { + return func(cfg *RunConfig) { + cfg.ErrorAssertion = errAssertFn + } +} From dbd2402b598433a1848f47f61acc149ea1a1e37e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 13:18:43 +0200 Subject: [PATCH 15/77] refactor: add authz to integration app --- testutil/integration/app.go | 57 ++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 418dfcbc5..18b3d8918 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -13,6 +13,7 @@ import ( "cosmossdk.io/store" "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/tx/signing" abci "github.com/cometbft/cometbft/abci/types" cmtabcitypes "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -33,9 +34,14 @@ import ( authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/authz" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/app" @@ -198,8 +204,24 @@ func NewIntegrationApp( func NewCompleteIntegrationApp(t *testing.T) *App { t.Helper() + sdkCfg := cosmostypes.GetConfig() + addrCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32AccountAddrPrefix()) + valCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32ValidatorAddrPrefix()) + // Prepare & register the codec for all the interfaces - registry := codectypes.NewInterfaceRegistry() + registry, err := codectypes.NewInterfaceRegistryWithOptions( + codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: addrCodec, + ValidatorAddressCodec: valCodec, + }, + }, + ) + require.NoError(t, err) + + banktypes.RegisterInterfaces(registry) + authz.RegisterInterfaces(registry) tokenomicstypes.RegisterInterfaces(registry) sharedtypes.RegisterInterfaces(registry) banktypes.RegisterInterfaces(registry) @@ -220,6 +242,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Prepare all the store keys storeKeys := storetypes.NewKVStoreKeys( + authzkeeper.StoreKey, sharedtypes.StoreKey, tokenomicstypes.StoreKey, banktypes.StoreKey, @@ -252,7 +275,6 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authority := authtypes.NewModuleAddress(govtypes.ModuleName) // Prepare the account keeper dependencies - addrCodec := addresscodec.NewBech32Codec(app.AccountAddressPrefix) macPerms := map[string][]string{ banktypes.ModuleName: {authtypes.Minter, authtypes.Burner}, tokenomicstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, @@ -280,7 +302,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { nil, // subspace is nil because we don't test params (which is legacy anyway) ) - // Prepare the bank keeper + // Prepare the bank keeper and module blockedAddresses := map[string]bool{ accountKeeper.GetAuthority(): false, } @@ -292,6 +314,12 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authority.String(), logger, ) + bankModule := bank.NewAppModule( + cdc, + bankKeeper, + accountKeeper, + nil, + ) // Prepare the shared keeper and module sharedKeeper := sharedkeeper.NewKeeper( @@ -447,8 +475,25 @@ func NewCompleteIntegrationApp(t *testing.T) *App { msgRouter := baseapp.NewMsgServiceRouter() queryHelper := baseapp.NewQueryServerTestHelper(sdkCtx, registry) + // Prepare the authz keeper and module + authzKeeper := authzkeeper.NewKeeper( + runtime.NewKVStoreService(storeKeys[authzkeeper.StoreKey]), + cdc, + msgRouter, + accountKeeper, + ).SetBankKeeper(bankKeeper) + authzModule := authzmodule.NewAppModule( + cdc, + authzKeeper, + accountKeeper, + bankKeeper, + registry, + ) + // Prepare the list of modules modules := map[string]appmodule.AppModule{ + banktypes.ModuleName: bankModule, + authz.ModuleName: authzModule, tokenomicstypes.ModuleName: tokenomicsModule, servicetypes.ModuleName: serviceModule, sharedtypes.ModuleName: sharedModule, @@ -476,6 +521,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { ) // Register the message servers + banktypes.RegisterMsgServer(msgRouter, bankkeeper.NewMsgServerImpl(bankKeeper)) tokenomicstypes.RegisterMsgServer(msgRouter, tokenomicskeeper.NewMsgServerImpl(tokenomicsKeeper)) servicetypes.RegisterMsgServer(msgRouter, servicekeeper.NewMsgServerImpl(serviceKeeper)) sharedtypes.RegisterMsgServer(msgRouter, sharedkeeper.NewMsgServerImpl(sharedKeeper)) @@ -485,8 +531,11 @@ func NewCompleteIntegrationApp(t *testing.T) *App { prooftypes.RegisterMsgServer(msgRouter, proofkeeper.NewMsgServerImpl(proofKeeper)) authtypes.RegisterMsgServer(msgRouter, authkeeper.NewMsgServerImpl(accountKeeper)) sessiontypes.RegisterMsgServer(msgRouter, sessionkeeper.NewMsgServerImpl(sessionKeeper)) + authz.RegisterMsgServer(msgRouter, authzKeeper) // Register query servers + banktypes.RegisterQueryServer(queryHelper, bankKeeper) + authz.RegisterQueryServer(queryHelper, authzKeeper) tokenomicstypes.RegisterQueryServer(queryHelper, tokenomicsKeeper) servicetypes.RegisterQueryServer(queryHelper, serviceKeeper) sharedtypes.RegisterQueryServer(queryHelper, sharedKeeper) @@ -499,7 +548,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { sessiontypes.RegisterQueryServer(queryHelper, sessionKeeper) // Set the default params for all the modules - err := sharedKeeper.SetParams(integrationApp.GetSdkCtx(), sharedtypes.DefaultParams()) + err = sharedKeeper.SetParams(integrationApp.GetSdkCtx(), sharedtypes.DefaultParams()) require.NoError(t, err) err = tokenomicsKeeper.SetParams(integrationApp.GetSdkCtx(), tokenomicstypes.DefaultParams()) require.NoError(t, err) From e3725e48efe2a06fdefd2b729ffec284b053d582 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 13:19:45 +0200 Subject: [PATCH 16/77] test: begin refactoring update params E2E tests as integration tests --- .../integration/params/update_params_test.go | 275 ++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 tests/integration/params/update_params_test.go diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go new file mode 100644 index 000000000..c116f6a26 --- /dev/null +++ b/tests/integration/params/update_params_test.go @@ -0,0 +1,275 @@ +package params + +import ( + "fmt" + "reflect" + "strings" + "testing" + "time" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/integration" + apptypes "github.com/pokt-network/poktroll/x/application/types" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" +) + +const ( + // poktrollMsgTypeFormat is the format for a poktroll module's message type. + // The first %s is the module name, and the second %s is the message name. + poktrollMsgTypeFormat = "/poktroll.%s.%s" + msgUpdateParamsName = "MsgUpdateParams" + msgUpdateParamName = "MsgUpdateParam" +) + +var ( + authorityAddr, + authorizedAddr, + unauthorizedAddr cosmostypes.AccAddress + allPoktrollModuleNames = []string{ + sharedtypes.ModuleName, + sessiontypes.ModuleName, + servicetypes.ModuleName, + apptypes.ModuleName, + gatewaytypes.ModuleName, + suppliertypes.ModuleName, + prooftypes.ModuleName, + tokenomicstypes.ModuleName, + } + authzGrantExpiration = time.Now().Add(time.Hour) + + validSharedParams = sharedtypes.Params{ + NumBlocksPerSession: 5, + GracePeriodEndOffsetBlocks: 2, + ClaimWindowOpenOffsetBlocks: 5, + ClaimWindowCloseOffsetBlocks: 5, + ProofWindowOpenOffsetBlocks: 2, + ProofWindowCloseOffsetBlocks: 5, + SupplierUnbondingPeriodSessions: 9, + ApplicationUnbondingPeriodSessions: 9, + } + + validSessionParams = sessiontypes.Params{} + + validServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 42000000000) + validServiceParams = servicetypes.Params{ + AddServiceFee: &validServiceFeeCoin, + } + + validApplicationParams = apptypes.Params{ + MaxDelegatedGateways: 10, + } + + validGatewayParams = gatewaytypes.Params{} + validSupplierParams = suppliertypes.Params{} + + validMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 4200) + validSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 42000000) + validProofParams = prooftypes.Params{ + RelayDifficultyTargetHash: prooftypes.DefaultRelayDifficultyTargetHash, + ProofRequestProbability: 1, + ProofRequirementThreshold: 0, + ProofMissingPenalty: &validMissingPenaltyCoin, + ProofSubmissionFee: &validSubmissionFeeCoin, + } + + validTokenomicsParams = tokenomicstypes.Params{ + ComputeUnitsToTokensMultiplier: 5, + } + + // NB: Authority fields are intentionally omitted. + // To be added to a **copy** by the test. + msgUpdateParamsByModule = map[string]cosmostypes.Msg{ + sharedtypes.ModuleName: &sharedtypes.MsgUpdateParams{ + Params: validSharedParams, + }, + sessiontypes.ModuleName: &sessiontypes.MsgUpdateParams{ + Params: validSessionParams, + }, + servicetypes.ModuleName: &servicetypes.MsgUpdateParams{ + Params: validServiceParams, + }, + apptypes.ModuleName: &apptypes.MsgUpdateParams{ + Params: validApplicationParams, + }, + gatewaytypes.ModuleName: &gatewaytypes.MsgUpdateParams{ + Params: validGatewayParams, + }, + suppliertypes.ModuleName: &suppliertypes.MsgUpdateParams{ + Params: validSupplierParams, + }, + prooftypes.ModuleName: &prooftypes.MsgUpdateParams{ + Params: validProofParams, + }, + tokenomicstypes.ModuleName: &tokenomicstypes.MsgUpdateParams{ + Params: validTokenomicsParams, + }, + } + + runUntilNextBlockOpts = []integration.RunOption{ + integration.WithAutomaticCommit(), + integration.WithAutomaticFinalizeBlock(), + } +) + +type UpdateParamsSuite struct { + suite.Suite + app *integration.App +} + +// SetupTest runs before each test in the suite. +func (s *UpdateParamsSuite) SetupTest() { + // Construct a fresh integration app for each test. + s.app = integration.NewCompleteIntegrationApp(s.T()) + + // Set the authority, authorized, and unauthorized addresses. + authorityAddr = cosmostypes.MustAccAddressFromBech32(s.app.GetAuthority()) + + nextAcct, ok := s.app.GetPreGeneratedAccounts().Next() + require.True(s.T(), ok, "insufficient pre-generated accounts available") + authorizedAddr = nextAcct.Address + + nextAcct, ok = s.app.GetPreGeneratedAccounts().Next() + require.True(s.T(), ok, "insufficient pre-generated accounts available") + unauthorizedAddr = nextAcct.Address + + // Create authz grants for all poktroll modules' MsgUpdateParams messages. + s.sendAuthzGrantMsgForPoktrollModules( + authorityAddr, + authorizedAddr, + msgUpdateParamsName, + allPoktrollModuleNames..., + ) +} + +func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { + for _, moduleName := range allPoktrollModuleNames { + s.T().Run(moduleName, func(t *testing.T) { + // Assert that the module's params are set to their default values. + // TODO_IN_THIS_COMMIT: consider whether/how to do this. Seems + // to require a query client instance for each module. + + //msgStruct, isMsgTypeFound := msgUpdateParamsByModule[moduleName] + msgIface, isMsgTypeFound := msgUpdateParamsByModule[moduleName] + require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + + msgValue := reflect.ValueOf(msgIface) + msgType := msgValue.Elem().Type() + + // Copy the message and set the authority field. + msgValueCopy := reflect.New(msgType) + msgValueCopy.Elem().Set(msgValue.Elem()) + msgValueCopy.Elem(). + FieldByName("Authority"). + SetString(authorityAddr.String()) + + msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) + + msgTypeName := proto.MessageName(msgUpdateParams) + s.T().Logf("msgType: %s", msgType.Name()) + s.T().Logf("msgTypeName: %s", msgTypeName) + + // Set up assertion that the MsgExec will fail. + errAssertionOpt := integration.WithErrorAssertion(func(err error) { + require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) + }) + + // Send an authz MsgExec from an unauthorized address. + runOpts := append(runUntilNextBlockOpts, errAssertionOpt) + execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) + anyRes := s.app.RunMsg(s.T(), &execMsg, runOpts...) + require.Nil(s.T(), anyRes) + }) + } +} + +func TestUpdateParamsSuite(t *testing.T) { + suite.Run(t, &UpdateParamsSuite{}) +} + +func (s *UpdateParamsSuite) sendAuthzGrantMsgForPoktrollModules( + granterAddr, granteeAddr cosmostypes.AccAddress, + msgName string, + moduleNames ...string, +) { + var runOpts []integration.RunOption + for moduleIdx, moduleName := range moduleNames { + // Commit and finalize the block after the last module's grant. + if moduleIdx == len(moduleNames)-1 { + runOpts = append(runOpts, runUntilNextBlockOpts...) + } + + msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) + authorization := &authz.GenericAuthorization{Msg: msgType} + s.runAuthzGrantMsg(granterAddr, granteeAddr, authorization, runOpts...) + } + + authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) + grantsQueryRes, err := authzQueryClient.GranteeGrants(s.app.GetSdkCtx(), &authz.QueryGranteeGrantsRequest{ + Grantee: granteeAddr.String(), + }) + require.NoError(s.T(), err) + require.NotNil(s.T(), grantsQueryRes) + + require.Equalf(s.T(), + len(allPoktrollModuleNames), + len(grantsQueryRes.Grants), + "expected %d grants but got %d: %+v", + len(allPoktrollModuleNames), + len(grantsQueryRes.Grants), + grantsQueryRes.Grants, + ) + + foundModuleGrants := make(map[string]int) + for _, grant := range grantsQueryRes.GetGrants() { + require.Equal(s.T(), granterAddr.String(), grant.Granter) + require.Equal(s.T(), granteeAddr.String(), grant.Grantee) + + for _, moduleName := range allPoktrollModuleNames { + if strings.Contains(grant.Authorization.GetTypeUrl(), moduleName) { + foundModuleGrants[moduleName]++ + } + } + } + + for _, foundTimes := range foundModuleGrants { + require.Equal(s.T(), 1, foundTimes) + } +} + +func (s *UpdateParamsSuite) runAuthzGrantMsg( + granterAddr, + granteeAddr cosmostypes.AccAddress, + authorization authz.Authorization, + runOpts ...integration.RunOption, +) { + grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &authzGrantExpiration) + require.NoError(s.T(), err) + + anyRes := s.app.RunMsg(s.T(), grantMsg, runOpts...) + require.NotNil(s.T(), anyRes) +} + +func (s *UpdateParamsSuite) runAuthzExecMsg( + fromAddr cosmostypes.AccAddress, + msgs ...cosmostypes.Msg, +) { + execMsg := authz.NewMsgExec(fromAddr, msgs) + anyRes := s.app.RunMsg(s.T(), &execMsg, runUntilNextBlockOpts...) + require.NotNil(s.T(), anyRes) + + execRes := new(authz.MsgExecResponse) + err := s.app.GetCodec().UnpackAny(anyRes, &execRes) + require.NoError(s.T(), err) +} From e842a0949f934f8231ae650cc6856bf3c24d2b1c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 13 Sep 2024 14:23:54 +0200 Subject: [PATCH 17/77] wip: refactor: integraiton test suites to improve composability & reusability --- e2e/tests/update_params_test.go | 26 ++-- tests/integration/params/update_param_test.go | 1 + .../integration/params/update_params_test.go | 132 +++--------------- testutil/integration/options.go | 15 ++ testutil/integration/suites/authz.go | 109 +++++++++++++++ testutil/integration/suites/base.go | 50 +++++++ testutil/integration/suites/interface.go | 11 ++ 7 files changed, 213 insertions(+), 131 deletions(-) create mode 100644 tests/integration/params/update_param_test.go create mode 100644 testutil/integration/suites/authz.go create mode 100644 testutil/integration/suites/base.go create mode 100644 testutil/integration/suites/interface.go diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 74d98168c..c13b1dfc6 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -217,9 +217,16 @@ func (s *suite) AllModuleParamsShouldBeSetToTheirDefaultValues(moduleName string // TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams sends an authz exec // message to update all module params for the given module. func (s *suite) TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams(accountName, moduleName string, table gocuke.DataTable) { - paramsTableMap := s.parseParamsTable(table) + // NB: set s#moduleParamsMap for later assertion. + s.expectedModuleParams = moduleParamsMap{ + moduleName: s.parseParamsTable(table), + } + + // Use the map of params to populate a tx JSON template & write it to a file. + txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) - s.sendAuthzExecToUpdateAllModuleParams(accountName, moduleName, paramsTableMap) + // Send the authz exec tx to update all module params. + s.sendAuthzExecTx(accountName, txJSONFile.Name()) } // AllModuleParamsShouldBeUpdated asserts that all module params have been updated as expected. @@ -472,21 +479,6 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { } } -// sendAuthzExecToUpdateAllModuleParams constructs and sends an authz exec -// tx to update all params for moduleName the given params. -func (s *suite) sendAuthzExecToUpdateAllModuleParams(accountName, moduleName string, params paramsAnyMap) { - // NB: set s#moduleParamsMap for later assertion. - s.expectedModuleParams = moduleParamsMap{ - moduleName: params, - } - - // Use the map of params to populate a tx JSON template & write it to a file. - txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) - - // Send the authz exec tx to update all module params. - s.sendAuthzExecTx(accountName, txJSONFile.Name()) -} - // assertUpdatedParams deserializes the param query response JSON into a // MsgUpdateParams of type P & asserts that it matches the expected params. func assertUpdatedParams[P cosmostypes.Msg]( diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go new file mode 100644 index 000000000..cbd83ba47 --- /dev/null +++ b/tests/integration/params/update_param_test.go @@ -0,0 +1 @@ +package params diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index c116f6a26..d87fe6674 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -1,11 +1,8 @@ package params import ( - "fmt" "reflect" - "strings" "testing" - "time" cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" @@ -15,6 +12,7 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/integration/suites" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -26,28 +24,14 @@ import ( ) const ( - // poktrollMsgTypeFormat is the format for a poktroll module's message type. - // The first %s is the module name, and the second %s is the message name. - poktrollMsgTypeFormat = "/poktroll.%s.%s" - msgUpdateParamsName = "MsgUpdateParams" - msgUpdateParamName = "MsgUpdateParam" + msgUpdateParamsName = "MsgUpdateParams" + msgUpdateParamName = "MsgUpdateParam" ) var ( authorityAddr, authorizedAddr, unauthorizedAddr cosmostypes.AccAddress - allPoktrollModuleNames = []string{ - sharedtypes.ModuleName, - sessiontypes.ModuleName, - servicetypes.ModuleName, - apptypes.ModuleName, - gatewaytypes.ModuleName, - suppliertypes.ModuleName, - prooftypes.ModuleName, - tokenomicstypes.ModuleName, - } - authzGrantExpiration = time.Now().Add(time.Hour) validSharedParams = sharedtypes.Params{ NumBlocksPerSession: 5, @@ -117,44 +101,38 @@ var ( }, } - runUntilNextBlockOpts = []integration.RunOption{ - integration.WithAutomaticCommit(), - integration.WithAutomaticFinalizeBlock(), - } + _ suites.IntegrationSuite = (*UpdateParamsSuite)(nil) ) type UpdateParamsSuite struct { - suite.Suite - app *integration.App + suites.AuthzIntegrationSuite } // SetupTest runs before each test in the suite. func (s *UpdateParamsSuite) SetupTest() { // Construct a fresh integration app for each test. - s.app = integration.NewCompleteIntegrationApp(s.T()) - // Set the authority, authorized, and unauthorized addresses. - authorityAddr = cosmostypes.MustAccAddressFromBech32(s.app.GetAuthority()) + authorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) - nextAcct, ok := s.app.GetPreGeneratedAccounts().Next() + nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") authorizedAddr = nextAcct.Address - nextAcct, ok = s.app.GetPreGeneratedAccounts().Next() + nextAcct, ok = s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") unauthorizedAddr = nextAcct.Address // Create authz grants for all poktroll modules' MsgUpdateParams messages. - s.sendAuthzGrantMsgForPoktrollModules( + s.SendAuthzGrantMsgForPoktrollModules( authorityAddr, authorizedAddr, msgUpdateParamsName, - allPoktrollModuleNames..., + s.GetModuleNames()..., ) } func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { - for _, moduleName := range allPoktrollModuleNames { + for _, moduleName := range s.GetModuleNames() { s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. // TODO_IN_THIS_COMMIT: consider whether/how to do this. Seems @@ -181,14 +159,16 @@ func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { s.T().Logf("msgTypeName: %s", msgTypeName) // Set up assertion that the MsgExec will fail. - errAssertionOpt := integration.WithErrorAssertion(func(err error) { - require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) - }) + errAssertionOpt := integration.WithErrorAssertion( + func(err error) { + require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) + }, + ) // Send an authz MsgExec from an unauthorized address. - runOpts := append(runUntilNextBlockOpts, errAssertionOpt) + runOpts := integration.RunUntilNextBlockOpts.Append(errAssertionOpt) execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - anyRes := s.app.RunMsg(s.T(), &execMsg, runOpts...) + anyRes := s.GetApp().RunMsg(s.T(), &execMsg, runOpts...) require.Nil(s.T(), anyRes) }) } @@ -197,79 +177,3 @@ func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { func TestUpdateParamsSuite(t *testing.T) { suite.Run(t, &UpdateParamsSuite{}) } - -func (s *UpdateParamsSuite) sendAuthzGrantMsgForPoktrollModules( - granterAddr, granteeAddr cosmostypes.AccAddress, - msgName string, - moduleNames ...string, -) { - var runOpts []integration.RunOption - for moduleIdx, moduleName := range moduleNames { - // Commit and finalize the block after the last module's grant. - if moduleIdx == len(moduleNames)-1 { - runOpts = append(runOpts, runUntilNextBlockOpts...) - } - - msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) - authorization := &authz.GenericAuthorization{Msg: msgType} - s.runAuthzGrantMsg(granterAddr, granteeAddr, authorization, runOpts...) - } - - authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) - grantsQueryRes, err := authzQueryClient.GranteeGrants(s.app.GetSdkCtx(), &authz.QueryGranteeGrantsRequest{ - Grantee: granteeAddr.String(), - }) - require.NoError(s.T(), err) - require.NotNil(s.T(), grantsQueryRes) - - require.Equalf(s.T(), - len(allPoktrollModuleNames), - len(grantsQueryRes.Grants), - "expected %d grants but got %d: %+v", - len(allPoktrollModuleNames), - len(grantsQueryRes.Grants), - grantsQueryRes.Grants, - ) - - foundModuleGrants := make(map[string]int) - for _, grant := range grantsQueryRes.GetGrants() { - require.Equal(s.T(), granterAddr.String(), grant.Granter) - require.Equal(s.T(), granteeAddr.String(), grant.Grantee) - - for _, moduleName := range allPoktrollModuleNames { - if strings.Contains(grant.Authorization.GetTypeUrl(), moduleName) { - foundModuleGrants[moduleName]++ - } - } - } - - for _, foundTimes := range foundModuleGrants { - require.Equal(s.T(), 1, foundTimes) - } -} - -func (s *UpdateParamsSuite) runAuthzGrantMsg( - granterAddr, - granteeAddr cosmostypes.AccAddress, - authorization authz.Authorization, - runOpts ...integration.RunOption, -) { - grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &authzGrantExpiration) - require.NoError(s.T(), err) - - anyRes := s.app.RunMsg(s.T(), grantMsg, runOpts...) - require.NotNil(s.T(), anyRes) -} - -func (s *UpdateParamsSuite) runAuthzExecMsg( - fromAddr cosmostypes.AccAddress, - msgs ...cosmostypes.Msg, -) { - execMsg := authz.NewMsgExec(fromAddr, msgs) - anyRes := s.app.RunMsg(s.T(), &execMsg, runUntilNextBlockOpts...) - require.NotNil(s.T(), anyRes) - - execRes := new(authz.MsgExecResponse) - err := s.app.GetCodec().UnpackAny(anyRes, &execRes) - require.NoError(s.T(), err) -} diff --git a/testutil/integration/options.go b/testutil/integration/options.go index 5d7b14074..99fd38377 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -1,5 +1,12 @@ package integration +var ( + RunUntilNextBlockOpts = RunOptions{ + WithAutomaticCommit(), + WithAutomaticFinalizeBlock(), + } +) + // RunConfig is the configuration for the testing integration app. type RunConfig struct { AutomaticFinalizeBlock bool @@ -10,6 +17,14 @@ type RunConfig struct { // RunOption is a function that can be used to configure the integration app. type RunOption func(*RunConfig) +// TODO_IN_THIS_COMMIT: godoc +type RunOptions []RunOption + +// TODO_IN_THIS_COMMIT: godoc +func (runOpts RunOptions) Append(newRunOpts ...RunOption) RunOptions { + return append(runOpts, newRunOpts...) +} + // WithAutomaticFinalizeBlock calls ABCI finalize block. func WithAutomaticFinalizeBlock() RunOption { return func(cfg *RunConfig) { diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go new file mode 100644 index 000000000..ca5f07808 --- /dev/null +++ b/testutil/integration/suites/authz.go @@ -0,0 +1,109 @@ +//go:build integration + +package suites + +import ( + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/integration" +) + +const ( + // poktrollMsgTypeFormat is the format for a poktroll module's message type. + // The first %s is the module name, and the second %s is the message name. + poktrollMsgTypeFormat = "/poktroll.%s.%s" +) + +var ( + defaultAuthzGrantExpiration = time.Now().Add(time.Hour) +) + +// TODO_IN_THIS_COMMIT: move... +type AuthzIntegrationSuite struct { + BaseIntegrationSuite +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( + granterAddr, granteeAddr types.AccAddress, + msgName string, + moduleNames ...string, +) { + var runOpts []integration.RunOption + for moduleIdx, moduleName := range moduleNames { + // Commit and finalize the block after the last module's grant. + if moduleIdx == len(moduleNames)-1 { + runOpts = append(runOpts, integration.RunUntilNextBlockOpts...) + } + + msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) + authorization := &authz.GenericAuthorization{Msg: msgType} + s.RunAuthzGrantMsg(granterAddr, granteeAddr, authorization, runOpts...) + } + + authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) + grantsQueryRes, err := authzQueryClient.GranteeGrants(s.app.GetSdkCtx(), &authz.QueryGranteeGrantsRequest{ + Grantee: granteeAddr.String(), + }) + require.NoError(s.T(), err) + require.NotNil(s.T(), grantsQueryRes) + + require.Equalf(s.T(), + len(allPoktrollModuleNames), + len(grantsQueryRes.Grants), + "expected %d grants but got %d: %+v", + len(allPoktrollModuleNames), + len(grantsQueryRes.Grants), + grantsQueryRes.Grants, + ) + + foundModuleGrants := make(map[string]int) + for _, grant := range grantsQueryRes.GetGrants() { + require.Equal(s.T(), granterAddr.String(), grant.Granter) + require.Equal(s.T(), granteeAddr.String(), grant.Grantee) + + for _, moduleName := range allPoktrollModuleNames { + if strings.Contains(grant.Authorization.GetTypeUrl(), moduleName) { + foundModuleGrants[moduleName]++ + } + } + } + + for _, foundTimes := range foundModuleGrants { + require.Equal(s.T(), 1, foundTimes) + } +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( + granterAddr, + granteeAddr types.AccAddress, + authorization authz.Authorization, + runOpts ...integration.RunOption, +) { + grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &defaultAuthzGrantExpiration) + require.NoError(s.T(), err) + + anyRes := s.app.RunMsg(s.T(), grantMsg, runOpts...) + require.NotNil(s.T(), anyRes) +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *AuthzIntegrationSuite) RunAuthzExecMsg( + fromAddr types.AccAddress, + msgs ...types.Msg, +) { + execMsg := authz.NewMsgExec(fromAddr, msgs) + anyRes := s.GetApp().RunMsg(s.T(), &execMsg, integration.RunUntilNextBlockOpts...) + require.NotNil(s.T(), anyRes) + + execRes := new(authz.MsgExecResponse) + err := s.GetApp().GetCodec().UnpackAny(anyRes, &execRes) + require.NoError(s.T(), err) +} diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go new file mode 100644 index 000000000..d8f02d1d9 --- /dev/null +++ b/testutil/integration/suites/base.go @@ -0,0 +1,50 @@ +//go:build integration + +package suites + +import ( + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/testutil/integration" + apptypes "github.com/pokt-network/poktroll/x/application/types" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" +) + +var _ IntegrationSuite = (*BaseIntegrationSuite)(nil) + +// TODO_IN_THIS_COMMIT: godoc +type BaseIntegrationSuite struct { + suite.Suite + app *integration.App +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *BaseIntegrationSuite) GetApp() *integration.App { + // Construct and assign a new app on first call. + if s.app == nil { + s.app = integration.NewCompleteIntegrationApp(s.T()) + } + return s.app +} + +func (s *BaseIntegrationSuite) GetModuleNames() []string { + return allPoktrollModuleNames +} + +// TODO_IMPROVE: Ideally this list should be populated during integration app construction. +var allPoktrollModuleNames = []string{ + sharedtypes.ModuleName, + sessiontypes.ModuleName, + servicetypes.ModuleName, + apptypes.ModuleName, + gatewaytypes.ModuleName, + suppliertypes.ModuleName, + prooftypes.ModuleName, + tokenomicstypes.ModuleName, +} diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go new file mode 100644 index 000000000..f5ece5a89 --- /dev/null +++ b/testutil/integration/suites/interface.go @@ -0,0 +1,11 @@ +//go:build integration + +package suites + +import "github.com/pokt-network/poktroll/testutil/integration" + +// TODO_IN_THIS_COMMIT: godoc +type IntegrationSuite interface { + GetApp() *integration.App + GetModuleNames() []string +} From 8c94aecb5c6fcf7b63c1bb5ec3b367ec9fd9653d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Sat, 14 Sep 2024 01:11:14 +0200 Subject: [PATCH 18/77] wip: refactor: MsgUpdateParam E2E suite as integration suite --- e2e/tests/stake_supplier_steps_test.go | 25 +- tests/integration/params/update_param_test.go | 178 ++++++++++++ .../integration/params/update_params_test.go | 186 ++++--------- testutil/cases/cases.go | 26 ++ testutil/integration/app.go | 6 + testutil/integration/suites/authz.go | 72 ++--- testutil/integration/suites/base.go | 17 +- testutil/integration/suites/interface.go | 9 +- testutil/integration/suites/update_params.go | 257 ++++++++++++++++++ 9 files changed, 586 insertions(+), 190 deletions(-) create mode 100644 testutil/cases/cases.go create mode 100644 testutil/integration/suites/update_params.go diff --git a/e2e/tests/stake_supplier_steps_test.go b/e2e/tests/stake_supplier_steps_test.go index 75caa3652..9721b315c 100644 --- a/e2e/tests/stake_supplier_steps_test.go +++ b/e2e/tests/stake_supplier_steps_test.go @@ -4,11 +4,10 @@ package e2e import ( "reflect" - "strings" - "unicode" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/cases" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -61,7 +60,7 @@ func paramsAnyMapFromParamsStruct(paramStruct any) paramsAnyMap { for i := 0; i < paramsReflectValue.NumField(); i++ { fieldValue := paramsReflectValue.Field(i) fieldStruct := paramsReflectValue.Type().Field(i) - paramName := toSnakeCase(fieldStruct.Name) + paramName := cases.ToSnakeCase(fieldStruct.Name) fieldTypeName := fieldStruct.Type.Name() if fieldTypeName == "uint64" { @@ -77,23 +76,3 @@ func paramsAnyMapFromParamsStruct(paramStruct any) paramsAnyMap { } return paramsMap } - -func toSnakeCase(str string) string { - var result strings.Builder - - for i, runeValue := range str { - if unicode.IsUpper(runeValue) { - // If it's not the first letter, add an underscore - if i > 0 { - result.WriteRune('_') - } - // Convert to lowercase - result.WriteRune(unicode.ToLower(runeValue)) - } else { - // Otherwise, just append the rune as-is - result.WriteRune(runeValue) - } - } - - return result.String() -} diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index cbd83ba47..cb9093e41 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -1 +1,179 @@ package params + +import ( + "fmt" + "reflect" + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/testutil/cases" + "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/integration/suites" +) + +type MsgUpdateParamSuite struct { + suites.UpdateParamsSuite +} + +func (s *MsgUpdateParamSuite) SetupTest() { + // Call the SetupTest() of the inherited UpdateParamsSuite. + s.UpdateParamsSuite.SetupTest() + + // Allocate an address for unauthorized user. + nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() + require.True(s.T(), ok, "insufficient pre-generated accounts available") + unauthorizedAddr = nextAcct.Address +} + +func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { + for _, moduleName := range s.GetModuleNames() { + // TODO_IN_THIS_COMMIT: improve comment... + // iterate over each field in the current module's MsgUpdateParam... + // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... + defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) + for fieldIdx := defaultParamsValue.NumField(); fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { + fieldValue := defaultParamsValue.Field(fieldIdx) + fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() + fieldName := defaultParamsValue.Type().Field(fieldIdx).Name + + testName := fmt.Sprintf("%s_%s", moduleName, fieldName) + s.T().Run(testName, func(t *testing.T) { + // Assert that the module's params are set to their default values. + s.RequireModuleHasDefaultParams(t, moduleName) + + msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] + require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + + msgValue := reflect.ValueOf(msgIface) + msgType := msgValue.Type() + + // Copy the message and set the authority field. + msgValueCopy := reflect.New(msgType) + msgValueCopy.Elem().Set(msgValue) + msgValueCopy.Elem(). + FieldByName("Authority"). + SetString(suites.AuthorityAddr.String()) + + msgValueCopy.Elem().FieldByName("Name").SetString(fieldType) + + msgValueField := msgValueCopy.Elem().FieldByName(fieldName) + switch fieldType { + case "string": + msgValueField.SetString(fieldValue.String()) + case "uint64": + msgValueField.SetUint(fieldValue.Uint()) + msgValueCopy.Elem().FieldByName("Name").SetString("int64") + case "float64": + msgValueField.SetFloat(fieldValue.Float()) + } + + msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) + + // Set up assertion that the MsgExec will fail. + errAssertionOpt := integration.WithErrorAssertion( + func(err error) { + require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) + }, + ) + + // Send an authz MsgExec from an unauthorized address. + runOpts := integration.RunUntilNextBlockOpts.Append(errAssertionOpt) + execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) + anyRes := s.GetApp(t).RunMsg(t, &execMsg, runOpts...) + require.Nil(t, anyRes) + }) + } + } +} + +func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { + for _, moduleName := range s.GetModuleNames() { + // TODO_IN_THIS_COMMIT: improve comment... + // iterate over each field in the current module's MsgUpdateParam... + // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... + defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) + for fieldIdx := 0; fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { + fieldValue := defaultParamsValue.Field(fieldIdx) + fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() + fieldName := defaultParamsValue.Type().Field(fieldIdx).Name + + testName := fmt.Sprintf("%s_%s", moduleName, fieldName) + s.T().Run(testName, func(t *testing.T) { + // Reset the app state in order to assert that each module + // param is updated correctly. + s.SetupTest() + + // Assert that the module's params are set to their default values. + s.RequireModuleHasDefaultParams(t, moduleName) + + msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] + require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + + msgValue := reflect.ValueOf(msgIface) + msgType := msgValue.Type() + + // Copy the message and set the authority field. + msgValueCopy := reflect.New(msgType) + msgValueCopy.Elem().Set(msgValue) + msgValueCopy.Elem(). + FieldByName("Authority"). + SetString(suites.AuthorityAddr.String()) + + msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(fieldName)) + // TODO_IN_THIS_COMMIT: merge expected param value with defaults... + //expectedParamsValue := msgValueCopy.Elem().FieldByName("Params") + + msgAsTypeStruct := suites.MsgUpdateParamTypesByModuleName[moduleName][fieldType] + msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) + msgAsTypeValue := reflect.New(msgAsTypeType) + switch fieldType { + case "uint64": + msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(fieldValue.Interface().(uint64))) + case "int64": + msgAsTypeValue.Elem().FieldByName("AsInt64").Set(fieldValue) + case "float64": + msgAsTypeValue.Elem().FieldByName("AsFloat64").Set(fieldValue) + case "string": + msgAsTypeValue.Elem().FieldByName("AsString").Set(fieldValue) + case "[]byte": + msgAsTypeValue.Elem().FieldByName("AsBytes").Set(fieldValue) + // TODO_IN_THIS_COMMIT: check type name... + case "coin": + msgAsTypeValue.Elem().FieldByName("AsCoin").Set(fieldValue) + default: + t.Logf(">>> unknown field type %q", fieldType) + } + + msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) + + msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) + + // Send an authz MsgExec from an unauthorized address. + execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) + anyRes := s.GetApp(t).RunMsg(t, &execMsg, integration.RunUntilNextBlockOpts...) + require.NotNil(t, anyRes) + + // Query for the module's params. + params, err := s.QueryModuleParams(t, moduleName) + require.NoError(t, err) + + // Assert that the module's params are updated. + // TODO_IN_THIS_COMMIT: update... + _ = params + //require.True(t, + // reflect.DeepEqual(params, expectedParamValue.Interface()), + // "expected:\n%+v\nto deeply equal:\n%+v", + // params, suites.ValidSharedParams, + //) + }) + } + } +} + +func TestUpdateParamSuite(t *testing.T) { + suite.Run(t, new(MsgUpdateParamSuite)) +} diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index d87fe6674..320ee93fc 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -6,158 +6,49 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/integration/suites" - apptypes "github.com/pokt-network/poktroll/x/application/types" - gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" - prooftypes "github.com/pokt-network/poktroll/x/proof/types" - servicetypes "github.com/pokt-network/poktroll/x/service/types" - sessiontypes "github.com/pokt-network/poktroll/x/session/types" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -const ( - msgUpdateParamsName = "MsgUpdateParams" - msgUpdateParamName = "MsgUpdateParam" -) - -var ( - authorityAddr, - authorizedAddr, - unauthorizedAddr cosmostypes.AccAddress - - validSharedParams = sharedtypes.Params{ - NumBlocksPerSession: 5, - GracePeriodEndOffsetBlocks: 2, - ClaimWindowOpenOffsetBlocks: 5, - ClaimWindowCloseOffsetBlocks: 5, - ProofWindowOpenOffsetBlocks: 2, - ProofWindowCloseOffsetBlocks: 5, - SupplierUnbondingPeriodSessions: 9, - ApplicationUnbondingPeriodSessions: 9, - } - - validSessionParams = sessiontypes.Params{} - - validServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 42000000000) - validServiceParams = servicetypes.Params{ - AddServiceFee: &validServiceFeeCoin, - } +var unauthorizedAddr cosmostypes.AccAddress - validApplicationParams = apptypes.Params{ - MaxDelegatedGateways: 10, - } - - validGatewayParams = gatewaytypes.Params{} - validSupplierParams = suppliertypes.Params{} - - validMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 4200) - validSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 42000000) - validProofParams = prooftypes.Params{ - RelayDifficultyTargetHash: prooftypes.DefaultRelayDifficultyTargetHash, - ProofRequestProbability: 1, - ProofRequirementThreshold: 0, - ProofMissingPenalty: &validMissingPenaltyCoin, - ProofSubmissionFee: &validSubmissionFeeCoin, - } - - validTokenomicsParams = tokenomicstypes.Params{ - ComputeUnitsToTokensMultiplier: 5, - } - - // NB: Authority fields are intentionally omitted. - // To be added to a **copy** by the test. - msgUpdateParamsByModule = map[string]cosmostypes.Msg{ - sharedtypes.ModuleName: &sharedtypes.MsgUpdateParams{ - Params: validSharedParams, - }, - sessiontypes.ModuleName: &sessiontypes.MsgUpdateParams{ - Params: validSessionParams, - }, - servicetypes.ModuleName: &servicetypes.MsgUpdateParams{ - Params: validServiceParams, - }, - apptypes.ModuleName: &apptypes.MsgUpdateParams{ - Params: validApplicationParams, - }, - gatewaytypes.ModuleName: &gatewaytypes.MsgUpdateParams{ - Params: validGatewayParams, - }, - suppliertypes.ModuleName: &suppliertypes.MsgUpdateParams{ - Params: validSupplierParams, - }, - prooftypes.ModuleName: &prooftypes.MsgUpdateParams{ - Params: validProofParams, - }, - tokenomicstypes.ModuleName: &tokenomicstypes.MsgUpdateParams{ - Params: validTokenomicsParams, - }, - } - - _ suites.IntegrationSuite = (*UpdateParamsSuite)(nil) -) - -type UpdateParamsSuite struct { - suites.AuthzIntegrationSuite +type MsgUpdateParamsSuite struct { + suites.UpdateParamsSuite } -// SetupTest runs before each test in the suite. -func (s *UpdateParamsSuite) SetupTest() { - // Construct a fresh integration app for each test. - // Set the authority, authorized, and unauthorized addresses. - authorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) +func (s *MsgUpdateParamsSuite) SetupTest() { + // Call the SetupTest() of the inherited UpdateParamsSuite. + s.UpdateParamsSuite.SetupTest() - nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() - require.True(s.T(), ok, "insufficient pre-generated accounts available") - authorizedAddr = nextAcct.Address - - nextAcct, ok = s.GetApp().GetPreGeneratedAccounts().Next() + // Allocate an address for unauthorized user. + nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") unauthorizedAddr = nextAcct.Address - - // Create authz grants for all poktroll modules' MsgUpdateParams messages. - s.SendAuthzGrantMsgForPoktrollModules( - authorityAddr, - authorizedAddr, - msgUpdateParamsName, - s.GetModuleNames()..., - ) } -func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { +func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { for _, moduleName := range s.GetModuleNames() { s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. - // TODO_IN_THIS_COMMIT: consider whether/how to do this. Seems - // to require a query client instance for each module. + s.RequireModuleHasDefaultParams(t, moduleName) - //msgStruct, isMsgTypeFound := msgUpdateParamsByModule[moduleName] - msgIface, isMsgTypeFound := msgUpdateParamsByModule[moduleName] - require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + msgIface, isMsgTypeFound := suites.MsgUpdateParamsByModule[moduleName] + require.Truef(t, isMsgTypeFound, "unknown message type for module %q", moduleName) msgValue := reflect.ValueOf(msgIface) - msgType := msgValue.Elem().Type() + msgType := msgValue.Type() // Copy the message and set the authority field. msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue.Elem()) + msgValueCopy.Elem().Set(msgValue) msgValueCopy.Elem(). FieldByName("Authority"). - SetString(authorityAddr.String()) - + SetString(suites.AuthorityAddr.String()) msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) - msgTypeName := proto.MessageName(msgUpdateParams) - s.T().Logf("msgType: %s", msgType.Name()) - s.T().Logf("msgTypeName: %s", msgTypeName) - // Set up assertion that the MsgExec will fail. errAssertionOpt := integration.WithErrorAssertion( func(err error) { @@ -168,12 +59,53 @@ func (s *UpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { // Send an authz MsgExec from an unauthorized address. runOpts := integration.RunUntilNextBlockOpts.Append(errAssertionOpt) execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - anyRes := s.GetApp().RunMsg(s.T(), &execMsg, runOpts...) - require.Nil(s.T(), anyRes) + anyRes := s.GetApp(t).RunMsg(t, &execMsg, runOpts...) + require.Nil(t, anyRes) + }) + } +} + +func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { + for _, moduleName := range s.GetModuleNames() { + s.T().Run(moduleName, func(t *testing.T) { + // Assert that the module's params are set to their default values. + s.RequireModuleHasDefaultParams(t, moduleName) + + msgIface, isMsgTypeFound := suites.MsgUpdateParamsByModule[moduleName] + require.Truef(t, isMsgTypeFound, "unknown message type for module %q", moduleName) + + msgValue := reflect.ValueOf(msgIface) + msgType := msgValue.Type() + + // Copy the message and set the authority field. + msgValueCopy := reflect.New(msgType) + msgValueCopy.Elem().Set(msgValue) + msgValueCopy.Elem(). + FieldByName("Authority"). + SetString(suites.AuthorityAddr.String()) + expectedParamsValue := msgValueCopy.Elem().FieldByName("Params") + + msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) + + // Send an authz MsgExec from an unauthorized address. + execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) + anyRes := s.GetApp(t).RunMsg(t, &execMsg, integration.RunUntilNextBlockOpts...) + require.NotNil(t, anyRes) + + // Query for the module's params. + params, err := s.QueryModuleParams(t, moduleName) + require.NoError(t, err) + + // Assert that the module's params are updated. + require.True(t, + reflect.DeepEqual(params, expectedParamsValue.Interface()), + "expected:\n%+v\nto deeply equal:\n%+v", + params, suites.ValidSharedParams, + ) }) } } func TestUpdateParamsSuite(t *testing.T) { - suite.Run(t, &UpdateParamsSuite{}) + suite.Run(t, &MsgUpdateParamsSuite{}) } diff --git a/testutil/cases/cases.go b/testutil/cases/cases.go new file mode 100644 index 000000000..d49adea14 --- /dev/null +++ b/testutil/cases/cases.go @@ -0,0 +1,26 @@ +package cases + +import ( + "strings" + "unicode" +) + +func ToSnakeCase(str string) string { + var result strings.Builder + + for i, runeValue := range str { + if unicode.IsUpper(runeValue) { + // If it's not the first letter, add an underscore + if i > 0 { + result.WriteRune('_') + } + // Convert to lowercase + result.WriteRune(unicode.ToLower(runeValue)) + } else { + // Otherwise, just append the rune as-is + result.WriteRune(runeValue) + } + } + + return result.String() +} diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 18b3d8918..976d7e129 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -560,6 +560,12 @@ func NewCompleteIntegrationApp(t *testing.T) *App { require.NoError(t, err) err = applicationKeeper.SetParams(integrationApp.GetSdkCtx(), apptypes.DefaultParams()) require.NoError(t, err) + err = supplierKeeper.SetParams(integrationApp.GetSdkCtx(), suppliertypes.DefaultParams()) + require.NoError(t, err) + err = serviceKeeper.SetParams(integrationApp.GetSdkCtx(), servicetypes.DefaultParams()) + require.NoError(t, err) + err = gatewayKeeper.SetParams(integrationApp.GetSdkCtx(), gatewaytypes.DefaultParams()) + require.NoError(t, err) // Need to go to the next block to finalize the genesis and setup. // This has to be after the params are set, as the params are stored in the diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index ca5f07808..5dfc18dd5 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -4,7 +4,7 @@ package suites import ( "fmt" - "strings" + "testing" "time" "github.com/cosmos/cosmos-sdk/types" @@ -31,11 +31,17 @@ type AuthzIntegrationSuite struct { // TODO_IN_THIS_COMMIT: godoc func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( + t *testing.T, granterAddr, granteeAddr types.AccAddress, msgName string, moduleNames ...string, ) { - var runOpts []integration.RunOption + t.Helper() + + var ( + runOpts []integration.RunOption + foundModuleGrants = make(map[string]int) + ) for moduleIdx, moduleName := range moduleNames { // Commit and finalize the block after the last module's grant. if moduleIdx == len(moduleNames)-1 { @@ -44,66 +50,60 @@ func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) authorization := &authz.GenericAuthorization{Msg: msgType} - s.RunAuthzGrantMsg(granterAddr, granteeAddr, authorization, runOpts...) - } - - authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) - grantsQueryRes, err := authzQueryClient.GranteeGrants(s.app.GetSdkCtx(), &authz.QueryGranteeGrantsRequest{ - Grantee: granteeAddr.String(), - }) - require.NoError(s.T(), err) - require.NotNil(s.T(), grantsQueryRes) - - require.Equalf(s.T(), - len(allPoktrollModuleNames), - len(grantsQueryRes.Grants), - "expected %d grants but got %d: %+v", - len(allPoktrollModuleNames), - len(grantsQueryRes.Grants), - grantsQueryRes.Grants, - ) - - foundModuleGrants := make(map[string]int) - for _, grant := range grantsQueryRes.GetGrants() { - require.Equal(s.T(), granterAddr.String(), grant.Granter) - require.Equal(s.T(), granteeAddr.String(), grant.Grantee) + s.RunAuthzGrantMsg(t, granterAddr, granteeAddr, authorization, runOpts...) + + // Query for the created grant to assert that they were created. + authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) + queryGrantsReq := &authz.QueryGrantsRequest{ + Granter: granterAddr.String(), + Grantee: granteeAddr.String(), + MsgTypeUrl: msgType, + } + queryGrantsRes, err := authzQueryClient.Grants(s.app.GetSdkCtx(), queryGrantsReq) + require.NoError(t, err) + require.NotNil(t, queryGrantsRes) - for _, moduleName := range allPoktrollModuleNames { - if strings.Contains(grant.Authorization.GetTypeUrl(), moduleName) { - foundModuleGrants[moduleName]++ - } + for range queryGrantsRes.GetGrants() { + foundModuleGrants[moduleName]++ } } + // Assert that only one grant was created for each module. for _, foundTimes := range foundModuleGrants { - require.Equal(s.T(), 1, foundTimes) + require.Equal(t, 1, foundTimes) } } // TODO_IN_THIS_COMMIT: godoc func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( + t *testing.T, granterAddr, granteeAddr types.AccAddress, authorization authz.Authorization, runOpts ...integration.RunOption, ) { + t.Helper() + grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &defaultAuthzGrantExpiration) - require.NoError(s.T(), err) + require.NoError(t, err) anyRes := s.app.RunMsg(s.T(), grantMsg, runOpts...) - require.NotNil(s.T(), anyRes) + require.NotNil(t, anyRes) } // TODO_IN_THIS_COMMIT: godoc func (s *AuthzIntegrationSuite) RunAuthzExecMsg( + t *testing.T, fromAddr types.AccAddress, msgs ...types.Msg, ) { + t.Helper() + execMsg := authz.NewMsgExec(fromAddr, msgs) - anyRes := s.GetApp().RunMsg(s.T(), &execMsg, integration.RunUntilNextBlockOpts...) - require.NotNil(s.T(), anyRes) + anyRes := s.GetApp(t).RunMsg(s.T(), &execMsg, integration.RunUntilNextBlockOpts...) + require.NotNil(t, anyRes) execRes := new(authz.MsgExecResponse) - err := s.GetApp().GetCodec().UnpackAny(anyRes, &execRes) - require.NoError(s.T(), err) + err := s.GetApp(t).GetCodec().UnpackAny(anyRes, &execRes) + require.NoError(t, err) } diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index d8f02d1d9..9fc9321d0 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -3,6 +3,8 @@ package suites import ( + "testing" + "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/testutil/integration" @@ -25,14 +27,25 @@ type BaseIntegrationSuite struct { } // TODO_IN_THIS_COMMIT: godoc -func (s *BaseIntegrationSuite) GetApp() *integration.App { +func (s *BaseIntegrationSuite) NewApp(t *testing.T) *integration.App { + t.Helper() + + s.app = integration.NewCompleteIntegrationApp(t) + return s.app +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *BaseIntegrationSuite) GetApp(t *testing.T) *integration.App { + t.Helper() + // Construct and assign a new app on first call. if s.app == nil { - s.app = integration.NewCompleteIntegrationApp(s.T()) + return s.NewApp(t) } return s.app } +// TODO_IN_THIS_COMMIT: godoc func (s *BaseIntegrationSuite) GetModuleNames() []string { return allPoktrollModuleNames } diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index f5ece5a89..6724bd1f6 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -2,10 +2,15 @@ package suites -import "github.com/pokt-network/poktroll/testutil/integration" +import ( + "testing" + + "github.com/pokt-network/poktroll/testutil/integration" +) // TODO_IN_THIS_COMMIT: godoc type IntegrationSuite interface { - GetApp() *integration.App + NewApp(t *testing.T) *integration.App + GetApp(t *testing.T) *integration.App GetModuleNames() []string } diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go new file mode 100644 index 000000000..ea6fdc10f --- /dev/null +++ b/testutil/integration/suites/update_params.go @@ -0,0 +1,257 @@ +package suites + +import ( + "encoding/hex" + "reflect" + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + apptypes "github.com/pokt-network/poktroll/x/application/types" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" +) + +const ( + MsgUpdateParamsName = "MsgUpdateParams" + MsgUpdateParamName = "MsgUpdateParam" +) + +var ( + AuthorityAddr cosmostypes.AccAddress + + AuthorizedAddr cosmostypes.AccAddress + + ValidSharedParams = sharedtypes.Params{ + NumBlocksPerSession: 5, + GracePeriodEndOffsetBlocks: 2, + ClaimWindowOpenOffsetBlocks: 5, + ClaimWindowCloseOffsetBlocks: 5, + ProofWindowOpenOffsetBlocks: 2, + ProofWindowCloseOffsetBlocks: 5, + SupplierUnbondingPeriodSessions: 9, + ApplicationUnbondingPeriodSessions: 9, + } + + ValidSessionParams = sessiontypes.Params{} + + ValidServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000001) + ValidServiceParams = servicetypes.Params{ + AddServiceFee: &ValidServiceFeeCoin, + } + + ValidApplicationParams = apptypes.Params{ + MaxDelegatedGateways: 999, + } + + ValidGatewayParams = gatewaytypes.Params{} + + ValidSupplierParams = suppliertypes.Params{} + + ValidMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) + ValidSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) + ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") + + ValidProofParams = prooftypes.Params{ + RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, + ProofRequestProbability: 0.1, + ProofRequirementThreshold: 100, + ProofMissingPenalty: &ValidMissingPenaltyCoin, + ProofSubmissionFee: &ValidSubmissionFeeCoin, + } + + ValidTokenomicsParams = tokenomicstypes.Params{ + ComputeUnitsToTokensMultiplier: 420, + } + + // TODO_IN_THIS_COMMIT: godoc... + // NB: Authority fields are intentionally omitted and expected to be added + // to a **copy** of the respective message by the test. + MsgUpdateParamsByModule = map[string]any{ + sharedtypes.ModuleName: sharedtypes.MsgUpdateParams{ + Params: ValidSharedParams, + }, + sessiontypes.ModuleName: sessiontypes.MsgUpdateParams{ + Params: ValidSessionParams, + }, + servicetypes.ModuleName: servicetypes.MsgUpdateParams{ + Params: ValidServiceParams, + }, + apptypes.ModuleName: apptypes.MsgUpdateParams{ + Params: ValidApplicationParams, + }, + gatewaytypes.ModuleName: gatewaytypes.MsgUpdateParams{ + Params: ValidGatewayParams, + }, + suppliertypes.ModuleName: suppliertypes.MsgUpdateParams{ + Params: ValidSupplierParams, + }, + prooftypes.ModuleName: prooftypes.MsgUpdateParams{ + Params: ValidProofParams, + }, + tokenomicstypes.ModuleName: tokenomicstypes.MsgUpdateParams{ + Params: ValidTokenomicsParams, + }, + } + + MsgUpdateParamByModule = map[string]any{ + sharedtypes.ModuleName: sharedtypes.MsgUpdateParam{}, + servicetypes.ModuleName: servicetypes.MsgUpdateParam{}, + prooftypes.ModuleName: prooftypes.MsgUpdateParam{}, + tokenomicstypes.ModuleName: tokenomicstypes.MsgUpdateParam{}, + //sessiontypes.ModuleName: sessiontypes.MsgUpdateParam{}, + //apptypes.ModuleName: apptypes.MsgUpdateParam{}, + //gatewaytypes.ModuleName: gatewaytypes.MsgUpdateParam{}, + //suppliertypes.ModuleName: suppliertypes.MsgUpdateParam{}, + } + + MsgUpdateParamTypesByModuleName = map[string]map[string]any{ + sharedtypes.ModuleName: { + "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, + "int64": sharedtypes.MsgUpdateParam_AsInt64{}, + "string": sharedtypes.MsgUpdateParam_AsString{}, + "[]byte": sharedtypes.MsgUpdateParam_AsBytes{}, + }, + servicetypes.ModuleName: { + // TODO_IN_THIS_COMMIT: check type name... + "coin": servicetypes.MsgUpdateParam_AsCoin{}, + }, + prooftypes.ModuleName: { + "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, + "int64": prooftypes.MsgUpdateParam_AsInt64{}, + "string": prooftypes.MsgUpdateParam_AsString{}, + "[]byte": prooftypes.MsgUpdateParam_AsBytes{}, + "float64": prooftypes.MsgUpdateParam_AsFloat{}, + // TODO_IN_THIS_COMMIT: check type name... + "coin": prooftypes.MsgUpdateParam_AsCoin{}, + }, + tokenomicstypes.ModuleName: { + "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, + "int64": tokenomicstypes.MsgUpdateParam_AsInt64{}, + "string": tokenomicstypes.MsgUpdateParam_AsString{}, + "[]byte": tokenomicstypes.MsgUpdateParam_AsBytes{}, + }, + } + + NewParamClientFns = map[string]any{ + sharedtypes.ModuleName: sharedtypes.NewQueryClient, + sessiontypes.ModuleName: sessiontypes.NewQueryClient, + servicetypes.ModuleName: servicetypes.NewQueryClient, + apptypes.ModuleName: apptypes.NewQueryClient, + gatewaytypes.ModuleName: gatewaytypes.NewQueryClient, + suppliertypes.ModuleName: suppliertypes.NewQueryClient, + prooftypes.ModuleName: prooftypes.NewQueryClient, + tokenomicstypes.ModuleName: tokenomicstypes.NewQueryClient, + } + + QueryParamsRequestByModule = map[string]any{ + sharedtypes.ModuleName: sharedtypes.QueryParamsRequest{}, + sessiontypes.ModuleName: sessiontypes.QueryParamsRequest{}, + servicetypes.ModuleName: servicetypes.QueryParamsRequest{}, + apptypes.ModuleName: apptypes.QueryParamsRequest{}, + gatewaytypes.ModuleName: gatewaytypes.QueryParamsRequest{}, + suppliertypes.ModuleName: suppliertypes.QueryParamsRequest{}, + prooftypes.ModuleName: prooftypes.QueryParamsRequest{}, + tokenomicstypes.ModuleName: tokenomicstypes.QueryParamsRequest{}, + } + + DefaultParamsByModule = map[string]any{ + sharedtypes.ModuleName: sharedtypes.DefaultParams(), + sessiontypes.ModuleName: sessiontypes.DefaultParams(), + servicetypes.ModuleName: servicetypes.DefaultParams(), + apptypes.ModuleName: apptypes.DefaultParams(), + gatewaytypes.ModuleName: gatewaytypes.DefaultParams(), + suppliertypes.ModuleName: suppliertypes.DefaultParams(), + prooftypes.ModuleName: prooftypes.DefaultParams(), + tokenomicstypes.ModuleName: tokenomicstypes.DefaultParams(), + } + + _ IntegrationSuite = (*UpdateParamsSuite)(nil) +) + +type UpdateParamsSuite struct { + AuthzIntegrationSuite +} + +// SetupTest runs before each test in the suite. +func (s *UpdateParamsSuite) SetupTest() { + // Construct a fresh integration app for each test. + s.NewApp(s.T()) + + // Set the authority, authorized, and unauthorized addresses. + AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp(s.T()).GetAuthority()) + + nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() + require.True(s.T(), ok, "insufficient pre-generated accounts available") + AuthorizedAddr = nextAcct.Address + + // Create authz grants for all poktroll modules' MsgUpdateParams messages. + s.SendAuthzGrantMsgForPoktrollModules(s.T(), + AuthorityAddr, + AuthorizedAddr, + MsgUpdateParamsName, + s.GetModuleNames()..., + ) + + var msgUpdateParamEnabledModuleNames []string + for moduleName := range MsgUpdateParamByModule { + msgUpdateParamEnabledModuleNames = append(msgUpdateParamEnabledModuleNames, moduleName) + } + + // Create authz grants for all poktroll modules' MsgUpdateParam messages. + s.SendAuthzGrantMsgForPoktrollModules(s.T(), + AuthorityAddr, + AuthorizedAddr, + MsgUpdateParamName, + msgUpdateParamEnabledModuleNames..., + ) +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *UpdateParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleName string) { + t.Helper() + + params, err := s.QueryModuleParams(t, moduleName) + require.NoError(t, err) + + defaultParams := DefaultParamsByModule[moduleName] + require.EqualValues(t, defaultParams, params) +} + +// TODO_IN_THIS_COMMIT: godoc +func (s *UpdateParamsSuite) QueryModuleParams(t *testing.T, moduleName string) (params any, err error) { + t.Helper() + + // Construct a new param client. + newParamClientFn := reflect.ValueOf(NewParamClientFns[moduleName]) + newParamClientFnArgs := []reflect.Value{ + reflect.ValueOf(s.GetApp(t).QueryHelper()), + } + paramClient := newParamClientFn.Call(newParamClientFnArgs)[0] + + // Query for the module's params. + paramsQueryReqValue := reflect.New(reflect.TypeOf(QueryParamsRequestByModule[moduleName])) + callParamsArgs := []reflect.Value{ + reflect.ValueOf(s.GetApp(t).GetSdkCtx()), + paramsQueryReqValue, + } + callParamsReturnValues := paramClient.MethodByName("Params").Call(callParamsArgs) + paramsResParamsValue := callParamsReturnValues[0] + paramResErrValue := callParamsReturnValues[1].Interface() + + isErr := false + err, isErr = paramResErrValue.(error) + if !isErr { + require.Nil(t, callParamsReturnValues[1].Interface()) + } + + paramsValue := paramsResParamsValue.Elem().FieldByName("Params") + return paramsValue.Interface(), err +} From 2833b6cbc7682efa0d0032b053f944249f4735d7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Sat, 14 Sep 2024 01:35:25 +0200 Subject: [PATCH 19/77] wip: test: debugging --- tests/integration/params/update_param_test.go | 60 ++++++++++++------- testutil/integration/suites/update_params.go | 34 ++++++----- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index cb9093e41..ab999db1c 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -30,15 +30,18 @@ func (s *MsgUpdateParamSuite) SetupTest() { } func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { - for _, moduleName := range s.GetModuleNames() { + for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { // TODO_IN_THIS_COMMIT: improve comment... // iterate over each field in the current module's MsgUpdateParam... // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) - for fieldIdx := defaultParamsValue.NumField(); fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { + for fieldIdx := 0; fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { fieldValue := defaultParamsValue.Field(fieldIdx) - fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() fieldName := defaultParamsValue.Type().Field(fieldIdx).Name + fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() + if fieldType == "" { + fieldType = defaultParamsValue.Type().Field(fieldIdx).Type.Elem().Name() + } testName := fmt.Sprintf("%s_%s", moduleName, fieldName) s.T().Run(testName, func(t *testing.T) { @@ -46,7 +49,7 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { s.RequireModuleHasDefaultParams(t, moduleName) msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] - require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) msgValue := reflect.ValueOf(msgIface) msgType := msgValue.Type() @@ -58,19 +61,33 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { FieldByName("Authority"). SetString(suites.AuthorityAddr.String()) - msgValueCopy.Elem().FieldByName("Name").SetString(fieldType) + msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(fieldName)) - msgValueField := msgValueCopy.Elem().FieldByName(fieldName) + msgAsTypeStruct := suites.MsgUpdateParamTypesByModuleName[moduleName][fieldType] + msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) + t.Logf("fieldType: %q", fieldType) + t.Logf("msgAsTypeType: %+v", msgAsTypeType) + msgAsTypeValue := reflect.New(msgAsTypeType) switch fieldType { - case "string": - msgValueField.SetString(fieldValue.String()) case "uint64": - msgValueField.SetUint(fieldValue.Uint()) - msgValueCopy.Elem().FieldByName("Name").SetString("int64") - case "float64": - msgValueField.SetFloat(fieldValue.Float()) + msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(fieldValue.Interface().(uint64))) + case "int64": + msgAsTypeValue.Elem().FieldByName("AsInt64").Set(fieldValue) + case "float32": + msgAsTypeValue.Elem().FieldByName("AsFloat").Set(fieldValue) + case "string": + msgAsTypeValue.Elem().FieldByName("AsString").Set(fieldValue) + case "uint8": + msgAsTypeValue.Elem().FieldByName("AsBytes").Set(fieldValue) + // TODO_IN_THIS_COMMIT: check type name... + case "Coin": + msgAsTypeValue.Elem().FieldByName("AsCoin").Set(fieldValue) + default: + t.Fatalf("ERROR: unknown field type %q", fieldType) } + msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) + msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) // Set up assertion that the MsgExec will fail. @@ -91,15 +108,18 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { } func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { - for _, moduleName := range s.GetModuleNames() { + for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { // TODO_IN_THIS_COMMIT: improve comment... // iterate over each field in the current module's MsgUpdateParam... // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) for fieldIdx := 0; fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { fieldValue := defaultParamsValue.Field(fieldIdx) - fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() fieldName := defaultParamsValue.Type().Field(fieldIdx).Name + fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() + if fieldType == "" { + fieldType = defaultParamsValue.Type().Field(fieldIdx).Type.Elem().Name() + } testName := fmt.Sprintf("%s_%s", moduleName, fieldName) s.T().Run(testName, func(t *testing.T) { @@ -111,7 +131,7 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { s.RequireModuleHasDefaultParams(t, moduleName) msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] - require.Truef(s.T(), isMsgTypeFound, "unknown message type for module %q", moduleName) + require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) msgValue := reflect.ValueOf(msgIface) msgType := msgValue.Type() @@ -135,17 +155,17 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(fieldValue.Interface().(uint64))) case "int64": msgAsTypeValue.Elem().FieldByName("AsInt64").Set(fieldValue) - case "float64": - msgAsTypeValue.Elem().FieldByName("AsFloat64").Set(fieldValue) + case "float32": + msgAsTypeValue.Elem().FieldByName("AsFloat").Set(fieldValue) case "string": msgAsTypeValue.Elem().FieldByName("AsString").Set(fieldValue) - case "[]byte": + case "uint8": msgAsTypeValue.Elem().FieldByName("AsBytes").Set(fieldValue) // TODO_IN_THIS_COMMIT: check type name... - case "coin": + case "Coin": msgAsTypeValue.Elem().FieldByName("AsCoin").Set(fieldValue) default: - t.Logf(">>> unknown field type %q", fieldType) + t.Fatalf("ERROR: unknown field type %q", fieldType) } msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index ea6fdc10f..e54cfde31 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -117,29 +117,30 @@ var ( "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, "int64": sharedtypes.MsgUpdateParam_AsInt64{}, "string": sharedtypes.MsgUpdateParam_AsString{}, - "[]byte": sharedtypes.MsgUpdateParam_AsBytes{}, + "uint8": sharedtypes.MsgUpdateParam_AsBytes{}, }, servicetypes.ModuleName: { - // TODO_IN_THIS_COMMIT: check type name... - "coin": servicetypes.MsgUpdateParam_AsCoin{}, + "Coin": servicetypes.MsgUpdateParam_AsCoin{}, }, prooftypes.ModuleName: { - "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, + "uint64": prooftypes.MsgUpdateParam_AsInt64{}, "int64": prooftypes.MsgUpdateParam_AsInt64{}, "string": prooftypes.MsgUpdateParam_AsString{}, - "[]byte": prooftypes.MsgUpdateParam_AsBytes{}, - "float64": prooftypes.MsgUpdateParam_AsFloat{}, - // TODO_IN_THIS_COMMIT: check type name... - "coin": prooftypes.MsgUpdateParam_AsCoin{}, + "uint8": prooftypes.MsgUpdateParam_AsBytes{}, + "float32": prooftypes.MsgUpdateParam_AsFloat{}, + //"float64": prooftypes.MsgUpdateParam_AsFloat{}, + "Coin": prooftypes.MsgUpdateParam_AsCoin{}, }, tokenomicstypes.ModuleName: { - "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, + "uint64": tokenomicstypes.MsgUpdateParam_AsInt64{}, "int64": tokenomicstypes.MsgUpdateParam_AsInt64{}, "string": tokenomicstypes.MsgUpdateParam_AsString{}, - "[]byte": tokenomicstypes.MsgUpdateParam_AsBytes{}, + "uint8": tokenomicstypes.MsgUpdateParam_AsBytes{}, }, } + MsgUpdateParamEnabledModuleNames []string + NewParamClientFns = map[string]any{ sharedtypes.ModuleName: sharedtypes.NewQueryClient, sessiontypes.ModuleName: sessiontypes.NewQueryClient, @@ -176,6 +177,12 @@ var ( _ IntegrationSuite = (*UpdateParamsSuite)(nil) ) +func init() { + for moduleName := range MsgUpdateParamByModule { + MsgUpdateParamEnabledModuleNames = append(MsgUpdateParamEnabledModuleNames, moduleName) + } +} + type UpdateParamsSuite struct { AuthzIntegrationSuite } @@ -200,17 +207,12 @@ func (s *UpdateParamsSuite) SetupTest() { s.GetModuleNames()..., ) - var msgUpdateParamEnabledModuleNames []string - for moduleName := range MsgUpdateParamByModule { - msgUpdateParamEnabledModuleNames = append(msgUpdateParamEnabledModuleNames, moduleName) - } - // Create authz grants for all poktroll modules' MsgUpdateParam messages. s.SendAuthzGrantMsgForPoktrollModules(s.T(), AuthorityAddr, AuthorizedAddr, MsgUpdateParamName, - msgUpdateParamEnabledModuleNames..., + MsgUpdateParamEnabledModuleNames..., ) } From 98db79c0f0bbee6605e14d79cf35acc9dc13384f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:51:38 +0200 Subject: [PATCH 20/77] refactor: integration app base app construction --- testutil/integration/app.go | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 0f68ccba9..cfec4126a 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -100,6 +100,13 @@ type App struct { DefaultSupplierKeyringKeyringUid string } +// NewBaseApp creates a new instance of the base application with the given +// codec, logger and database. +func NewBaseApp(cdc codec.Codec, logger log.Logger, db dbm.DB) *baseapp.BaseApp { + txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + return baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) +} + // NewIntegrationApp creates a new instance of the App with the provided details // on how the modules should be configured. func NewIntegrationApp( @@ -107,6 +114,7 @@ func NewIntegrationApp( sdkCtx sdk.Context, cdc codec.Codec, registry codectypes.InterfaceRegistry, + bApp *baseapp.BaseApp, logger log.Logger, authority sdk.AccAddress, modules map[string]appmodule.AppModule, @@ -116,8 +124,6 @@ func NewIntegrationApp( ) *App { t.Helper() - db := dbm.NewMemDB() - moduleManager := module.NewManagerFromMap(modules) basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) basicModuleManager.RegisterInterfaces(registry) @@ -141,8 +147,6 @@ func NewIntegrationApp( sdkCtx = sdkCtx.WithProposer(consensusAddr) // Create the base application - txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) - bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) bApp.MountKVStores(keys) bApp.SetInitChainer( @@ -194,6 +198,10 @@ func NewIntegrationApp( func NewCompleteIntegrationApp(t *testing.T) *App { t.Helper() + sdkCfg := cosmostypes.GetConfig() + addrCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32AccountAddrPrefix()) + valCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32ValidatorAddrPrefix()) + // Prepare & register the codec for all the interfaces registry := codectypes.NewInterfaceRegistry() tokenomicstypes.RegisterInterfaces(registry) @@ -228,9 +236,17 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authtypes.StoreKey, ) - // Prepare the context + // Construct a no-op logger. logger := log.NewNopLogger() // Use this if you need more output: log.NewTestLogger(t) - cms := CreateMultiStore(storeKeys, logger) + + // Prepare the database and multi-store. + db := dbm.NewMemDB() + cms := CreateMultiStore(storeKeys, logger, db) + + // Prepare the base application. + bApp := NewBaseApp(cdc, logger, db) + + // Prepare the context sdkCtx := sdk.NewContext(cms, cmtproto.Header{ ChainID: appName, Height: 1, @@ -454,6 +470,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { sdkCtx, cdc, registry, + bApp, logger, authority, modules, @@ -759,8 +776,11 @@ func (app *App) nextBlockUpdateCtx() { } // CreateMultiStore is a helper for setting up multiple stores for provided modules. -func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore { - db := dbm.NewMemDB() +func CreateMultiStore( + keys map[string]*storetypes.KVStoreKey, + logger log.Logger, + db dbm.DB, +) storetypes.CommitMultiStore { cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics()) for key := range keys { From 1908e1090ecd6ef0ef2dec3e9f74579c55ef7cff Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:51:44 +0200 Subject: [PATCH 21/77] fix: set default params for all poktroll modules --- testutil/integration/app.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index cfec4126a..27b8ad7dc 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -515,6 +515,12 @@ func NewCompleteIntegrationApp(t *testing.T) *App { require.NoError(t, err) err = applicationKeeper.SetParams(integrationApp.GetSdkCtx(), apptypes.DefaultParams()) require.NoError(t, err) + err = supplierKeeper.SetParams(integrationApp.GetSdkCtx(), suppliertypes.DefaultParams()) + require.NoError(t, err) + err = serviceKeeper.SetParams(integrationApp.GetSdkCtx(), servicetypes.DefaultParams()) + require.NoError(t, err) + err = gatewayKeeper.SetParams(integrationApp.GetSdkCtx(), gatewaytypes.DefaultParams()) + require.NoError(t, err) // Need to go to the next block to finalize the genesis and setup. // This has to be after the params are set, as the params are stored in the From fdb2b91b0f920e987ad2313da0de3fedeed67765 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:52:05 +0200 Subject: [PATCH 22/77] chore: expose integration app's pre-generated account iterator --- testutil/integration/app.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 27b8ad7dc..630827fc8 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -81,14 +81,15 @@ type App struct { *baseapp.BaseApp // Internal state of the App needed for properly configuring the blockchain. - sdkCtx *sdk.Context - cdc codec.Codec - logger log.Logger - authority sdk.AccAddress - moduleManager module.Manager - queryHelper *baseapp.QueryServiceTestHelper - keyRing keyring.Keyring - ringClient crypto.RingClient + sdkCtx *sdk.Context + cdc codec.Codec + logger log.Logger + authority sdk.AccAddress + moduleManager module.Manager + queryHelper *baseapp.QueryServiceTestHelper + keyRing keyring.Keyring + ringClient crypto.RingClient + preGeneratedAccts *testkeyring.PreGeneratedAccountIterator // Some default helper fixtures for general testing. // They're publically exposed and should/could be improve and expand on @@ -535,6 +536,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Create a pre-generated account iterator to create accounts for the test. preGeneratedAccts := testkeyring.PreGeneratedAccounts() + integrationApp.preGeneratedAccts = preGeneratedAccts // Prepare a new default service defaultService := sharedtypes.Service{ @@ -656,6 +658,11 @@ func (app *App) GetAuthority() string { return app.authority.String() } +// GetPreGeneratedAccounts returns the pre-generated accounts iterater used by the application. +func (app *App) GetPreGeneratedAccounts() *testkeyring.PreGeneratedAccountIterator { + return app.preGeneratedAccts +} + // QueryHelper returns the query helper used by the application that can be // used to submit queries to the application. func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper { From 03f2de8146ad42dcac7e706de7906300c283af61 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:52:18 +0200 Subject: [PATCH 23/77] chore: add faucet account to integration app --- testutil/integration/app.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 630827fc8..74f247324 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -2,6 +2,7 @@ package integration import ( "context" + math2 "math" "testing" "time" @@ -74,6 +75,15 @@ import ( const appName = "poktroll-integration-app" +var ( + // FaucetAddrStr is a random address which is funded with FaucetAmountUpokt + // coins such that it can be used as a faucet for integration tests. + FaucetAddrStr = sample.AccAddress() + // FaucetAmountUpokt is the number of upokt coins that the faucet account + // is funded with. + FaucetAmountUpokt = int64(math2.MaxInt64) +) + // App is a test application that can be used to test the behaviour when none // of the modules are mocked and their integration (cross module interaction) // needs to be validated. @@ -623,8 +633,17 @@ func NewCompleteIntegrationApp(t *testing.T) *App { err = bankKeeper.MintCoins(integrationApp.sdkCtx, apptypes.ModuleName, moduleBaseMint) require.NoError(t, err) + // Fund the faucet address. + faucetAddr, err := cosmostypes.AccAddressFromBech32(FaucetAddrStr) + require.NoError(t, err) + fundAccount(t, integrationApp.sdkCtx, bankKeeper, faucetAddr, FaucetAmountUpokt) + + // TODO_IMPROVE: Refactor the relay_mining_difficulty_test.go to use the + // BaseIntegrationTestSuite and its #FundAddress() method and remove the + // need for this. + // // Fund the supplier operator account to be able to submit proofs - fundAccount(t, integrationApp.sdkCtx, bankKeeper, supplierOperatorAddr) + fundAccount(t, integrationApp.sdkCtx, bankKeeper, supplierOperatorAddr, 100000000) // Commit all the changes above by committing, finalizing and moving // to the next block. @@ -809,9 +828,10 @@ func fundAccount( ctx context.Context, bankKeeper bankkeeper.Keeper, supplierOperatorAddr sdk.AccAddress, + amountUpokt int64, ) { - fundingCoins := types.NewCoins(types.NewCoin(volatile.DenomuPOKT, math.NewInt(100000000))) + fundingCoins := types.NewCoins(types.NewCoin(volatile.DenomuPOKT, math.NewInt(amountUpokt))) err := bankKeeper.MintCoins(ctx, banktypes.ModuleName, fundingCoins) require.NoError(t, err) @@ -820,5 +840,5 @@ func fundAccount( require.NoError(t, err) coin := bankKeeper.SpendableCoin(ctx, supplierOperatorAddr, volatile.DenomuPOKT) - require.Equal(t, coin.Amount, math.NewInt(100000000)) + require.Equal(t, coin.Amount, math.NewInt(amountUpokt)) } From 9f38fb1fa1c6b9650fcec581d77b20d519384742 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:53:31 +0200 Subject: [PATCH 24/77] chore: add error assertion run option to integration app --- testutil/integration/app.go | 18 +++++++++++++++++- testutil/integration/options.go | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 74f247324..733e123b8 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -708,6 +708,11 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp if cfg.AutomaticCommit { defer func() { _, err := app.Commit() + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return + } + require.NoError(t, err, "failed to commit") app.nextBlockUpdateCtx() }() @@ -721,6 +726,12 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp Votes: []cmtabcitypes.VoteInfo{{}}, }, }) + + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return nil + } + require.NoError(t, err, "failed to finalize block") app.emitEvents(t, finalizedBlockResponse) } @@ -730,10 +741,15 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp handler := app.MsgServiceRouter().Handler(msg) require.NotNil(t, handler, "handler not found for message %s", sdk.MsgTypeURL(msg)) + var response *codectypes.Any msgResult, err := handler(*app.sdkCtx, msg) + if cfg.ErrorAssertion != nil && err != nil { + cfg.ErrorAssertion(err) + return nil + } + require.NoError(t, err, "failed to execute message %s", sdk.MsgTypeURL(msg)) - var response *codectypes.Any if len(msgResult.MsgResponses) > 0 { msgResponse := msgResult.MsgResponses[0] require.NotNil(t, msgResponse, "unexpected nil msg response %s in message result: %s", sdk.MsgTypeURL(msg), msgResult.String()) diff --git a/testutil/integration/options.go b/testutil/integration/options.go index 9e94816e0..4827d53fd 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -1,14 +1,30 @@ package integration +var ( + RunUntilNextBlockOpts = RunOptions{ + WithAutomaticCommit(), + WithAutomaticFinalizeBlock(), + } +) + // RunConfig is the configuration for the testing integration app. type RunConfig struct { AutomaticFinalizeBlock bool AutomaticCommit bool + ErrorAssertion func(error) } // RunOption is a function that can be used to configure the integration app. type RunOption func(*RunConfig) +// RunOptions is a list of RunOption. It implements the Append method for convenience. +type RunOptions []RunOption + +// Append returns a new RunOptions with the given RunOptions appended. +func (runOpts RunOptions) Append(newRunOpts ...RunOption) RunOptions { + return append(runOpts, newRunOpts...) +} + // WithAutomaticFinalizeBlock calls ABCI finalize block. func WithAutomaticFinalizeBlock() RunOption { return func(cfg *RunConfig) { @@ -23,3 +39,11 @@ func WithAutomaticCommit() RunOption { cfg.AutomaticCommit = true } } + +// WithErrorAssertion registers an error assertion function which is called when +// RunMsg() encounters an error. +func WithErrorAssertion(errAssertFn func(error)) RunOption { + return func(cfg *RunConfig) { + cfg.ErrorAssertion = errAssertFn + } +} From 61e559842348b32300e7b847fa7bf64fb9247414 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:53:54 +0200 Subject: [PATCH 25/77] chore: add authz & bank modules to integration app --- testutil/integration/app.go | 57 +++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 733e123b8..4504c901e 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/store" "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/tx/signing" abci "github.com/cometbft/cometbft/abci/types" cmtabcitypes "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -34,9 +35,14 @@ import ( authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/authz" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/app" @@ -102,7 +108,7 @@ type App struct { preGeneratedAccts *testkeyring.PreGeneratedAccountIterator // Some default helper fixtures for general testing. - // They're publically exposed and should/could be improve and expand on + // They're publicly exposed and should/could be improved and expand on // over time. DefaultService *sharedtypes.Service DefaultApplication *apptypes.Application @@ -214,7 +220,19 @@ func NewCompleteIntegrationApp(t *testing.T) *App { valCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32ValidatorAddrPrefix()) // Prepare & register the codec for all the interfaces - registry := codectypes.NewInterfaceRegistry() + registry, err := codectypes.NewInterfaceRegistryWithOptions( + codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: addrCodec, + ValidatorAddressCodec: valCodec, + }, + }, + ) + require.NoError(t, err) + + banktypes.RegisterInterfaces(registry) + authz.RegisterInterfaces(registry) tokenomicstypes.RegisterInterfaces(registry) sharedtypes.RegisterInterfaces(registry) banktypes.RegisterInterfaces(registry) @@ -235,6 +253,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Prepare all the store keys storeKeys := storetypes.NewKVStoreKeys( + authzkeeper.StoreKey, sharedtypes.StoreKey, tokenomicstypes.StoreKey, banktypes.StoreKey, @@ -267,7 +286,6 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authority := authtypes.NewModuleAddress(govtypes.ModuleName) // Prepare the account keeper dependencies - addrCodec := addresscodec.NewBech32Codec(app.AccountAddressPrefix) macPerms := map[string][]string{ banktypes.ModuleName: {authtypes.Minter, authtypes.Burner}, tokenomicstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, @@ -295,7 +313,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { nil, // subspace is nil because we don't test params (which is legacy anyway) ) - // Prepare the bank keeper + // Prepare the bank keeper and module blockedAddresses := map[string]bool{ accountKeeper.GetAuthority(): false, } @@ -307,6 +325,12 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authority.String(), logger, ) + bankModule := bank.NewAppModule( + cdc, + bankKeeper, + accountKeeper, + nil, + ) // Prepare the shared keeper and module sharedKeeper := sharedkeeper.NewKeeper( @@ -462,8 +486,25 @@ func NewCompleteIntegrationApp(t *testing.T) *App { msgRouter := baseapp.NewMsgServiceRouter() queryHelper := baseapp.NewQueryServerTestHelper(sdkCtx, registry) + // Prepare the authz keeper and module + authzKeeper := authzkeeper.NewKeeper( + runtime.NewKVStoreService(storeKeys[authzkeeper.StoreKey]), + cdc, + msgRouter, + accountKeeper, + ).SetBankKeeper(bankKeeper) + authzModule := authzmodule.NewAppModule( + cdc, + authzKeeper, + accountKeeper, + bankKeeper, + registry, + ) + // Prepare the list of modules modules := map[string]appmodule.AppModule{ + banktypes.ModuleName: bankModule, + authz.ModuleName: authzModule, tokenomicstypes.ModuleName: tokenomicsModule, servicetypes.ModuleName: serviceModule, sharedtypes.ModuleName: sharedModule, @@ -491,6 +532,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { ) // Register the message servers + banktypes.RegisterMsgServer(msgRouter, bankkeeper.NewMsgServerImpl(bankKeeper)) tokenomicstypes.RegisterMsgServer(msgRouter, tokenomicskeeper.NewMsgServerImpl(tokenomicsKeeper)) servicetypes.RegisterMsgServer(msgRouter, servicekeeper.NewMsgServerImpl(serviceKeeper)) sharedtypes.RegisterMsgServer(msgRouter, sharedkeeper.NewMsgServerImpl(sharedKeeper)) @@ -500,8 +542,11 @@ func NewCompleteIntegrationApp(t *testing.T) *App { prooftypes.RegisterMsgServer(msgRouter, proofkeeper.NewMsgServerImpl(proofKeeper)) authtypes.RegisterMsgServer(msgRouter, authkeeper.NewMsgServerImpl(accountKeeper)) sessiontypes.RegisterMsgServer(msgRouter, sessionkeeper.NewMsgServerImpl(sessionKeeper)) + authz.RegisterMsgServer(msgRouter, authzKeeper) // Register query servers + banktypes.RegisterQueryServer(queryHelper, bankKeeper) + authz.RegisterQueryServer(queryHelper, authzKeeper) tokenomicstypes.RegisterQueryServer(queryHelper, tokenomicsKeeper) servicetypes.RegisterQueryServer(queryHelper, serviceKeeper) sharedtypes.RegisterQueryServer(queryHelper, sharedKeeper) @@ -514,7 +559,9 @@ func NewCompleteIntegrationApp(t *testing.T) *App { sessiontypes.RegisterQueryServer(queryHelper, sessionKeeper) // Set the default params for all the modules - err := sharedKeeper.SetParams(integrationApp.GetSdkCtx(), sharedtypes.DefaultParams()) + err = bankKeeper.SetParams(integrationApp.GetSdkCtx(), banktypes.DefaultParams()) + require.NoError(t, err) + err = sharedKeeper.SetParams(integrationApp.GetSdkCtx(), sharedtypes.DefaultParams()) require.NoError(t, err) err = tokenomicsKeeper.SetParams(integrationApp.GetSdkCtx(), tokenomicstypes.DefaultParams()) require.NoError(t, err) From da70a081ffdecf6233e1245a0ed3ddfedc6548da Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 10:54:04 +0200 Subject: [PATCH 26/77] feat: add IntegrationAppSuite & base implementation --- testutil/integration/suites/base.go | 93 ++++++++++++++++++++++++ testutil/integration/suites/interface.go | 22 ++++++ 2 files changed, 115 insertions(+) create mode 100644 testutil/integration/suites/base.go create mode 100644 testutil/integration/suites/interface.go diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go new file mode 100644 index 000000000..234640834 --- /dev/null +++ b/testutil/integration/suites/base.go @@ -0,0 +1,93 @@ +//go:build integration + +package suites + +import ( + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/integration" + apptypes "github.com/pokt-network/poktroll/x/application/types" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" +) + +// TODO_IMPROVE: Ideally this list should be populated during integration app construction. +var allPoktrollModuleNames = []string{ + sharedtypes.ModuleName, + sessiontypes.ModuleName, + servicetypes.ModuleName, + apptypes.ModuleName, + gatewaytypes.ModuleName, + suppliertypes.ModuleName, + prooftypes.ModuleName, + tokenomicstypes.ModuleName, +} + +var _ IntegrationSuite = (*BaseIntegrationSuite)(nil) + +// BaseIntegrationSuite is a base implementation of IntegrationSuite. +// It is intended to be embedded in other integration test suites. +type BaseIntegrationSuite struct { + suite.Suite + app *integration.App +} + +// NewApp constructs a new integration app and sets it on the suite. +func (s *BaseIntegrationSuite) NewApp(t *testing.T) *integration.App { + t.Helper() + + s.app = integration.NewCompleteIntegrationApp(t) + return s.app +} + +// SetApp sets the integration app on the suite. +func (s *BaseIntegrationSuite) SetApp(app *integration.App) { + s.app = app +} + +// GetApp returns the integration app from the suite. +func (s *BaseIntegrationSuite) GetApp() *integration.App { + if s.app == nil { + panic("integration app is nil; use NewApp or SetApp before calling GetApp") + } + return s.app +} + +// GetModuleNames returns the list of all poktroll modules names in the integration app. +func (s *BaseIntegrationSuite) GetModuleNames() []string { + return allPoktrollModuleNames +} + +// FundAddress sends amountUpokt coins from the faucet to the given address. +func (s *BaseIntegrationSuite) FundAddress( + t *testing.T, + addr cosmostypes.AccAddress, + amountUpokt int64, +) { + coinUpokt := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, amountUpokt) + sendToAppMsg := &banktypes.MsgSend{ + FromAddress: integration.FaucetAddrStr, + ToAddress: addr.String(), + Amount: cosmostypes.NewCoins(coinUpokt), + } + + anyRes := s.GetApp().RunMsg(t, sendToAppMsg, integration.RunUntilNextBlockOpts...) + require.NotNil(t, anyRes) + + sendRes := new(banktypes.MsgSendResponse) + err := s.GetApp().GetCodec().UnpackAny(anyRes, &sendRes) + require.NoError(t, err) + + // NB: no use in returning sendRes because it has no fields. +} diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go new file mode 100644 index 000000000..fdc6ca808 --- /dev/null +++ b/testutil/integration/suites/interface.go @@ -0,0 +1,22 @@ +//go:build integration + +package suites + +import ( + "testing" + + "github.com/pokt-network/poktroll/testutil/integration" +) + +// IntegrationSuite is an interface intended to be used within test suites which +// exercise an integration.App. +type IntegrationSuite interface { + // NewApp constructs a new integration app and sets it on the suite. + NewApp(*testing.T) *integration.App + // SetApp sets the integration app on the suite. + SetApp(*integration.App) + // GetApp returns the integration app from the suite. + GetApp() *integration.App + // GetModuleNames returns the list of all poktroll modules names in the integration app. + GetModuleNames() []string +} From d5be66d571e89ba0c924ea9da00ec04aea31b840 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 11:42:05 +0200 Subject: [PATCH 27/77] chore: rename paramsAnyMap type to mitigate variable name shadowing --- e2e/tests/params_tx_test.go | 4 ++-- e2e/tests/params_types_test.go | 6 +++--- e2e/tests/parse_params_test.go | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/e2e/tests/params_tx_test.go b/e2e/tests/params_tx_test.go index 87e4e2463..926f856e2 100644 --- a/e2e/tests/params_tx_test.go +++ b/e2e/tests/params_tx_test.go @@ -51,7 +51,7 @@ func (s *suite) sendAuthzExecTx(signingKeyName, txJSONFilePath string) { } // newTempUpdateParamsTxJSONFile creates & returns a new temp file with the JSON representation of a tx -// which contains a MsgUpdateParams to update **all module params** for each module & paramsMap +// which contains a MsgUpdateParams to update **all module params** for each module & paramsAnyMap // in the given moduleParamsMap. The returned file is intended for use with the `authz exec` CLI // subcommand: `poktrolld tx authz exec `. func (s *suite) newTempUpdateParamsTxJSONFile(moduleParams moduleParamsMap) *os.File { @@ -76,7 +76,7 @@ func (s *suite) newTempUpdateParamsTxJSONFile(moduleParams moduleParamsMap) *os. } // newTempUpdateParamTxJSONFile creates & returns a new temp file with the JSON representation of a tx -// which contains a MsgUpdateParam to update params **individually** for each module & paramsMap in the +// which contains a MsgUpdateParam to update params **individually** for each module & paramsAnyMap in the // given moduleParamsMap. The returned file is intended for use with the `authz exec` CLI subcommand: // `poktrolld tx authz exec `. func (s *suite) newTempUpdateParamTxJSONFile(moduleParams moduleParamsMap) *os.File { diff --git a/e2e/tests/params_types_test.go b/e2e/tests/params_types_test.go index facd7abca..8da752793 100644 --- a/e2e/tests/params_types_test.go +++ b/e2e/tests/params_types_test.go @@ -9,11 +9,11 @@ type ( paramNameKey = string ) -// paramsMap is a map of param names to param values. -type paramsMap map[paramNameKey]paramAny +// paramsAnyMap is a map of param names to param values. +type paramsAnyMap map[paramNameKey]paramAny // moduleParamsMap is a map of module names to params maps. -type moduleParamsMap map[moduleNameKey]paramsMap +type moduleParamsMap map[moduleNameKey]paramsAnyMap // paramAny is a struct that holds a param type and a param value. type paramAny struct { diff --git a/e2e/tests/parse_params_test.go b/e2e/tests/parse_params_test.go index e33e1e423..508332741 100644 --- a/e2e/tests/parse_params_test.go +++ b/e2e/tests/parse_params_test.go @@ -28,11 +28,11 @@ const ( paramTypeColIdx ) -// parseParamsTable parses a gocuke.DataTable into a paramsMap. -func (s *suite) parseParamsTable(table gocuke.DataTable) paramsMap { +// parseParamsTable parses a gocuke.DataTable into a paramsAnyMap. +func (s *suite) parseParamsTable(table gocuke.DataTable) paramsAnyMap { s.Helper() - paramsMap := make(paramsMap) + paramsMap := make(paramsAnyMap) // NB: skip the header row. for rowIdx := 1; rowIdx < table.NumRows(); rowIdx++ { @@ -78,9 +78,9 @@ func (s *suite) parseParam(table gocuke.DataTable, rowIdx int) paramAny { } } -// paramsMapToMsgUpdateParams converts a paramsMap into a MsgUpdateParams, which +// paramsMapToMsgUpdateParams converts a paramsAnyMap into a MsgUpdateParams, which // it returns as a proto.Message/cosmostypes.Msg interface type. -func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsMap) (msgUpdateParams cosmostypes.Msg) { +func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsAnyMap) (msgUpdateParams cosmostypes.Msg) { s.Helper() switch moduleName { @@ -104,7 +104,7 @@ func (s *suite) paramsMapToMsgUpdateParams(moduleName string, paramsMap paramsMa return msgUpdateParams } -func (s *suite) newTokenomicsMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newTokenomicsMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &tokenomicstypes.MsgUpdateParams{ @@ -123,7 +123,7 @@ func (s *suite) newTokenomicsMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newProofMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newProofMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &prooftypes.MsgUpdateParams{ @@ -150,7 +150,7 @@ func (s *suite) newProofMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newSharedMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &sharedtypes.MsgUpdateParams{ @@ -183,7 +183,7 @@ func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newAppMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newAppMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &apptypes.MsgUpdateParams{ @@ -203,7 +203,7 @@ func (s *suite) newAppMsgUpdateParams(params paramsMap) cosmostypes.Msg { return proto.Message(msgUpdateParams) } -func (s *suite) newServiceMsgUpdateParams(params paramsMap) cosmostypes.Msg { +func (s *suite) newServiceMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { authority := authtypes.NewModuleAddress(s.granterName).String() msgUpdateParams := &servicetypes.MsgUpdateParams{ From 36dc18d2f8f21f5b9d8951d747705bc79028082b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 16 Sep 2024 12:46:46 +0200 Subject: [PATCH 28/77] chore: rename var --- testutil/integration/suites/base.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 234640834..c31a64543 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -76,13 +76,13 @@ func (s *BaseIntegrationSuite) FundAddress( amountUpokt int64, ) { coinUpokt := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, amountUpokt) - sendToAppMsg := &banktypes.MsgSend{ + sendMsg := &banktypes.MsgSend{ FromAddress: integration.FaucetAddrStr, ToAddress: addr.String(), Amount: cosmostypes.NewCoins(coinUpokt), } - anyRes := s.GetApp().RunMsg(t, sendToAppMsg, integration.RunUntilNextBlockOpts...) + anyRes := s.GetApp().RunMsg(t, sendMsg, integration.RunUntilNextBlockOpts...) require.NotNil(t, anyRes) sendRes := new(banktypes.MsgSendResponse) From 64c5a83bc51737714ee62bf5e0c470a77e66e622 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 18 Sep 2024 19:03:05 +0200 Subject: [PATCH 29/77] refactor: integration app to support txResult events --- testutil/integration/app.go | 184 +++++++++++++++----------------- testutil/integration/options.go | 10 ++ 2 files changed, 99 insertions(+), 95 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 4504c901e..6d373cbc5 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -11,8 +11,6 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/math" - "cosmossdk.io/store" - "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/tx/signing" abci "github.com/cometbft/cometbft/abci/types" @@ -20,6 +18,7 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -30,6 +29,7 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -107,6 +107,8 @@ type App struct { ringClient crypto.RingClient preGeneratedAccts *testkeyring.PreGeneratedAccountIterator + txCfg client.TxConfig + // Some default helper fixtures for general testing. // They're publicly exposed and should/could be improved and expand on // over time. @@ -130,6 +132,7 @@ func NewIntegrationApp( t *testing.T, sdkCtx sdk.Context, cdc codec.Codec, + txCfg client.TxConfig, registry codectypes.InterfaceRegistry, bApp *baseapp.BaseApp, logger log.Logger, @@ -141,6 +144,9 @@ func NewIntegrationApp( ) *App { t.Helper() + bApp.SetInterfaceRegistry(registry) + + // TODO_IMPROVE: use moduleManager.ModuleNames() to populate allModuleNames. moduleManager := module.NewManagerFromMap(modules) basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) basicModuleManager.RegisterInterfaces(registry) @@ -150,7 +156,7 @@ func NewIntegrationApp( // first block being special and iterated over during the setup process. cometHeader := cmtproto.Header{ ChainID: appName, - Height: 2, + Height: 1, } sdkCtx = sdkCtx. WithBlockHeader(cometHeader). @@ -177,11 +183,11 @@ func NewIntegrationApp( return &cmtabcitypes.ResponseInitChain{}, nil }) - bApp.SetBeginBlocker(func(_ sdk.Context) (sdk.BeginBlock, error) { - return moduleManager.BeginBlock(sdkCtx) + bApp.SetBeginBlocker(func(ctx sdk.Context) (sdk.BeginBlock, error) { + return moduleManager.BeginBlock(ctx) }) - bApp.SetEndBlocker(func(_ sdk.Context) (sdk.EndBlock, error) { - return moduleManager.EndBlock(sdkCtx) + bApp.SetEndBlocker(func(ctx sdk.Context) (sdk.EndBlock, error) { + return moduleManager.EndBlock(ctx) }) msgRouter.SetInterfaceRegistry(registry) @@ -193,8 +199,7 @@ func NewIntegrationApp( _, err = bApp.InitChain(&cmtabcitypes.RequestInitChain{ChainId: appName}) require.NoError(t, err, "failed to initialize chain") - _, err = bApp.Commit() - require.NoError(t, err, "failed to commit") + bApp.SetTxEncoder(txCfg.TxEncoder()) return &App{ BaseApp: bApp, @@ -202,6 +207,7 @@ func NewIntegrationApp( authority: authority, sdkCtx: &sdkCtx, cdc: cdc, + txCfg: txCfg, moduleManager: *moduleManager, queryHelper: queryHelper, } @@ -251,6 +257,9 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Prepare the codec cdc := codec.NewProtoCodec(registry) + // Prepare the TxConfig + txCfg := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + // Prepare all the store keys storeKeys := storetypes.NewKVStoreKeys( authzkeeper.StoreKey, @@ -271,16 +280,15 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Prepare the database and multi-store. db := dbm.NewMemDB() - cms := CreateMultiStore(storeKeys, logger, db) // Prepare the base application. bApp := NewBaseApp(cdc, logger, db) // Prepare the context - sdkCtx := sdk.NewContext(cms, cmtproto.Header{ + sdkCtx := bApp.NewUncachedContext(false, cmtproto.Header{ ChainID: appName, Height: 1, - }, true, logger) + }) // Get the authority address authority := authtypes.NewModuleAddress(govtypes.ModuleName) @@ -521,6 +529,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { t, sdkCtx, cdc, + txCfg, registry, bApp, logger, @@ -558,28 +567,6 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // authtypes.RegisterQueryServer(queryHelper, accountKeeper) sessiontypes.RegisterQueryServer(queryHelper, sessionKeeper) - // Set the default params for all the modules - err = bankKeeper.SetParams(integrationApp.GetSdkCtx(), banktypes.DefaultParams()) - require.NoError(t, err) - err = sharedKeeper.SetParams(integrationApp.GetSdkCtx(), sharedtypes.DefaultParams()) - require.NoError(t, err) - err = tokenomicsKeeper.SetParams(integrationApp.GetSdkCtx(), tokenomicstypes.DefaultParams()) - require.NoError(t, err) - err = proofKeeper.SetParams(integrationApp.GetSdkCtx(), prooftypes.DefaultParams()) - require.NoError(t, err) - err = sessionKeeper.SetParams(integrationApp.GetSdkCtx(), sessiontypes.DefaultParams()) - require.NoError(t, err) - err = gatewayKeeper.SetParams(integrationApp.GetSdkCtx(), gatewaytypes.DefaultParams()) - require.NoError(t, err) - err = applicationKeeper.SetParams(integrationApp.GetSdkCtx(), apptypes.DefaultParams()) - require.NoError(t, err) - err = supplierKeeper.SetParams(integrationApp.GetSdkCtx(), suppliertypes.DefaultParams()) - require.NoError(t, err) - err = serviceKeeper.SetParams(integrationApp.GetSdkCtx(), servicetypes.DefaultParams()) - require.NoError(t, err) - err = gatewayKeeper.SetParams(integrationApp.GetSdkCtx(), gatewaytypes.DefaultParams()) - require.NoError(t, err) - // Need to go to the next block to finalize the genesis and setup. // This has to be after the params are set, as the params are stored in the // store and need to be committed. @@ -742,68 +729,80 @@ func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper { // The result of the message execution is returned as an Any type. // That any type can be unmarshaled to the expected response type. // If the message execution fails, an error is returned. -func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectypes.Any { +// +// TODO_IN_THIS_COMMIT: update comment... +func (app *App) RunMsg(t *testing.T, cfg *RunConfig, msgs ...sdk.Msg) (txMsgRes tx.MsgResponse) { t.Helper() - // set options - cfg := &RunConfig{} - for _, opt := range option { - opt(cfg) - } - - // If configured, commit after the message is executed. - if cfg.AutomaticCommit { - defer func() { - _, err := app.Commit() - if cfg.ErrorAssertion != nil && err != nil { - cfg.ErrorAssertion(err) - return - } - - require.NoError(t, err, "failed to commit") - app.nextBlockUpdateCtx() - }() + if cfg == nil { + cfg = new(RunConfig) } - // If configured, finalize the block after the message is executed. - if cfg.AutomaticFinalizeBlock { - finalizedBlockResponse, err := app.FinalizeBlock(&cmtabcitypes.RequestFinalizeBlock{ - Height: app.LastBlockHeight() + 1, - DecidedLastCommit: cmtabcitypes.CommitInfo{ - Votes: []cmtabcitypes.VoteInfo{{}}, - }, - }) - + // Commit the updated state after the message has been handled. + var finalizedBlockResponse *abci.ResponseFinalizeBlock + defer func() { + _, err := app.Commit() if cfg.ErrorAssertion != nil && err != nil { cfg.ErrorAssertion(err) - return nil + } else { + require.NoError(t, err, "failed to commit") } + app.nextBlockUpdateCtx() - require.NoError(t, err, "failed to finalize block") + // Emit events AFTER the context has been updated. app.emitEvents(t, finalizedBlockResponse) - } + }() - app.logger.Info("Running msg", "msg", msg.String()) + // Package the message into a transaction. + txBuilder := app.txCfg.NewTxBuilder() + err := txBuilder.SetMsgs(msgs...) + require.NoError(t, err) - handler := app.MsgServiceRouter().Handler(msg) - require.NotNil(t, handler, "handler not found for message %s", sdk.MsgTypeURL(msg)) + txBz, err := app.TxEncode(txBuilder.GetTx()) + require.NoError(t, err) + + for _, msg := range msgs { + app.logger.Info("Running msg", "msg", msg.String()) + } + + // Finalize the block with the transaction. + finalizedBlockResponse, err = app.FinalizeBlock(&cmtabcitypes.RequestFinalizeBlock{ + Height: app.LastBlockHeight() + 1, + DecidedLastCommit: cmtabcitypes.CommitInfo{ + Votes: []cmtabcitypes.VoteInfo{{}}, + }, + Txs: [][]byte{txBz}, + }) - var response *codectypes.Any - msgResult, err := handler(*app.sdkCtx, msg) if cfg.ErrorAssertion != nil && err != nil { cfg.ErrorAssertion(err) return nil } - require.NoError(t, err, "failed to execute message %s", sdk.MsgTypeURL(msg)) + require.NoError(t, err, "failed to finalize block") - if len(msgResult.MsgResponses) > 0 { - msgResponse := msgResult.MsgResponses[0] - require.NotNil(t, msgResponse, "unexpected nil msg response %s in message result: %s", sdk.MsgTypeURL(msg), msgResult.String()) - response = msgResponse + if cfg.ErrorAssertion != nil { + cfg.ErrorAssertion(err) + return nil } - return response + // TODO_IN_THIS_COMMIT: comment or improve... assume each tx has a single msg. + require.Equalf(t, 1, len(finalizedBlockResponse.TxResults), "expected 1 tx result, got %d", len(finalizedBlockResponse.TxResults)) + + txResult := finalizedBlockResponse.TxResults[0] + require.Truef(t, txResult.IsOK(), "tx failed with log: %s", txResult.GetLog()) + + txMsgDataBz := txResult.GetData() + require.NotNil(t, txMsgDataBz) + + txMsgData := new(cosmostypes.TxMsgData) + err = app.GetCodec().Unmarshal(txMsgDataBz, txMsgData) + + // TODO_IN_THIS_COMMIT: assumes only one msg per tx... + err = app.GetCodec().UnpackAny(txMsgData.MsgResponses[0], &txMsgRes) + require.NoError(t, err) + require.NotNil(t, txMsgRes) + return txMsgRes } // NextBlocks calls NextBlock numBlocks times @@ -819,11 +818,19 @@ func (app *App) NextBlocks(t *testing.T, numBlocks int) { // of the context in the active app. func (app *App) emitEvents(t *testing.T, res *abci.ResponseFinalizeBlock) { t.Helper() + for _, event := range res.Events { testutilevents.QuoteEventMode(&event) abciEvent := cosmostypes.Event(event) app.sdkCtx.EventManager().EmitEvent(abciEvent) } + + for _, txResult := range res.TxResults { + for _, event := range txResult.Events { + abciEvent := cosmostypes.Event(event) + app.sdkCtx.EventManager().EmitEvent(abciEvent) + } + } } // NextBlock commits and finalizes all existing transactions. It then updates @@ -833,7 +840,9 @@ func (app *App) NextBlock(t *testing.T) { finalizedBlockResponse, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: app.sdkCtx.BlockHeight(), - Time: app.sdkCtx.BlockTime()}) + Time: app.sdkCtx.BlockTime(), + }) + require.NoError(t, err) app.emitEvents(t, finalizedBlockResponse) @@ -860,32 +869,17 @@ func (app *App) nextBlockUpdateCtx() { Time: header.Time, } - newContext := app.BaseApp.NewUncachedContext(true, header). + newContext := app.NewUncachedContext(true, header). WithBlockHeader(header). WithHeaderInfo(headerInfo). - WithEventManager(prevCtx.EventManager()). + // TODO_IN_THIS_COMMIT: should we really be doing this? + //WithEventManager(prevCtx.EventManager()). // Pass the multi-store to the new context, otherwise the new context will // create a new multi-store. WithMultiStore(prevCtx.MultiStore()) *app.sdkCtx = newContext } -// CreateMultiStore is a helper for setting up multiple stores for provided modules. -func CreateMultiStore( - keys map[string]*storetypes.KVStoreKey, - logger log.Logger, - db dbm.DB, -) storetypes.CommitMultiStore { - cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics()) - - for key := range keys { - cms.MountStoreWithDB(keys[key], storetypes.StoreTypeIAVL, db) - } - - _ = cms.LoadLatestVersion() - return cms -} - func fundAccount( t *testing.T, ctx context.Context, diff --git a/testutil/integration/options.go b/testutil/integration/options.go index 4827d53fd..a88049c21 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -20,6 +20,16 @@ type RunOption func(*RunConfig) // RunOptions is a list of RunOption. It implements the Append method for convenience. type RunOptions []RunOption +func (runOpts RunOptions) Config() *RunConfig { + cfg := &RunConfig{} + + for _, opt := range runOpts { + opt(cfg) + } + + return cfg +} + // Append returns a new RunOptions with the given RunOptions appended. func (runOpts RunOptions) Append(newRunOpts ...RunOption) RunOptions { return append(runOpts, newRunOpts...) From e73aa984aa98cb57fe29d3378d0424aa94688d7d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 18 Sep 2024 19:04:10 +0200 Subject: [PATCH 30/77] chore: extend IntegrationAppSuite --- testutil/events/filter.go | 29 ++++ testutil/integration/suites/base.go | 78 ++++++++- testutil/integration/suites/base_test.go | 200 +++++++++++++++++++++++ testutil/integration/suites/interface.go | 17 ++ 4 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 testutil/integration/suites/base_test.go diff --git a/testutil/events/filter.go b/testutil/events/filter.go index bb03237f0..c1edeb03f 100644 --- a/testutil/events/filter.go +++ b/testutil/events/filter.go @@ -2,6 +2,7 @@ package events import ( "strconv" + "strings" "testing" abci "github.com/cometbft/cometbft/abci/types" @@ -47,3 +48,31 @@ func QuoteEventMode(event *abci.Event) { } } } + +// TODO_IN_THIS_COMMIT: godoc... +func NewMsgEventMatchFn(matchMsgTypeURL string) func(*cosmostypes.Event) bool { + return func(event *cosmostypes.Event) bool { + if event.Type != "message" { + return false + } + + actionAttr, hasActionAttr := event.GetAttribute("action") + if !hasActionAttr { + return false + } + + eventMsgTypeURL := strings.Trim(actionAttr.GetValue(), "\"") + if strings.Trim(eventMsgTypeURL, "/") != strings.Trim(matchMsgTypeURL, "/") { + return false + } + + return true + } +} + +// TODO_IN_THIS_COMMIT: godoc... +func NewEventTypeMatchFn(matchEventType string) func(*cosmostypes.Event) bool { + return func(event *cosmostypes.Event) bool { + return strings.Trim(event.Type, "/") == strings.Trim(matchEventType, "/") + } +} diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index c31a64543..028788ad3 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -3,6 +3,7 @@ package suites import ( + "strings" "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" @@ -11,6 +12,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/testutil/integration" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" @@ -41,6 +43,8 @@ var _ IntegrationSuite = (*BaseIntegrationSuite)(nil) type BaseIntegrationSuite struct { suite.Suite app *integration.App + + appQueryClient client.ApplicationQueryClient } // NewApp constructs a new integration app and sets it on the suite. @@ -69,12 +73,20 @@ func (s *BaseIntegrationSuite) GetModuleNames() []string { return allPoktrollModuleNames } +// SdkCtx returns the integration app's SDK context. +func (s *BaseIntegrationSuite) SdkCtx() *cosmostypes.Context { + return s.GetApp().GetSdkCtx() + +} + // FundAddress sends amountUpokt coins from the faucet to the given address. func (s *BaseIntegrationSuite) FundAddress( t *testing.T, addr cosmostypes.AccAddress, amountUpokt int64, + runOpts ...integration.RunOption, ) { + opts := integration.RunOptions(runOpts) coinUpokt := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, amountUpokt) sendMsg := &banktypes.MsgSend{ FromAddress: integration.FaucetAddrStr, @@ -82,12 +94,66 @@ func (s *BaseIntegrationSuite) FundAddress( Amount: cosmostypes.NewCoins(coinUpokt), } - anyRes := s.GetApp().RunMsg(t, sendMsg, integration.RunUntilNextBlockOpts...) - require.NotNil(t, anyRes) - - sendRes := new(banktypes.MsgSendResponse) - err := s.GetApp().GetCodec().UnpackAny(anyRes, &sendRes) - require.NoError(t, err) + txMsgRes := s.GetApp().RunMsg(t, opts.Config(), sendMsg) + require.NotNil(t, txMsgRes) // NB: no use in returning sendRes because it has no fields. } + +func (s *BaseIntegrationSuite) GetBankQueryClient() banktypes.QueryClient { + return banktypes.NewQueryClient(s.GetApp().QueryHelper()) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *BaseIntegrationSuite) FilterLatestEvents(matchFn func(*cosmostypes.Event) bool) (matchedEvents []*cosmostypes.Event) { + return s.filterEvents(matchFn, false) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *BaseIntegrationSuite) LatestMatchingEvent(matchFn func(*cosmostypes.Event) bool) (matchedEvent *cosmostypes.Event) { + filteredEvents := s.filterEvents(matchFn, true) + + if len(filteredEvents) < 1 { + return nil + } + + return filteredEvents[0] +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *BaseIntegrationSuite) GetAttributeValue(event *cosmostypes.Event, key string) (value string, hasAttr bool) { + attr, hasAttr := event.GetAttribute(key) + if !hasAttr { + return "", false + } + + return strings.Trim(attr.GetValue(), "\""), true +} + +// TODO_IN_THIS_COMMIT: godoc... +// TODO_IMPROVE: consolidate with testutil/events/filter.go +func (s *BaseIntegrationSuite) filterEvents( + matchFn func(*cosmostypes.Event) bool, + latestOnly bool, +) (matchedEvents []*cosmostypes.Event) { + events := s.GetApp().GetSdkCtx().EventManager().Events() + + // TODO_IN_THIS_COMMIT: comment about why reverse order and/or figure out why events accumulate across blocks. + for i := len(events) - 1; i >= 0; i-- { + // TODO_IN_THIS_COMMIT: double-check that there's no issue here with + // pointing to a variable which is reused by the loop. + event := events[i] + + if !matchFn(&event) { + continue + } + + matchedEvents = append(matchedEvents, &event) + + if latestOnly { + break + } + } + + return matchedEvents +} diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go new file mode 100644 index 000000000..dca2b85ee --- /dev/null +++ b/testutil/integration/suites/base_test.go @@ -0,0 +1,200 @@ +//go:build integration + +package suites + +import ( + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/events" + "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/sample" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" +) + +var gatewayStakeAmount = int64(1000) + +type BaseIntegrationSuiteTestSuite struct { + BaseIntegrationSuite +} + +func (s *BaseIntegrationSuite) SetupTest() { + // Reset app to nil before each test. + s.app = nil +} + +func (s *BaseIntegrationSuiteTestSuite) TestGetApp_PanicsIfNil() { + require.Nil(s.T(), s.app) + + // Expect the call to GetApp() to panic, defer recovery to check. + didPanic := false + defer func() { + if r := recover(); r != nil { + didPanic = true + } + + // Assertion MUST follow recovery; i.e., run last. + require.True(s.T(), didPanic, "expected call to s.GetApp() to panic when app is nil") + }() + + // Trigger panic. 🚨 + s.GetApp() +} + +// TODO_INVESTIGATE: Why this test fails. +func (s *BaseIntegrationSuiteTestSuite) TestNewApp() { + require.Nil(s.T(), s.app) + + app := s.NewApp(s.T()) + require.Same(s.T(), app, s.app) +} + +func (s *BaseIntegrationSuiteTestSuite) TestGetApp_ReturnsApp() { + app := s.NewApp(s.T()) + require.Same(s.T(), app, s.GetApp()) +} +func (s *BaseIntegrationSuiteTestSuite) TestSetApp() { + // Construct an app. + app := s.NewApp(s.T()) + + // Reset s.app to nil. + s.app = nil + + s.SetApp(app) + require.Same(s.T(), app, s.app) +} + +func (s *BaseIntegrationSuiteTestSuite) TestGetModuleNames() { + moduleNames := s.GetModuleNames() + require.ElementsMatch(s.T(), allPoktrollModuleNames, moduleNames) +} + +func (s *BaseIntegrationSuiteTestSuite) TestSdkCtx() { + s.NewApp(s.T()) + sdkCtx := s.SdkCtx() + + require.NotNil(s.T(), sdkCtx) + require.Greater(s.T(), sdkCtx.BlockHeight(), int64(0)) +} + +func (s *BaseIntegrationSuiteTestSuite) TestFundAddressAndGetBankQueryClient() { + s.NewApp(s.T()) + fundAmount := int64(1000) + fundAddr, err := cosmostypes.AccAddressFromBech32(sample.AccAddress()) + require.NoError(s.T(), err) + + // Assert that the balance is zero before funding. + bankQueryClient := s.GetBankQueryClient() + balRes, err := bankQueryClient.Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ + Address: fundAddr.String(), + Denom: volatile.DenomuPOKT, + }) + require.NoError(s.T(), err) + require.Equal(s.T(), int64(0), balRes.GetBalance().Amount.Int64()) + + // Fund the address. + s.FundAddress(s.T(), fundAddr, fundAmount) + + // Assert that the balance amount is equal to fundAmount. + balRes, err = bankQueryClient.Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ + Address: fundAddr.String(), + Denom: volatile.DenomuPOKT, + }) + require.NoError(s.T(), err) + require.Equal(s.T(), fundAmount, balRes.GetBalance().Amount.Int64()) +} + +func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMatchFn() { + expectedNumEvents := 3 + + s.NewApp(s.T()) + s.generateBankMsgSendEvents(expectedNumEvents) + + // Filter for the unstake event. + msgSendTypeURL := cosmostypes.MsgTypeURL(&banktypes.MsgSend{}) + matchedEvents := s.FilterLatestEvents(events.NewMsgEventMatchFn(msgSendTypeURL)) + + require.Equal(s.T(), expectedNumEvents, len(matchedEvents), "unexpected number of matched events") + + // Assert that the events are cleared on the next block. + s.GetApp().NextBlock(s.T()) + require.Equal(s.T(), 0, len(s.SdkCtx().EventManager().Events()), "expected no events in the next block") +} + +func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMatchFn() { + expectedNumEvents := 3 + + s.NewApp(s.T()) + s.emitPoktrollGatewayUnstakedEvents(expectedNumEvents) + + // Filter for the unstake event. + eventGatewayUnstakedTypeURL := cosmostypes.MsgTypeURL(&gatewaytypes.EventGatewayUnstaked{}) + matchedEvents := s.FilterLatestEvents(events.NewEventTypeMatchFn(eventGatewayUnstakedTypeURL)) + + require.Equal(s.T(), expectedNumEvents, len(matchedEvents), "unexpected number of matched events") + + // Assert that the events are cleared on the next block. + s.GetApp().NextBlock(s.T()) + require.Equal(s.T(), 0, len(s.SdkCtx().EventManager().Events()), "expected no events in the next block") +} + +func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { + s.NewApp(s.T()) + s.generateBankMsgSendEvents(1) + + testEvents := s.SdkCtx().EventManager().Events() + // NB: 5 events are emitted for a single MsgSend: + // - message + // - coin_spent + // - coin_received + // - transfer + // - coinbase + require.Equal(s.T(), 5, len(testEvents), "expected 5 events") + event := testEvents[0] + + // Get the matched event and check its attributes. + value, hasAttr := s.GetAttributeValue(&event, "module") + require.True(s.T(), hasAttr) + require.Equal(s.T(), banktypes.ModuleName, value) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *BaseIntegrationSuiteTestSuite) generateBankMsgSendEvents(expectedNumEvents int) { + msgs := make([]cosmostypes.Msg, 0) + + for i := 0; i < expectedNumEvents; i++ { + faucetAddr, err := cosmostypes.AccAddressFromBech32(integration.FaucetAddrStr) + require.NoError(s.T(), err) + + randomAddr, err := cosmostypes.AccAddressFromBech32(sample.AccAddress()) + require.NoError(s.T(), err) + + sendMsg := banktypes.NewMsgSend( + faucetAddr, + randomAddr, + cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100)), + ) + msgs = append(msgs, sendMsg) + } + + s.GetApp().RunMsg(s.T(), nil, msgs...) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *BaseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expectedNumEvents int) { + for i := 0; i < expectedNumEvents; i++ { + err := s.SdkCtx().EventManager().EmitTypedEvent(&gatewaytypes.EventGatewayUnstaked{ + Address: sample.AccAddress(), + }) + require.NoError(s.T(), err) + } +} + +func TestBaseIntegrationSuite(t *testing.T) { + suite.Run(t, new(BaseIntegrationSuiteTestSuite)) +} diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index fdc6ca808..de46eee50 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -5,6 +5,9 @@ package suites import ( "testing" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/pokt-network/poktroll/testutil/integration" ) @@ -19,4 +22,18 @@ type IntegrationSuite interface { GetApp() *integration.App // GetModuleNames returns the list of all poktroll modules names in the integration app. GetModuleNames() []string + // SdkCtx returns the integration app's SDK context. + SdkCtx() *cosmostypes.Context + + // FundAddress sends amtUpokt coins from the faucet to the given address. + FundAddress(t *testing.T, addr cosmostypes.AccAddress, amtUpokt int64, opts ...integration.RunOption) + // GetBankQueryClient returns a query client for the bank module of the integration app + GetBankQueryClient() banktypes.QueryClient + + // TODO_IN_THIS_COMMIT: godoc... + FilterLatestEvents(matchFn func(*cosmostypes.Event) bool) []*cosmostypes.Event + // TODO_IN_THIS_COMMIT: godoc... + LatestMatchingEvent(matchFn func(*cosmostypes.Event) bool) *cosmostypes.Event + // TODO_IN_THIS_COMMIT: godoc... + GetAttributeValue(event *cosmostypes.Event, key string) (value string, hasAttr bool) } From 6e7832a6674b76e4def17cf3aef2e03ab3445180 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 18 Sep 2024 20:31:46 +0200 Subject: [PATCH 31/77] refactor: add IntegrationAppConfig/Options & genesis support --- testutil/integration/app.go | 278 +++++++++++++++++++------------- testutil/integration/options.go | 43 +++++ 2 files changed, 209 insertions(+), 112 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 6d373cbc5..109b2c13b 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -88,6 +88,13 @@ var ( // FaucetAmountUpokt is the number of upokt coins that the faucet account // is funded with. FaucetAmountUpokt = int64(math2.MaxInt64) + + // defaultIntegrationAppConfig is the default configuration for the integration app. + defaultIntegrationAppConfig = IntegrationAppConfig{ + InitChainerModuleFns: []InitChainerModuleFn{ + newFaucetInitChainerFn(FaucetAddrStr, FaucetAmountUpokt), + }, + } ) // App is a test application that can be used to test the behaviour when none @@ -119,13 +126,6 @@ type App struct { DefaultSupplierKeyringKeyringUid string } -// NewBaseApp creates a new instance of the base application with the given -// codec, logger and database. -func NewBaseApp(cdc codec.Codec, logger log.Logger, db dbm.DB) *baseapp.BaseApp { - txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) - return baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) -} - // NewIntegrationApp creates a new instance of the App with the provided details // on how the modules should be configured. func NewIntegrationApp( @@ -141,9 +141,15 @@ func NewIntegrationApp( keys map[string]*storetypes.KVStoreKey, msgRouter *baseapp.MsgServiceRouter, queryHelper *baseapp.QueryServiceTestHelper, + opts ...IntegrationAppOption, ) *App { t.Helper() + cfg := &defaultIntegrationAppConfig + for _, opt := range opts { + opt(cfg) + } + bApp.SetInterfaceRegistry(registry) // TODO_IMPROVE: use moduleManager.ModuleNames() to populate allModuleNames. @@ -151,9 +157,6 @@ func NewIntegrationApp( basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) basicModuleManager.RegisterInterfaces(registry) - // TODO_HACK(@Olshansk): I needed to set the height to 2 so downstream logic - // works. I'm not 100% sure why, but believe it's a result of genesis and the - // first block being special and iterated over during the setup process. cometHeader := cmtproto.Header{ ChainID: appName, Height: 1, @@ -178,6 +181,10 @@ func NewIntegrationApp( if m, ok := mod.(module.HasGenesis); ok { m.InitGenesis(ctx, cdc, m.DefaultGenesis(cdc)) } + + for _, fn := range cfg.InitChainerModuleFns { + fn(ctx, cdc, mod) + } } return &cmtabcitypes.ResponseInitChain{}, nil @@ -218,7 +225,7 @@ func NewIntegrationApp( // TODO_TECHDEBT: Not all of the modules are created here (e.g. minting module), // so it is up to the developer to add / improve / update this function over time // as the need arises. -func NewCompleteIntegrationApp(t *testing.T) *App { +func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App { t.Helper() sdkCfg := cosmostypes.GetConfig() @@ -254,12 +261,6 @@ func NewCompleteIntegrationApp(t *testing.T) *App { cryptocodec.RegisterInterfaces(registry) banktypes.RegisterInterfaces(registry) - // Prepare the codec - cdc := codec.NewProtoCodec(registry) - - // Prepare the TxConfig - txCfg := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) - // Prepare all the store keys storeKeys := storetypes.NewKVStoreKeys( authzkeeper.StoreKey, @@ -275,6 +276,12 @@ func NewCompleteIntegrationApp(t *testing.T) *App { authtypes.StoreKey, ) + // Prepare the codec + cdc := codec.NewProtoCodec(registry) + + // Prepare the TxConfig + txCfg := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + // Construct a no-op logger. logger := log.NewNopLogger() // Use this if you need more output: log.NewTestLogger(t) @@ -282,7 +289,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { db := dbm.NewMemDB() // Prepare the base application. - bApp := NewBaseApp(cdc, logger, db) + bApp := baseapp.NewBaseApp(appName, logger, db, txCfg.TxDecoder(), baseapp.SetChainID(appName)) // Prepare the context sdkCtx := bApp.NewUncachedContext(false, cmtproto.Header{ @@ -538,6 +545,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { storeKeys, msgRouter, queryHelper, + opts..., ) // Register the message servers @@ -582,103 +590,18 @@ func NewCompleteIntegrationApp(t *testing.T) *App { preGeneratedAccts := testkeyring.PreGeneratedAccounts() integrationApp.preGeneratedAccts = preGeneratedAccts - // Prepare a new default service - defaultService := sharedtypes.Service{ - Id: "svc1", - Name: "svcName1", - ComputeUnitsPerRelay: 1, - OwnerAddress: sample.AccAddress(), - } - serviceKeeper.SetService(integrationApp.sdkCtx, defaultService) - integrationApp.DefaultService = &defaultService - - // Create a supplier account with the corresponding keys in the keyring for the supplier. - integrationApp.DefaultSupplierKeyringKeyringUid = "supplier" - supplierOperatorAddr := testkeyring.CreateOnChainAccount( - integrationApp.sdkCtx, t, - integrationApp.DefaultSupplierKeyringKeyringUid, - keyRing, - accountKeeper, - preGeneratedAccts, - ) - - // Prepare the on-chain supplier - supplierStake := types.NewCoin("upokt", math.NewInt(1000000)) - defaultSupplier := sharedtypes.Supplier{ - OwnerAddress: supplierOperatorAddr.String(), - OperatorAddress: supplierOperatorAddr.String(), - Stake: &supplierStake, - Services: []*sharedtypes.SupplierServiceConfig{ - { - RevShare: []*sharedtypes.ServiceRevenueShare{ - { - Address: sample.AccAddress(), - RevSharePercentage: 100, - }, - }, - ServiceId: defaultService.Id, - }, - }, - } - supplierKeeper.SetSupplier(integrationApp.sdkCtx, defaultSupplier) - integrationApp.DefaultSupplier = &defaultSupplier - - // Create an application account with the corresponding keys in the keyring for the application. - integrationApp.DefaultApplicationKeyringUid = "application" - applicationAddr := testkeyring.CreateOnChainAccount( - integrationApp.sdkCtx, t, - integrationApp.DefaultApplicationKeyringUid, - keyRing, + // TODO_IMPROVE: Eliminate usage of and remove this function in favor of + // integration.NewInitChainerModuleGenesisStateOptionFn. + integrationApp.setupDefaultActorsState(t, accountKeeper, - preGeneratedAccts, + bankKeeper, + serviceKeeper, + supplierKeeper, + applicationKeeper, + sessionKeeper, + sharedKeeper, ) - // Prepare the on-chain supplier - appStake := types.NewCoin("upokt", math.NewInt(1000000)) - defaultApplication := apptypes.Application{ - Address: applicationAddr.String(), - Stake: &appStake, - ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ - { - ServiceId: defaultService.Id, - }, - }, - } - applicationKeeper.SetApplication(integrationApp.sdkCtx, defaultApplication) - integrationApp.DefaultApplication = &defaultApplication - - // Construct a ringClient to get the application's ring & verify the relay - // request signature. - ringClient, err := rings.NewRingClient(depinject.Supply( - polyzero.NewLogger(), - prooftypes.NewAppKeeperQueryClient(applicationKeeper), - prooftypes.NewAccountKeeperQueryClient(accountKeeper), - prooftypes.NewSharedKeeperQueryClient(sharedKeeper, sessionKeeper), - )) - require.NoError(t, err) - integrationApp.ringClient = ringClient - - // TODO_IMPROVE: The setup above does not to proper "staking" of the suppliers and applications. - // This can result in the module accounts balance going negative. Giving them a baseline balance - // to start with to avoid this issue. There is opportunity to improve this in the future. - moduleBaseMint := types.NewCoins(sdk.NewCoin("upokt", math.NewInt(690000000000000042))) - err = bankKeeper.MintCoins(integrationApp.sdkCtx, suppliertypes.ModuleName, moduleBaseMint) - require.NoError(t, err) - err = bankKeeper.MintCoins(integrationApp.sdkCtx, apptypes.ModuleName, moduleBaseMint) - require.NoError(t, err) - - // Fund the faucet address. - faucetAddr, err := cosmostypes.AccAddressFromBech32(FaucetAddrStr) - require.NoError(t, err) - fundAccount(t, integrationApp.sdkCtx, bankKeeper, faucetAddr, FaucetAmountUpokt) - - // TODO_IMPROVE: Refactor the relay_mining_difficulty_test.go to use the - // BaseIntegrationTestSuite and its #FundAddress() method and remove the - // need for this. - // - // Fund the supplier operator account to be able to submit proofs - fundAccount(t, integrationApp.sdkCtx, bankKeeper, supplierOperatorAddr, 100000000) - // Commit all the changes above by committing, finalizing and moving // to the next block. integrationApp.NextBlock(t) @@ -880,6 +803,119 @@ func (app *App) nextBlockUpdateCtx() { *app.sdkCtx = newContext } +// TODO_IN_THIS_COMMIT: godoc... +// +// TODO_IMPROVE: Eliminate usage of and remove this function in favor of +// integration.NewInitChainerModuleGenesisStateOptionFn. +func (app *App) setupDefaultActorsState( + t *testing.T, + accountKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, + serviceKeeper servicekeeper.Keeper, + supplierKeeper supplierkeeper.Keeper, + applicationKeeper appkeeper.Keeper, + sessionKeeper sessionkeeper.Keeper, + sharedKeeper sharedkeeper.Keeper, +) { + t.Helper() + + // Prepare a new default service + defaultService := sharedtypes.Service{ + Id: "svc1", + Name: "svcName1", + ComputeUnitsPerRelay: 1, + OwnerAddress: sample.AccAddress(), + } + serviceKeeper.SetService(app.sdkCtx, defaultService) + app.DefaultService = &defaultService + + // Create a supplier account with the corresponding keys in the keyring for the supplier. + app.DefaultSupplierKeyringKeyringUid = "supplier" + supplierOperatorAddr := testkeyring.CreateOnChainAccount( + app.sdkCtx, t, + app.DefaultSupplierKeyringKeyringUid, + app.keyRing, + accountKeeper, + app.preGeneratedAccts, + ) + + // Prepare the on-chain supplier + supplierStake := types.NewCoin("upokt", math.NewInt(1000000)) + defaultSupplier := sharedtypes.Supplier{ + OwnerAddress: supplierOperatorAddr.String(), + OperatorAddress: supplierOperatorAddr.String(), + Stake: &supplierStake, + Services: []*sharedtypes.SupplierServiceConfig{ + { + RevShare: []*sharedtypes.ServiceRevenueShare{ + { + Address: sample.AccAddress(), + RevSharePercentage: 100, + }, + }, + ServiceId: defaultService.Id, + }, + }, + } + supplierKeeper.SetSupplier(app.sdkCtx, defaultSupplier) + app.DefaultSupplier = &defaultSupplier + + // Create an application account with the corresponding keys in the keyring for the application. + app.DefaultApplicationKeyringUid = "application" + applicationAddr := testkeyring.CreateOnChainAccount( + app.sdkCtx, t, + app.DefaultApplicationKeyringUid, + app.keyRing, + accountKeeper, + app.preGeneratedAccts, + ) + + // Prepare the on-chain supplier + appStake := types.NewCoin("upokt", math.NewInt(1000000)) + defaultApplication := apptypes.Application{ + Address: applicationAddr.String(), + Stake: &appStake, + ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ + { + ServiceId: defaultService.Id, + }, + }, + } + applicationKeeper.SetApplication(app.sdkCtx, defaultApplication) + app.DefaultApplication = &defaultApplication + + // Construct a ringClient to get the application's ring & verify the relay + // request signature. + ringClient, err := rings.NewRingClient(depinject.Supply( + polyzero.NewLogger(), + prooftypes.NewAppKeeperQueryClient(applicationKeeper), + prooftypes.NewAccountKeeperQueryClient(accountKeeper), + prooftypes.NewSharedKeeperQueryClient(sharedKeeper, sessionKeeper), + )) + require.NoError(t, err) + app.ringClient = ringClient + + // TODO_IMPROVE: The setup above does not to proper "staking" of the suppliers and applications. + // This can result in the module accounts balance going negative. Giving them a baseline balance + // to start with to avoid this issue. There is opportunity to improve this in the future. + moduleBaseMint := types.NewCoins(sdk.NewCoin("upokt", math.NewInt(690000000000000042))) + err = bankKeeper.MintCoins(app.sdkCtx, suppliertypes.ModuleName, moduleBaseMint) + require.NoError(t, err) + err = bankKeeper.MintCoins(app.sdkCtx, apptypes.ModuleName, moduleBaseMint) + require.NoError(t, err) + + // TODO_IMPROVE: Refactor the relay_mining_difficulty_test.go to use the + // BaseIntegrationTestSuite and its #FundAddress() method and remove the + // need for this. + // + // Fund the supplier operator account to be able to submit proofs + fundAccount(t, app.sdkCtx, bankKeeper, supplierOperatorAddr, 100000000) +} + +// TODO_IN_THIS_COMMIT: godoc... +// +// TODO_IMPROVE: Eliminate usage of and remove this function in favor of +// integration.NewInitChainerModuleGenesisStateOptionFn. func fundAccount( t *testing.T, ctx context.Context, @@ -899,3 +935,21 @@ func fundAccount( coin := bankKeeper.SpendableCoin(ctx, supplierOperatorAddr, volatile.DenomuPOKT) require.Equal(t, coin.Amount, math.NewInt(amountUpokt)) } + +// TODO_IN_THIS_COMMIT: godoc... +func newFaucetInitChainerFn(faucetBech32 string, faucetAmtUpokt int64) InitChainerModuleFn { + return NewInitChainerModuleGenesisStateOptionFn[bank.AppModule](&banktypes.GenesisState{ + Params: banktypes.DefaultParams(), + Balances: []banktypes.Balance{ + { + Address: faucetBech32, + Coins: sdk.NewCoins( + sdk.NewInt64Coin( + volatile.DenomuPOKT, + faucetAmtUpokt, + ), + ), + }, + }, + }) +} diff --git a/testutil/integration/options.go b/testutil/integration/options.go index a88049c21..c3bef57dc 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -1,5 +1,12 @@ package integration +import ( + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/codec" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + var ( RunUntilNextBlockOpts = RunOptions{ WithAutomaticCommit(), @@ -57,3 +64,39 @@ func WithErrorAssertion(errAssertFn func(error)) RunOption { cfg.ErrorAssertion = errAssertFn } } + +// TODO_IN_THIS_COMMIT: godoc... +type IntegrationAppConfig struct { + InitChainerModuleFns []InitChainerModuleFn +} + +// TODO_IN_THIS_COMMIT: godoc... +type IntegrationAppOption func(*IntegrationAppConfig) + +// TODO_IN_THIS_COMMIT: godoc... +type InitChainerModuleFn func(cosmostypes.Context, codec.Codec, appmodule.AppModule) + +// TODO_IN_THIS_COMMIT: godoc... +func WithModuleGenesisState[T module.HasGenesis](genesisState cosmostypes.Msg) IntegrationAppOption { + return func(config *IntegrationAppConfig) { + config.InitChainerModuleFns = append( + config.InitChainerModuleFns, + NewInitChainerModuleGenesisStateOptionFn[T](genesisState), + ) + } +} + +// TODO_IN_THIS_COMMIT: godoc... +func NewInitChainerModuleGenesisStateOptionFn[T module.HasGenesis](genesisState cosmostypes.Msg) InitChainerModuleFn { + return func(ctx cosmostypes.Context, cdc codec.Codec, mod appmodule.AppModule) { + targetModule, isTypeT := mod.(T) + + // Bail if this isn't the module we're looking for. 👋 + if !isTypeT { + return + } + + genesisJSON := cdc.MustMarshalJSON(genesisState) + targetModule.InitGenesis(ctx, cdc, genesisJSON) + } +} From 45730d28d9d84c683db8dbfffe952ff5b75d51bc Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 18 Sep 2024 20:58:01 +0200 Subject: [PATCH 32/77] fixup: HEAD^ --- testutil/integration/suites/base_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index dca2b85ee..52a542d7e 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -46,7 +46,6 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetApp_PanicsIfNil() { s.GetApp() } -// TODO_INVESTIGATE: Why this test fails. func (s *BaseIntegrationSuiteTestSuite) TestNewApp() { require.Nil(s.T(), s.app) @@ -115,7 +114,8 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMat s.NewApp(s.T()) s.generateBankMsgSendEvents(expectedNumEvents) - // Filter for the unstake event. + // Filter for the "message" type event with "action" attribute value + // equal to the MsgSend TypeURL. msgSendTypeURL := cosmostypes.MsgTypeURL(&banktypes.MsgSend{}) matchedEvents := s.FilterLatestEvents(events.NewMsgEventMatchFn(msgSendTypeURL)) @@ -132,7 +132,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMa s.NewApp(s.T()) s.emitPoktrollGatewayUnstakedEvents(expectedNumEvents) - // Filter for the unstake event. + // Filter for the event with type equal to the EventGatewayUnstaked TypeURL. eventGatewayUnstakedTypeURL := cosmostypes.MsgTypeURL(&gatewaytypes.EventGatewayUnstaked{}) matchedEvents := s.FilterLatestEvents(events.NewEventTypeMatchFn(eventGatewayUnstakedTypeURL)) From 06aa65e95f74f306ffd8124966ada64e5d7aae97 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 10:34:57 +0200 Subject: [PATCH 33/77] chore: improvements & godoc comments --- testutil/events/filter.go | 6 +- testutil/integration/app.go | 172 +++++++++++++---------- testutil/integration/options.go | 95 ++++--------- testutil/integration/suites/base.go | 109 ++++++++------ testutil/integration/suites/base_test.go | 24 +++- testutil/integration/suites/interface.go | 25 ++-- 6 files changed, 232 insertions(+), 199 deletions(-) diff --git a/testutil/events/filter.go b/testutil/events/filter.go index c1edeb03f..e96ff33e3 100644 --- a/testutil/events/filter.go +++ b/testutil/events/filter.go @@ -49,7 +49,8 @@ func QuoteEventMode(event *abci.Event) { } } -// TODO_IN_THIS_COMMIT: godoc... +// NewMsgEventMatchFn returns a function that matches events whose type equals +// the given event (protobuf message) type URL. func NewMsgEventMatchFn(matchMsgTypeURL string) func(*cosmostypes.Event) bool { return func(event *cosmostypes.Event) bool { if event.Type != "message" { @@ -70,7 +71,8 @@ func NewMsgEventMatchFn(matchMsgTypeURL string) func(*cosmostypes.Event) bool { } } -// TODO_IN_THIS_COMMIT: godoc... +// NewEventTypeMatchFn returns a function that matches events whose type is "message" +// and whose "action" attribute matches the given message (protobuf message) type URL. func NewEventTypeMatchFn(matchEventType string) func(*cosmostypes.Event) bool { return func(event *cosmostypes.Event) bool { return strings.Trim(event.Type, "/") == strings.Trim(matchEventType, "/") diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 109b2c13b..dfd2f38bf 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -2,6 +2,8 @@ package integration import ( "context" + "errors" + "fmt" math2 "math" "testing" "time" @@ -152,7 +154,6 @@ func NewIntegrationApp( bApp.SetInterfaceRegistry(registry) - // TODO_IMPROVE: use moduleManager.ModuleNames() to populate allModuleNames. moduleManager := module.NewManagerFromMap(modules) basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) basicModuleManager.RegisterInterfaces(registry) @@ -221,7 +222,8 @@ func NewIntegrationApp( } // NewCompleteIntegrationApp creates a new instance of the App, abstracting out -// all of the internal details and complexities of the application setup. +// all the internal details and complexities of the application setup. +// // TODO_TECHDEBT: Not all of the modules are created here (e.g. minting module), // so it is up to the developer to add / improve / update this function over time // as the need arises. @@ -590,6 +592,17 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App preGeneratedAccts := testkeyring.PreGeneratedAccounts() integrationApp.preGeneratedAccts = preGeneratedAccts + // Construct a ringClient to get the application's ring & verify the relay + // request signature. + ringClient, err := rings.NewRingClient(depinject.Supply( + polyzero.NewLogger(), + prooftypes.NewAppKeeperQueryClient(applicationKeeper), + prooftypes.NewAccountKeeperQueryClient(accountKeeper), + prooftypes.NewSharedKeeperQueryClient(sharedKeeper, sessionKeeper), + )) + require.NoError(t, err) + integrationApp.ringClient = ringClient + // TODO_IMPROVE: Eliminate usage of and remove this function in favor of // integration.NewInitChainerModuleGenesisStateOptionFn. integrationApp.setupDefaultActorsState(t, @@ -598,8 +611,6 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App serviceKeeper, supplierKeeper, applicationKeeper, - sessionKeeper, - sharedKeeper, ) // Commit all the changes above by committing, finalizing and moving @@ -646,86 +657,107 @@ func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper { return app.queryHelper } -// RunMsg provides the ability to run a message and return the response. -// In order to run a message, the application must have a handler for it. -// These handlers are registered on the application message service router. -// The result of the message execution is returned as an Any type. -// That any type can be unmarshaled to the expected response type. -// If the message execution fails, an error is returned. -// -// TODO_IN_THIS_COMMIT: update comment... -func (app *App) RunMsg(t *testing.T, cfg *RunConfig, msgs ...sdk.Msg) (txMsgRes tx.MsgResponse) { +// RunMsg provides the ability to process a message by packing it into a tx and +// driving the ABCI through block finalization. It returns a tx.MsgResponse (any) +// which corresponds to the request message. It is a convenience method which wraps +// RunMsgs. +func (app *App) RunMsg(t *testing.T, msg sdk.Msg) (tx.MsgResponse, error) { t.Helper() - if cfg == nil { - cfg = new(RunConfig) - } + txMsgRes, err := app.RunMsgs(t, msg) + require.Equal(t, 1, len(txMsgRes), "expected exactly 1 tx msg response") + + return txMsgRes[0], err +} + +// RunMsgs provides the ability to process messages by packing them into a tx and +// driving the ABCI through block finalization. It returns a slice of tx.MsgResponse +// (any) which correspond to the request message of the same index. These responses +// can be type asserted to the expected response type. +// If execution for ANY message fails, ALL failing messages' errors are joined and +// returned. In order to run a message, the application must have a handler for it. +// These handlers are registered on the application message service router. +func (app *App) RunMsgs(t *testing.T, msgs ...sdk.Msg) (txMsgResps []tx.MsgResponse, err error) { + t.Helper() // Commit the updated state after the message has been handled. - var finalizedBlockResponse *abci.ResponseFinalizeBlock + var finalizeBlockRes *abci.ResponseFinalizeBlock defer func() { - _, err := app.Commit() - if cfg.ErrorAssertion != nil && err != nil { - cfg.ErrorAssertion(err) - } else { - require.NoError(t, err, "failed to commit") + if _, commitErr := app.Commit(); err != nil { + err = fmt.Errorf("committing state: %w", commitErr) + return } + app.nextBlockUpdateCtx() - // Emit events AFTER the context has been updated. - app.emitEvents(t, finalizedBlockResponse) + // Emit events MUST happen AFTER the context has been updated so that + // events are available on the context for the block after their actions + // were committed (e.g. msgs, begin/end block trigger). + app.emitEvents(t, finalizeBlockRes) }() // Package the message into a transaction. txBuilder := app.txCfg.NewTxBuilder() - err := txBuilder.SetMsgs(msgs...) - require.NoError(t, err) + if err = txBuilder.SetMsgs(msgs...); err != nil { + return nil, fmt.Errorf("setting tx messages: %w", err) + } - txBz, err := app.TxEncode(txBuilder.GetTx()) - require.NoError(t, err) + txBz, txErr := app.TxEncode(txBuilder.GetTx()) + if txErr != nil { + return nil, fmt.Errorf("encoding tx: %w", err) + } for _, msg := range msgs { app.logger.Info("Running msg", "msg", msg.String()) } // Finalize the block with the transaction. - finalizedBlockResponse, err = app.FinalizeBlock(&cmtabcitypes.RequestFinalizeBlock{ + finalizeBlockReq := &cmtabcitypes.RequestFinalizeBlock{ Height: app.LastBlockHeight() + 1, DecidedLastCommit: cmtabcitypes.CommitInfo{ Votes: []cmtabcitypes.VoteInfo{{}}, }, Txs: [][]byte{txBz}, - }) - - if cfg.ErrorAssertion != nil && err != nil { - cfg.ErrorAssertion(err) - return nil } - require.NoError(t, err, "failed to finalize block") - - if cfg.ErrorAssertion != nil { - cfg.ErrorAssertion(err) - return nil + finalizeBlockRes, err = app.FinalizeBlock(finalizeBlockReq) + if err != nil { + return nil, fmt.Errorf("finalizing block: %w", err) } - // TODO_IN_THIS_COMMIT: comment or improve... assume each tx has a single msg. - require.Equalf(t, 1, len(finalizedBlockResponse.TxResults), "expected 1 tx result, got %d", len(finalizedBlockResponse.TxResults)) + // NB: We're batching the messages in a single transaction, so we expect + // a single transaction result. + require.Equal(t, 1, len(finalizeBlockRes.TxResults)) + + // Collect the message responses. Accumulate errors related to message handling + // failure. If any message fails, an error will be returned. + var txResultErrs error + for _, txResult := range finalizeBlockRes.TxResults { + if !txResult.IsOK() { + err = fmt.Errorf("tx failed with log: %q", txResult.GetLog()) + errors.Join(txResultErrs, err) + continue + } - txResult := finalizedBlockResponse.TxResults[0] - require.Truef(t, txResult.IsOK(), "tx failed with log: %s", txResult.GetLog()) + txMsgDataBz := txResult.GetData() + require.NotNil(t, txMsgDataBz) - txMsgDataBz := txResult.GetData() - require.NotNil(t, txMsgDataBz) + txMsgData := new(cosmostypes.TxMsgData) + err = app.GetCodec().Unmarshal(txMsgDataBz, txMsgData) + require.NoError(t, err) - txMsgData := new(cosmostypes.TxMsgData) - err = app.GetCodec().Unmarshal(txMsgDataBz, txMsgData) + txMsgRes := new(tx.MsgResponse) + err = app.GetCodec().UnpackAny(txMsgData.MsgResponses[0], txMsgRes) + require.NoError(t, err) + require.NotNil(t, txMsgRes) - // TODO_IN_THIS_COMMIT: assumes only one msg per tx... - err = app.GetCodec().UnpackAny(txMsgData.MsgResponses[0], &txMsgRes) - require.NoError(t, err) - require.NotNil(t, txMsgRes) - return txMsgRes + txMsgResps = append(txMsgResps, txMsgRes) + } + if txResultErrs != nil { + return nil, err + } + + return txMsgResps, nil } // NextBlocks calls NextBlock numBlocks times @@ -792,18 +824,20 @@ func (app *App) nextBlockUpdateCtx() { Time: header.Time, } + // NB: Intentionally omitting the previous contexts EventManager. + // This ensures that each event is only observed for 1 block. newContext := app.NewUncachedContext(true, header). WithBlockHeader(header). WithHeaderInfo(headerInfo). - // TODO_IN_THIS_COMMIT: should we really be doing this? - //WithEventManager(prevCtx.EventManager()). // Pass the multi-store to the new context, otherwise the new context will // create a new multi-store. WithMultiStore(prevCtx.MultiStore()) *app.sdkCtx = newContext } -// TODO_IN_THIS_COMMIT: godoc... +// setupDefaultActorsState uses the integration app keepers to stake "default" +// on-chain actors for use in tests. In creates a service, and stakes a supplier +// and application as well as funding the bank balance of both accounts. // // TODO_IMPROVE: Eliminate usage of and remove this function in favor of // integration.NewInitChainerModuleGenesisStateOptionFn. @@ -814,8 +848,6 @@ func (app *App) setupDefaultActorsState( serviceKeeper servicekeeper.Keeper, supplierKeeper supplierkeeper.Keeper, applicationKeeper appkeeper.Keeper, - sessionKeeper sessionkeeper.Keeper, - sharedKeeper sharedkeeper.Keeper, ) { t.Helper() @@ -870,7 +902,7 @@ func (app *App) setupDefaultActorsState( app.preGeneratedAccts, ) - // Prepare the on-chain supplier + // Prepare the on-chain application appStake := types.NewCoin("upokt", math.NewInt(1000000)) defaultApplication := apptypes.Application{ Address: applicationAddr.String(), @@ -884,22 +916,11 @@ func (app *App) setupDefaultActorsState( applicationKeeper.SetApplication(app.sdkCtx, defaultApplication) app.DefaultApplication = &defaultApplication - // Construct a ringClient to get the application's ring & verify the relay - // request signature. - ringClient, err := rings.NewRingClient(depinject.Supply( - polyzero.NewLogger(), - prooftypes.NewAppKeeperQueryClient(applicationKeeper), - prooftypes.NewAccountKeeperQueryClient(accountKeeper), - prooftypes.NewSharedKeeperQueryClient(sharedKeeper, sessionKeeper), - )) - require.NoError(t, err) - app.ringClient = ringClient - // TODO_IMPROVE: The setup above does not to proper "staking" of the suppliers and applications. // This can result in the module accounts balance going negative. Giving them a baseline balance // to start with to avoid this issue. There is opportunity to improve this in the future. moduleBaseMint := types.NewCoins(sdk.NewCoin("upokt", math.NewInt(690000000000000042))) - err = bankKeeper.MintCoins(app.sdkCtx, suppliertypes.ModuleName, moduleBaseMint) + err := bankKeeper.MintCoins(app.sdkCtx, suppliertypes.ModuleName, moduleBaseMint) require.NoError(t, err) err = bankKeeper.MintCoins(app.sdkCtx, apptypes.ModuleName, moduleBaseMint) require.NoError(t, err) @@ -912,7 +933,7 @@ func (app *App) setupDefaultActorsState( fundAccount(t, app.sdkCtx, bankKeeper, supplierOperatorAddr, 100000000) } -// TODO_IN_THIS_COMMIT: godoc... +// fundAccount mints and sends amountUpokt tokens to the given recipientAddr. // // TODO_IMPROVE: Eliminate usage of and remove this function in favor of // integration.NewInitChainerModuleGenesisStateOptionFn. @@ -920,7 +941,7 @@ func fundAccount( t *testing.T, ctx context.Context, bankKeeper bankkeeper.Keeper, - supplierOperatorAddr sdk.AccAddress, + recipientAddr sdk.AccAddress, amountUpokt int64, ) { @@ -929,14 +950,15 @@ func fundAccount( err := bankKeeper.MintCoins(ctx, banktypes.ModuleName, fundingCoins) require.NoError(t, err) - err = bankKeeper.SendCoinsFromModuleToAccount(ctx, banktypes.ModuleName, supplierOperatorAddr, fundingCoins) + err = bankKeeper.SendCoinsFromModuleToAccount(ctx, banktypes.ModuleName, recipientAddr, fundingCoins) require.NoError(t, err) - coin := bankKeeper.SpendableCoin(ctx, supplierOperatorAddr, volatile.DenomuPOKT) + coin := bankKeeper.SpendableCoin(ctx, recipientAddr, volatile.DenomuPOKT) require.Equal(t, coin.Amount, math.NewInt(amountUpokt)) } -// TODO_IN_THIS_COMMIT: godoc... +// newFaucetInitChainerFn returns an InitChainerModuleFn that initializes the bank module +// with a genesis state which contains a faucet account that has faucetAmtUpokt coins. func newFaucetInitChainerFn(faucetBech32 string, faucetAmtUpokt int64) InitChainerModuleFn { return NewInitChainerModuleGenesisStateOptionFn[bank.AppModule](&banktypes.GenesisState{ Params: banktypes.DefaultParams(), diff --git a/testutil/integration/options.go b/testutil/integration/options.go index c3bef57dc..b96847189 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -7,86 +7,45 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" ) -var ( - RunUntilNextBlockOpts = RunOptions{ - WithAutomaticCommit(), - WithAutomaticFinalizeBlock(), - } -) - -// RunConfig is the configuration for the testing integration app. -type RunConfig struct { - AutomaticFinalizeBlock bool - AutomaticCommit bool - ErrorAssertion func(error) -} - -// RunOption is a function that can be used to configure the integration app. -type RunOption func(*RunConfig) - -// RunOptions is a list of RunOption. It implements the Append method for convenience. -type RunOptions []RunOption - -func (runOpts RunOptions) Config() *RunConfig { - cfg := &RunConfig{} - - for _, opt := range runOpts { - opt(cfg) - } - - return cfg -} - -// Append returns a new RunOptions with the given RunOptions appended. -func (runOpts RunOptions) Append(newRunOpts ...RunOption) RunOptions { - return append(runOpts, newRunOpts...) -} - -// WithAutomaticFinalizeBlock calls ABCI finalize block. -func WithAutomaticFinalizeBlock() RunOption { - return func(cfg *RunConfig) { - cfg.AutomaticFinalizeBlock = true - } -} - -// WithAutomaticCommit enables automatic commit. -// This means that the integration app will automatically commit the state after each msg. -func WithAutomaticCommit() RunOption { - return func(cfg *RunConfig) { - cfg.AutomaticCommit = true - } -} - -// WithErrorAssertion registers an error assertion function which is called when -// RunMsg() encounters an error. -func WithErrorAssertion(errAssertFn func(error)) RunOption { - return func(cfg *RunConfig) { - cfg.ErrorAssertion = errAssertFn - } -} - -// TODO_IN_THIS_COMMIT: godoc... +// IntegrationAppConfig is a configuration struct for an integration App. Its fields +// are intended to be set/updated by IntegrationAppOption functions which are passed +// during integration App construction. type IntegrationAppConfig struct { + // InitChainerModuleFns are called for each module during the integration App's + // InitChainer function. InitChainerModuleFns []InitChainerModuleFn } -// TODO_IN_THIS_COMMIT: godoc... +// IntegrationAppOption is a function that receives and has the opportunity to +// modify the IntegrationAppConfig. It is intended to be passed during integration +// App construction to modify the behavior of the integration App. type IntegrationAppOption func(*IntegrationAppConfig) -// TODO_IN_THIS_COMMIT: godoc... +// InitChainerModuleFn is a function that is called for each module during the +// integration App's InitChainer function. type InitChainerModuleFn func(cosmostypes.Context, codec.Codec, appmodule.AppModule) -// TODO_IN_THIS_COMMIT: godoc... -func WithModuleGenesisState[T module.HasGenesis](genesisState cosmostypes.Msg) IntegrationAppOption { +// WithInitChainerModuleFn returns an IntegrationAppOption that appends the given +// InitChainerModuleFn to the IntegrationAppConfig's InitChainerModuleFns. +func WithInitChainerModuleFn(fn InitChainerModuleFn) IntegrationAppOption { return func(config *IntegrationAppConfig) { - config.InitChainerModuleFns = append( - config.InitChainerModuleFns, - NewInitChainerModuleGenesisStateOptionFn[T](genesisState), - ) + config.InitChainerModuleFns = append(config.InitChainerModuleFns, fn) } } -// TODO_IN_THIS_COMMIT: godoc... +// WithModuleGenesisState returns an IntegrationAppOption that appends an +// InitChainerModuleFn to the IntegrationAppConfig's InitChainerModuleFns which +// initializes the module's genesis state with the given genesisState. T is expected +// to be the module's AppModule type. +func WithModuleGenesisState[T module.HasGenesis](genesisState cosmostypes.Msg) IntegrationAppOption { + return WithInitChainerModuleFn( + NewInitChainerModuleGenesisStateOptionFn[T](genesisState), + ) +} + +// NewInitChainerModuleGenesisStateOptionFn returns an InitChainerModuleFn that +// initializes the module's genesis state with the given genesisState. T is expected +// to be the module's AppModule type. func NewInitChainerModuleGenesisStateOptionFn[T module.HasGenesis](genesisState cosmostypes.Msg) InitChainerModuleFn { return func(ctx cosmostypes.Context, cdc codec.Codec, mod appmodule.AppModule) { targetModule, isTypeT := mod.(T) diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 028788ad3..a4328566a 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -3,39 +3,24 @@ package suites import ( + "reflect" "strings" "testing" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/codec" cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/app/volatile" - "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/pkg/polylog" + _ "github.com/pokt-network/poktroll/pkg/polylog/polyzero" "github.com/pokt-network/poktroll/testutil/integration" - apptypes "github.com/pokt-network/poktroll/x/application/types" - gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" - prooftypes "github.com/pokt-network/poktroll/x/proof/types" - servicetypes "github.com/pokt-network/poktroll/x/service/types" - sessiontypes "github.com/pokt-network/poktroll/x/session/types" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -// TODO_IMPROVE: Ideally this list should be populated during integration app construction. -var allPoktrollModuleNames = []string{ - sharedtypes.ModuleName, - sessiontypes.ModuleName, - servicetypes.ModuleName, - apptypes.ModuleName, - gatewaytypes.ModuleName, - suppliertypes.ModuleName, - prooftypes.ModuleName, - tokenomicstypes.ModuleName, -} - var _ IntegrationSuite = (*BaseIntegrationSuite)(nil) // BaseIntegrationSuite is a base implementation of IntegrationSuite. @@ -44,14 +29,17 @@ type BaseIntegrationSuite struct { suite.Suite app *integration.App - appQueryClient client.ApplicationQueryClient + poktrollModuleNames []string + cosmosModuleNames []string } // NewApp constructs a new integration app and sets it on the suite. -func (s *BaseIntegrationSuite) NewApp(t *testing.T) *integration.App { +func (s *BaseIntegrationSuite) NewApp(t *testing.T, opts ...integration.IntegrationAppOption) *integration.App { t.Helper() - s.app = integration.NewCompleteIntegrationApp(t) + defaultIntegrationAppOption := integration.WithInitChainerModuleFn(newInitChainerCollectModuleNamesFn(s)) + opts = append([]integration.IntegrationAppOption{defaultIntegrationAppOption}, opts...) + s.app = integration.NewCompleteIntegrationApp(t, opts...) return s.app } @@ -68,9 +56,16 @@ func (s *BaseIntegrationSuite) GetApp() *integration.App { return s.app } -// GetModuleNames returns the list of all poktroll modules names in the integration app. -func (s *BaseIntegrationSuite) GetModuleNames() []string { - return allPoktrollModuleNames +// GetPoktrollModuleNames returns the list of the names of all poktroll modules +// in the integration app. +func (s *BaseIntegrationSuite) GetPoktrollModuleNames() []string { + return s.poktrollModuleNames +} + +// GetCosmosModuleNames returns the list of the names of all cosmos-sdk modules +// in the integration app. +func (s *BaseIntegrationSuite) GetCosmosModuleNames() []string { + return s.cosmosModuleNames } // SdkCtx returns the integration app's SDK context. @@ -84,9 +79,7 @@ func (s *BaseIntegrationSuite) FundAddress( t *testing.T, addr cosmostypes.AccAddress, amountUpokt int64, - runOpts ...integration.RunOption, ) { - opts := integration.RunOptions(runOpts) coinUpokt := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, amountUpokt) sendMsg := &banktypes.MsgSend{ FromAddress: integration.FaucetAddrStr, @@ -94,23 +87,32 @@ func (s *BaseIntegrationSuite) FundAddress( Amount: cosmostypes.NewCoins(coinUpokt), } - txMsgRes := s.GetApp().RunMsg(t, opts.Config(), sendMsg) + txMsgRes, err := s.GetApp().RunMsg(t, sendMsg) + require.NoError(t, err) require.NotNil(t, txMsgRes) // NB: no use in returning sendRes because it has no fields. } +// GetBankQueryClient constructs and returns a query client for the bank module +// of the integration app. func (s *BaseIntegrationSuite) GetBankQueryClient() banktypes.QueryClient { return banktypes.NewQueryClient(s.GetApp().QueryHelper()) } -// TODO_IN_THIS_COMMIT: godoc... -func (s *BaseIntegrationSuite) FilterLatestEvents(matchFn func(*cosmostypes.Event) bool) (matchedEvents []*cosmostypes.Event) { +// FilterLatestEvents returns the most recent events in the event manager that +// match the given matchFn. +func (s *BaseIntegrationSuite) FilterLatestEvents( + matchFn func(*cosmostypes.Event) bool, +) (matchedEvents []*cosmostypes.Event) { return s.filterEvents(matchFn, false) } -// TODO_IN_THIS_COMMIT: godoc... -func (s *BaseIntegrationSuite) LatestMatchingEvent(matchFn func(*cosmostypes.Event) bool) (matchedEvent *cosmostypes.Event) { +// LatestMatchingEvent returns the most recent event in the event manager that +// matches the given matchFn. +func (s *BaseIntegrationSuite) LatestMatchingEvent( + matchFn func(*cosmostypes.Event) bool, +) (matchedEvent *cosmostypes.Event) { filteredEvents := s.filterEvents(matchFn, true) if len(filteredEvents) < 1 { @@ -120,8 +122,13 @@ func (s *BaseIntegrationSuite) LatestMatchingEvent(matchFn func(*cosmostypes.Eve return filteredEvents[0] } -// TODO_IN_THIS_COMMIT: godoc... -func (s *BaseIntegrationSuite) GetAttributeValue(event *cosmostypes.Event, key string) (value string, hasAttr bool) { +// GetAttributeValue returns the value of the attribute with the given key in the +// event. The returned attribute value is trimmed of any quotation marks. If the +// attribute does not exist, hasAttr is false. +func (s *BaseIntegrationSuite) GetAttributeValue( + event *cosmostypes.Event, + key string, +) (value string, hasAttr bool) { attr, hasAttr := event.GetAttribute(key) if !hasAttr { return "", false @@ -130,7 +137,9 @@ func (s *BaseIntegrationSuite) GetAttributeValue(event *cosmostypes.Event, key s return strings.Trim(attr.GetValue(), "\""), true } -// TODO_IN_THIS_COMMIT: godoc... +// filterEvents returns the events from the event manager that match the given matchFn. +// If latestOnly is true, then only the most recent matching event is returned. +// // TODO_IMPROVE: consolidate with testutil/events/filter.go func (s *BaseIntegrationSuite) filterEvents( matchFn func(*cosmostypes.Event) bool, @@ -138,10 +147,8 @@ func (s *BaseIntegrationSuite) filterEvents( ) (matchedEvents []*cosmostypes.Event) { events := s.GetApp().GetSdkCtx().EventManager().Events() - // TODO_IN_THIS_COMMIT: comment about why reverse order and/or figure out why events accumulate across blocks. + // NB: Iterate in reverse to get the latest events first. for i := len(events) - 1; i >= 0; i-- { - // TODO_IN_THIS_COMMIT: double-check that there's no issue here with - // pointing to a variable which is reused by the loop. event := events[i] if !matchFn(&event) { @@ -157,3 +164,25 @@ func (s *BaseIntegrationSuite) filterEvents( return matchedEvents } + +// newInitChainerCollectModuleNamesFn returns an InitChainerModuleFn that collects +// the names of cosmos and poktroll modules in their respective suite field slices. +func newInitChainerCollectModuleNamesFn(suite *BaseIntegrationSuite) integration.InitChainerModuleFn { + return func(ctx cosmostypes.Context, cdc codec.Codec, mod appmodule.AppModule) { + modName, hasName := mod.(module.HasName) + if !hasName { + polylog.DefaultContextLogger.Warn().Msg("unable to get module name") + } + + modType := reflect.TypeOf(mod) + if strings.Contains(modType.PkgPath(), "poktroll") { + suite.poktrollModuleNames = append(suite.poktrollModuleNames, modName.Name()) + return + } + + // NB: We can assume that any non-poktroll module is a cosmos-sdk module + // so long as we're not importing any third-party modules; in which case, + // we would have to add another check above. + suite.cosmosModuleNames = append(suite.cosmosModuleNames, modName.Name()) + } +} diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index 52a542d7e..dfb805153 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -68,9 +68,16 @@ func (s *BaseIntegrationSuiteTestSuite) TestSetApp() { require.Same(s.T(), app, s.app) } -func (s *BaseIntegrationSuiteTestSuite) TestGetModuleNames() { - moduleNames := s.GetModuleNames() - require.ElementsMatch(s.T(), allPoktrollModuleNames, moduleNames) +func (s *BaseIntegrationSuiteTestSuite) TestGetPoktrollModuleNames() { + moduleNames := s.GetPoktrollModuleNames() + require.Greater(s.T(), len(moduleNames), 0, "expected non-empty module names") + require.ElementsMatch(s.T(), s.poktrollModuleNames, moduleNames) +} + +func (s *BaseIntegrationSuiteTestSuite) TestGetCosmosModuleNames() { + moduleNames := s.GetCosmosModuleNames() + require.Greater(s.T(), len(moduleNames), 0, "expected non-empty module names") + require.ElementsMatch(s.T(), s.cosmosModuleNames, moduleNames) } func (s *BaseIntegrationSuiteTestSuite) TestSdkCtx() { @@ -163,7 +170,9 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { require.Equal(s.T(), banktypes.ModuleName, value) } -// TODO_IN_THIS_COMMIT: godoc... +// generateBankMsgSendEvents causes the bank module to emit events as the result +// of handling a MsgSend message which are intended to be used to make assertions +// in tests. func (s *BaseIntegrationSuiteTestSuite) generateBankMsgSendEvents(expectedNumEvents int) { msgs := make([]cosmostypes.Msg, 0) @@ -182,10 +191,13 @@ func (s *BaseIntegrationSuiteTestSuite) generateBankMsgSendEvents(expectedNumEve msgs = append(msgs, sendMsg) } - s.GetApp().RunMsg(s.T(), nil, msgs...) + _, err := s.GetApp().RunMsgs(s.T(), msgs...) + require.NoError(s.T(), err) } -// TODO_IN_THIS_COMMIT: godoc... +// emitPoktrollGatewayUnstakedEvents emits the given number of EventGatewayUnstaked +// events to the event manager. These events are intended to be used to make +// assertions in tests. func (s *BaseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expectedNumEvents int) { for i := 0; i < expectedNumEvents; i++ { err := s.SdkCtx().EventManager().EmitTypedEvent(&gatewaytypes.EventGatewayUnstaked{ diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index de46eee50..54555c6ce 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -15,25 +15,34 @@ import ( // exercise an integration.App. type IntegrationSuite interface { // NewApp constructs a new integration app and sets it on the suite. - NewApp(*testing.T) *integration.App + NewApp(*testing.T, ...integration.IntegrationAppOption) *integration.App // SetApp sets the integration app on the suite. SetApp(*integration.App) // GetApp returns the integration app from the suite. GetApp() *integration.App - // GetModuleNames returns the list of all poktroll modules names in the integration app. - GetModuleNames() []string + // GetPoktrollModuleNames returns the list of the names of all poktroll modules + // in the integration app. + GetPoktrollModuleNames() []string + // GetCosmosModuleNames returns the list of the names of all cosmos-sdk modules + // in the integration app. + GetCosmosModuleNames() []string // SdkCtx returns the integration app's SDK context. SdkCtx() *cosmostypes.Context // FundAddress sends amtUpokt coins from the faucet to the given address. - FundAddress(t *testing.T, addr cosmostypes.AccAddress, amtUpokt int64, opts ...integration.RunOption) - // GetBankQueryClient returns a query client for the bank module of the integration app + FundAddress(t *testing.T, addr cosmostypes.AccAddress, amtUpokt int64) + // GetBankQueryClient constructs and returns a query client for the bank module + // of the integration app. GetBankQueryClient() banktypes.QueryClient - // TODO_IN_THIS_COMMIT: godoc... + // FilterLatestEvents returns the most recent events in the event manager that + // match the given matchFn. FilterLatestEvents(matchFn func(*cosmostypes.Event) bool) []*cosmostypes.Event - // TODO_IN_THIS_COMMIT: godoc... + // LatestMatchingEvent returns the most recent event in the event manager that + // matches the given matchFn. LatestMatchingEvent(matchFn func(*cosmostypes.Event) bool) *cosmostypes.Event - // TODO_IN_THIS_COMMIT: godoc... + // GetAttributeValue returns the value of the attribute with the given key in the + // event. The returned attribute value is trimmed of any quotation marks. If the + // attribute does not exist, hasAttr is false. GetAttributeValue(event *cosmostypes.Event, key string) (value string, hasAttr bool) } From 907b5c338d78f6248d47685adf8cb29986178d21 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 11:56:08 +0200 Subject: [PATCH 34/77] fix: tokenomics tests, RunMsgs, & NextBlock() --- .../relay_mining_difficulty_test.go | 14 +++------- .../tokenomics/tokenomics_example_test.go | 22 ++++++---------- testutil/integration/app.go | 26 +++++++++++++++---- testutil/keeper/tokenomics.go | 4 +-- testutil/sample/sample.go | 15 ++++++++--- .../keeper_settle_pending_claims_test.go | 2 +- .../keeper/token_logic_modules_test.go | 2 +- 7 files changed, 49 insertions(+), 36 deletions(-) diff --git a/tests/integration/tokenomics/relay_mining_difficulty_test.go b/tests/integration/tokenomics/relay_mining_difficulty_test.go index 6e7b86f2a..cf9691e3e 100644 --- a/tests/integration/tokenomics/relay_mining_difficulty_test.go +++ b/tests/integration/tokenomics/relay_mining_difficulty_test.go @@ -72,11 +72,8 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) SessionHeader: session.Header, RootHash: trie.Root(), } - result := integrationApp.RunMsg(t, - &createClaimMsg, - integration.WithAutomaticFinalizeBlock(), - integration.WithAutomaticCommit(), - ) + result, err := integrationApp.RunMsg(t, &createClaimMsg) + require.NoError(t, err) require.NotNil(t, result, "unexpected nil result when submitting a MsgCreateClaim tx") // Wait until the proof window is open @@ -91,11 +88,8 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) SessionHeader: session.Header, Proof: getProof(t, trie, proofPathSeedBlockHash, session.GetHeader().GetSessionId()), } - result = integrationApp.RunMsg(t, - &createProofMsg, - integration.WithAutomaticFinalizeBlock(), - integration.WithAutomaticCommit(), - ) + result, err = integrationApp.RunMsg(t, &createProofMsg) + require.NoError(t, err) require.NotNil(t, result, "unexpected nil result when submitting a MsgSubmitProof tx") // Wait until the proof window is closed diff --git a/tests/integration/tokenomics/tokenomics_example_test.go b/tests/integration/tokenomics/tokenomics_example_test.go index fbd611e3e..99b6d90ec 100644 --- a/tests/integration/tokenomics/tokenomics_example_test.go +++ b/tests/integration/tokenomics/tokenomics_example_test.go @@ -46,18 +46,15 @@ func TestTokenomicsIntegrationExample(t *testing.T) { } // Run the request - result := integrationApp.RunMsg(t, - updateTokenomicsParamMsg, - integration.WithAutomaticFinalizeBlock(), - integration.WithAutomaticCommit(), - ) + result, err := integrationApp.RunMsg(t, updateTokenomicsParamMsg) + require.NoError(t, err) require.NotNil(t, result, "unexpected nil result") + updateTokenomicsParamRes, ok := result.(*tokenomicstypes.MsgUpdateParamResponse) + require.True(t, ok) + // Validate the response is correct and that the value was updated - updateTokenomicsParamRes := tokenomicstypes.MsgUpdateParamResponse{} - err = integrationApp.GetCodec().Unmarshal(result.Value, &updateTokenomicsParamRes) - require.NoError(t, err) - require.EqualValues(t, uint64(11), uint64(updateTokenomicsParamRes.Params.ComputeUnitsToTokensMultiplier)) + require.EqualValues(t, uint64(11), updateTokenomicsParamRes.Params.ComputeUnitsToTokensMultiplier) // Prepare a request to query a session so it can be used to create a claim. sessionQueryClient := sessiontypes.NewQueryClient(integrationApp.QueryHelper()) @@ -99,10 +96,7 @@ func TestTokenomicsIntegrationExample(t *testing.T) { } // Run the message to create the claim - result = integrationApp.RunMsg(t, - &createClaimMsg, - integration.WithAutomaticFinalizeBlock(), - integration.WithAutomaticCommit(), - ) + result, err = integrationApp.RunMsg(t, &createClaimMsg) + require.NoError(t, err) require.NotNil(t, result, "unexpected nil result") } diff --git a/testutil/integration/app.go b/testutil/integration/app.go index dfd2f38bf..c725a6837 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -168,7 +168,7 @@ func NewIntegrationApp( WithEventManager(cosmostypes.NewEventManager()) // Add a block proposer address to the context - valAddr, err := cosmostypes.ValAddressFromBech32(sample.ConsAddress()) + valAddr, err := cosmostypes.ValAddressFromBech32(sample.ValAddress()) require.NoError(t, err) consensusAddr := cosmostypes.ConsAddress(valAddr) sdkCtx = sdkCtx.WithProposer(consensusAddr) @@ -714,6 +714,8 @@ func (app *App) RunMsgs(t *testing.T, msgs ...sdk.Msg) (txMsgResps []tx.MsgRespo // Finalize the block with the transaction. finalizeBlockReq := &cmtabcitypes.RequestFinalizeBlock{ Height: app.LastBlockHeight() + 1, + // Randomize the proposer address for each block. + ProposerAddress: newProposerAddrBz(t), DecidedLastCommit: cmtabcitypes.CommitInfo{ Votes: []cmtabcitypes.VoteInfo{{}}, }, @@ -746,8 +748,8 @@ func (app *App) RunMsgs(t *testing.T, msgs ...sdk.Msg) (txMsgResps []tx.MsgRespo err = app.GetCodec().Unmarshal(txMsgDataBz, txMsgData) require.NoError(t, err) - txMsgRes := new(tx.MsgResponse) - err = app.GetCodec().UnpackAny(txMsgData.MsgResponses[0], txMsgRes) + var txMsgRes tx.MsgResponse + err = app.GetCodec().UnpackAny(txMsgData.MsgResponses[0], &txMsgRes) require.NoError(t, err) require.NotNil(t, txMsgRes) @@ -796,15 +798,20 @@ func (app *App) NextBlock(t *testing.T) { finalizedBlockResponse, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: app.sdkCtx.BlockHeight(), Time: app.sdkCtx.BlockTime(), + // Randomize the proposer address for each block. + ProposerAddress: newProposerAddrBz(t), }) - require.NoError(t, err) - app.emitEvents(t, finalizedBlockResponse) _, err = app.Commit() require.NoError(t, err) app.nextBlockUpdateCtx() + + // Emit events MUST happen AFTER the context has been updated so that + // events are available on the context for the block after their actions + // were committed (e.g. msgs, begin/end block trigger). + app.emitEvents(t, finalizedBlockResponse) } // nextBlockUpdateCtx is responsible for updating the app's (receiver) context @@ -975,3 +982,12 @@ func newFaucetInitChainerFn(faucetBech32 string, faucetAmtUpokt int64) InitChain }, }) } + +// newProposerAddrBz returns a random proposer address in bytes. +func newProposerAddrBz(t *testing.T) []byte { + bech32 := sample.ConsAddress() + addr, err := cosmostypes.ConsAddressFromBech32(bech32) + require.NoError(t, err) + + return addr.Bytes() +} diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index d9e9f7d4a..d75e7d2e8 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -235,7 +235,7 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( sdkCtx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) // Add a block proposer address to the context - valAddr, err := cosmostypes.ValAddressFromBech32(sample.ConsAddress()) + valAddr, err := cosmostypes.ValAddressFromBech32(sample.ValAddress()) require.NoError(t, err) consensusAddr := cosmostypes.ConsAddress(valAddr) sdkCtx = sdkCtx.WithProposer(consensusAddr) @@ -282,7 +282,7 @@ func NewTokenomicsModuleKeepers( sdkCtx := sdk.UnwrapSDKContext(ctx) // Add a block proposer address to the context - valAddr, err := cosmostypes.ValAddressFromBech32(sample.ConsAddress()) + valAddr, err := cosmostypes.ValAddressFromBech32(sample.ValAddress()) require.NoError(t, err) consensusAddr := cosmostypes.ConsAddress(valAddr) sdkCtx = sdkCtx.WithProposer(consensusAddr) diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index fe3561040..e29c328a1 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -30,12 +30,21 @@ func AccAddressAndPubKeyEd25519() (string, cryptotypes.PubKey) { return sdk.AccAddress(addr).String(), pk } -// ConsAddress returns a sample consensus address, which has the prefix -// of validators (i.e. consensus nodes) when converted to bech32. +// ValAddress returns a sample validator address, which has the prefix +// of validators when converted to bech32. +func ValAddress() string { + _, pk := AccAddressAndPubKey() + validatorAddress := tmhash.SumTruncated(pk.Address()) + valAddress := sdk.ValAddress(validatorAddress) + return valAddress.String() +} + +// ConsAddress returns a sample consensus node address, which has the prefix +// of consensus nodes when converted to bech32. func ConsAddress() string { _, pk := AccAddressAndPubKey() consensusAddress := tmhash.SumTruncated(pk.Address()) - valAddress := sdk.ValAddress(consensusAddress) + valAddress := sdk.ConsAddress(consensusAddress) return valAddress.String() } diff --git a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index 5f7376e94..774951b2f 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -61,7 +61,7 @@ func (s *TestSuite) SetupTest() { sdkCtx := cosmostypes.UnwrapSDKContext(s.ctx).WithBlockHeight(1) // Add a block proposer address to the context - valAddr, err := cosmostypes.ValAddressFromBech32(sample.ConsAddress()) + valAddr, err := cosmostypes.ValAddressFromBech32(sample.ValAddress()) require.NoError(t, err) consensusAddr := cosmostypes.ConsAddress(valAddr) sdkCtx = sdkCtx.WithProposer(consensusAddr) diff --git a/x/tokenomics/keeper/token_logic_modules_test.go b/x/tokenomics/keeper/token_logic_modules_test.go index 2f6d6bdfd..7fced654b 100644 --- a/x/tokenomics/keeper/token_logic_modules_test.go +++ b/x/tokenomics/keeper/token_logic_modules_test.go @@ -322,7 +322,7 @@ func TestProcessTokenLogicModules_TLMGlobalMint_Valid_MintDistributionCorrect(t service := prepareTestService(serviceComputeUnitsPerRelay) numRelays := uint64(1000) // By supplier for application in this session numTokensClaimed := float64(numRelays * serviceComputeUnitsPerRelay * globalComputeUnitsToTokensMultiplier) - validatorConsAddr := sample.ConsAddress() + validatorConsAddr := sample.ValAddress() // Prepare the keepers keepers, ctx := testkeeper.NewTokenomicsModuleKeepers(t, nil, testkeeper.WithService(*service), testkeeper.WithProposerAddr(validatorConsAddr)) From fb1c61bb6925bb451c28f4325c3132f8275cad72 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 12:31:01 +0200 Subject: [PATCH 35/77] chore: self-review improvements --- testutil/integration/app.go | 53 +++++++++++++----------- testutil/integration/suites/base_test.go | 14 ++++--- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index c725a6837..4aff1d208 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -109,6 +109,7 @@ type App struct { sdkCtx *sdk.Context cdc codec.Codec logger log.Logger + txCfg client.TxConfig authority sdk.AccAddress moduleManager module.Manager queryHelper *baseapp.QueryServiceTestHelper @@ -116,11 +117,11 @@ type App struct { ringClient crypto.RingClient preGeneratedAccts *testkeyring.PreGeneratedAccountIterator - txCfg client.TxConfig - // Some default helper fixtures for general testing. // They're publicly exposed and should/could be improved and expand on // over time. + // + // TODO_IMPROVE: Refactor into a DefaultActorsIntegrationSuite test suite. DefaultService *sharedtypes.Service DefaultApplication *apptypes.Application DefaultApplicationKeyringUid string @@ -179,10 +180,13 @@ func NewIntegrationApp( bApp.SetInitChainer( func(ctx sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) { for _, mod := range modules { + // Set each module's genesis state to the default. This MAY be + // overridden via the InitChainerModuleFns option. if m, ok := mod.(module.HasGenesis); ok { m.InitGenesis(ctx, cdc, m.DefaultGenesis(cdc)) } + // Call each of the InitChainerModuleFns for each module. for _, fn := range cfg.InitChainerModuleFns { fn(ctx, cdc, mod) } @@ -230,20 +234,19 @@ func NewIntegrationApp( func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App { t.Helper() + // Prepare & register the codec for all the interfaces sdkCfg := cosmostypes.GetConfig() addrCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32AccountAddrPrefix()) valCodec := addresscodec.NewBech32Codec(sdkCfg.GetBech32ValidatorAddrPrefix()) - - // Prepare & register the codec for all the interfaces - registry, err := codectypes.NewInterfaceRegistryWithOptions( - codectypes.InterfaceRegistryOptions{ - ProtoFiles: proto.HybridResolver, - SigningOptions: signing.Options{ - AddressCodec: addrCodec, - ValidatorAddressCodec: valCodec, - }, - }, - ) + signingOpts := signing.Options{ + AddressCodec: addrCodec, + ValidatorAddressCodec: valCodec, + } + registryOpts := codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signingOpts, + } + registry, err := codectypes.NewInterfaceRegistryWithOptions(registryOpts) require.NoError(t, err) banktypes.RegisterInterfaces(registry) @@ -613,10 +616,6 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App applicationKeeper, ) - // Commit all the changes above by committing, finalizing and moving - // to the next block. - integrationApp.NextBlock(t) - return integrationApp } @@ -672,8 +671,8 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg) (tx.MsgResponse, error) { // RunMsgs provides the ability to process messages by packing them into a tx and // driving the ABCI through block finalization. It returns a slice of tx.MsgResponse -// (any) which correspond to the request message of the same index. These responses -// can be type asserted to the expected response type. +// (any) whose elements correspond to the request message of the same index. These +// responses can be type asserted to the expected response type. // If execution for ANY message fails, ALL failing messages' errors are joined and // returned. In order to run a message, the application must have a handler for it. // These handlers are registered on the application message service router. @@ -771,17 +770,19 @@ func (app *App) NextBlocks(t *testing.T, numBlocks int) { } } -// emitEvents emits the events from the finalized block to the event manager -// of the context in the active app. +// emitEvents emits the events from the finalized block such that they are available +// via the current context's event manager (i.e. app.GetSdkCtx().EventManager.Events()). func (app *App) emitEvents(t *testing.T, res *abci.ResponseFinalizeBlock) { t.Helper() + // Emit begin/end blocker events. for _, event := range res.Events { testutilevents.QuoteEventMode(&event) abciEvent := cosmostypes.Event(event) app.sdkCtx.EventManager().EmitEvent(abciEvent) } + // Emit txResult events. for _, txResult := range res.TxResults { for _, event := range txResult.Events { abciEvent := cosmostypes.Event(event) @@ -844,7 +845,7 @@ func (app *App) nextBlockUpdateCtx() { // setupDefaultActorsState uses the integration app keepers to stake "default" // on-chain actors for use in tests. In creates a service, and stakes a supplier -// and application as well as funding the bank balance of both accounts. +// and application as well as funding the bank balance of the default supplier. // // TODO_IMPROVE: Eliminate usage of and remove this function in favor of // integration.NewInitChainerModuleGenesisStateOptionFn. @@ -933,11 +934,15 @@ func (app *App) setupDefaultActorsState( require.NoError(t, err) // TODO_IMPROVE: Refactor the relay_mining_difficulty_test.go to use the - // BaseIntegrationTestSuite and its #FundAddress() method and remove the - // need for this. + // BaseIntegrationTestSuite (or a DefaultActorIntegrationSuite) and its + // #FundAddress() method and remove the need for this. // // Fund the supplier operator account to be able to submit proofs fundAccount(t, app.sdkCtx, bankKeeper, supplierOperatorAddr, 100000000) + + // Commit all the changes above by finalizing, committing, and moving + // to the next block. + app.NextBlock(t) } // fundAccount mints and sends amountUpokt tokens to the given recipientAddr. diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index dfb805153..f9d6974ee 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -119,7 +119,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMat expectedNumEvents := 3 s.NewApp(s.T()) - s.generateBankMsgSendEvents(expectedNumEvents) + s.emitBankMsgSendEvents(expectedNumEvents) // Filter for the "message" type event with "action" attribute value // equal to the MsgSend TypeURL. @@ -152,7 +152,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMa func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { s.NewApp(s.T()) - s.generateBankMsgSendEvents(1) + s.emitBankMsgSendEvents(1) testEvents := s.SdkCtx().EventManager().Events() // NB: 5 events are emitted for a single MsgSend: @@ -162,18 +162,19 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { // - transfer // - coinbase require.Equal(s.T(), 5, len(testEvents), "expected 5 events") - event := testEvents[0] - // Get the matched event and check its attributes. + // Get the "message" event and check its "module" attribute. Cosmos-sdk emits + // a "message" event alongside other txResult events for each message in a tx. + event := testEvents[0] value, hasAttr := s.GetAttributeValue(&event, "module") require.True(s.T(), hasAttr) require.Equal(s.T(), banktypes.ModuleName, value) } -// generateBankMsgSendEvents causes the bank module to emit events as the result +// emitBankMsgSendEvents causes the bank module to emit events as the result // of handling a MsgSend message which are intended to be used to make assertions // in tests. -func (s *BaseIntegrationSuiteTestSuite) generateBankMsgSendEvents(expectedNumEvents int) { +func (s *BaseIntegrationSuiteTestSuite) emitBankMsgSendEvents(expectedNumEvents int) { msgs := make([]cosmostypes.Msg, 0) for i := 0; i < expectedNumEvents; i++ { @@ -207,6 +208,7 @@ func (s *BaseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expect } } +// Run the test suite. func TestBaseIntegrationSuite(t *testing.T) { suite.Run(t, new(BaseIntegrationSuiteTestSuite)) } From 21e306e08268d00c9091fcfdbb8b99cbe0399257 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 13:16:14 +0200 Subject: [PATCH 36/77] fix: linter errors --- testutil/events/filter.go | 6 +++--- testutil/integration/app.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testutil/events/filter.go b/testutil/events/filter.go index e96ff33e3..a020e6489 100644 --- a/testutil/events/filter.go +++ b/testutil/events/filter.go @@ -63,11 +63,11 @@ func NewMsgEventMatchFn(matchMsgTypeURL string) func(*cosmostypes.Event) bool { } eventMsgTypeURL := strings.Trim(actionAttr.GetValue(), "\"") - if strings.Trim(eventMsgTypeURL, "/") != strings.Trim(matchMsgTypeURL, "/") { - return false + if strings.Trim(eventMsgTypeURL, "/") == strings.Trim(matchMsgTypeURL, "/") { + return true } - return true + return false } } diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 4aff1d208..d79d33b7a 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -736,7 +736,7 @@ func (app *App) RunMsgs(t *testing.T, msgs ...sdk.Msg) (txMsgResps []tx.MsgRespo for _, txResult := range finalizeBlockRes.TxResults { if !txResult.IsOK() { err = fmt.Errorf("tx failed with log: %q", txResult.GetLog()) - errors.Join(txResultErrs, err) + txResultErrs = errors.Join(txResultErrs, err) continue } From 1daf42cb7012bd43ed0d786f377d455676efcd7c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 13:24:20 +0200 Subject: [PATCH 37/77] fix: linter errors --- testutil/events/filter.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/testutil/events/filter.go b/testutil/events/filter.go index a020e6489..e2e4561bd 100644 --- a/testutil/events/filter.go +++ b/testutil/events/filter.go @@ -63,11 +63,7 @@ func NewMsgEventMatchFn(matchMsgTypeURL string) func(*cosmostypes.Event) bool { } eventMsgTypeURL := strings.Trim(actionAttr.GetValue(), "\"") - if strings.Trim(eventMsgTypeURL, "/") == strings.Trim(matchMsgTypeURL, "/") { - return true - } - - return false + return strings.Trim(eventMsgTypeURL, "/") == strings.Trim(matchMsgTypeURL, "/") } } From 7e71c388cdc0b7111a01339d1655f034ad5fcced Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 19:33:04 +0200 Subject: [PATCH 38/77] fix: failing E2E test --- e2e/tests/stake_supplier_steps_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e/tests/stake_supplier_steps_test.go b/e2e/tests/stake_supplier_steps_test.go index 15197a25e..d0d8f99e9 100644 --- a/e2e/tests/stake_supplier_steps_test.go +++ b/e2e/tests/stake_supplier_steps_test.go @@ -14,10 +14,10 @@ import ( func (s *suite) TheUnbondingPeriodParamIsSuccessfullySetToSessionsOfBlocks( _ string, - supplierUnbondingPeriodSessions, + unbondingPeriodSessions, numBlocksPerSession int64, ) { - require.GreaterOrEqualf(s, numBlocksPerSession, 2, + require.GreaterOrEqualf(s, numBlocksPerSession, int64(2), "num_blocks_per_session MUST be at least 2 to satisfy parameter validation requirements") paramModuleName := "shared" @@ -39,8 +39,9 @@ func (s *suite) TheUnbondingPeriodParamIsSuccessfullySetToSessionsOfBlocks( ClaimWindowCloseOffsetBlocks: 1, ProofWindowOpenOffsetBlocks: 0, ProofWindowCloseOffsetBlocks: 1, - SupplierUnbondingPeriodSessions: uint64(supplierUnbondingPeriodSessions), - ApplicationUnbondingPeriodSessions: 1, + SupplierUnbondingPeriodSessions: uint64(unbondingPeriodSessions), + ApplicationUnbondingPeriodSessions: uint64(unbondingPeriodSessions), + ComputeUnitsToTokensMultiplier: sharedtypes.DefaultComputeUnitsToTokensMultiplier, } // Convert params struct to the map type expected by From ba7aaa7eb6e7f2686831e11928664d80a25451dc Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 19:33:23 +0200 Subject: [PATCH 39/77] chore: sync shared module default params --- config.yml | 3 +++ tools/scripts/params/shared_all.json | 7 +++++-- x/shared/types/params.go | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 7921b0573..4c5215779 100644 --- a/config.yml +++ b/config.yml @@ -268,3 +268,6 @@ genesis: claim_window_close_offset_blocks: 4 proof_window_open_offset_blocks: 0 proof_window_close_offset_blocks: 4 + supplier_unbonding_period_sessions: 1 + application_unbonding_period_sessions: 1 + compute_units_to_tokens_multiplier: 42 diff --git a/tools/scripts/params/shared_all.json b/tools/scripts/params/shared_all.json index fa5e04f78..2a489f27c 100644 --- a/tools/scripts/params/shared_all.json +++ b/tools/scripts/params/shared_all.json @@ -5,12 +5,15 @@ "@type": "/poktroll.shared.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "num_blocks_per_session": "4", + "num_blocks_per_session": "10", "grace_period_end_offset_blocks": "1", "claim_window_open_offset_blocks": "1", "claim_window_close_offset_blocks": "4", "proof_window_open_offset_blocks": "0", - "proof_window_close_offset_blocks": "4" + "proof_window_close_offset_blocks": "4", + "supplier_unbonding_period_sessions": "1", + "application_unbonding_period_sessions": "1", + "compute_units_to_tokens_multiplier": "42" } } ] diff --git a/x/shared/types/params.go b/x/shared/types/params.go index 3a5afd62d..d5921f62d 100644 --- a/x/shared/types/params.go +++ b/x/shared/types/params.go @@ -5,11 +5,11 @@ import ( ) const ( - DefaultNumBlocksPerSession = 4 + DefaultNumBlocksPerSession = 10 ParamNumBlocksPerSession = "num_blocks_per_session" DefaultGracePeriodEndOffsetBlocks = 1 ParamGracePeriodEndOffsetBlocks = "grace_period_end_offset_blocks" - DefaultClaimWindowOpenOffsetBlocks = 2 + DefaultClaimWindowOpenOffsetBlocks = 1 ParamClaimWindowOpenOffsetBlocks = "claim_window_open_offset_blocks" DefaultClaimWindowCloseOffsetBlocks = 4 ParamClaimWindowCloseOffsetBlocks = "claim_window_close_offset_blocks" @@ -17,9 +17,9 @@ const ( ParamProofWindowOpenOffsetBlocks = "proof_window_open_offset_blocks" DefaultProofWindowCloseOffsetBlocks = 4 ParamProofWindowCloseOffsetBlocks = "proof_window_close_offset_blocks" - DefaultSupplierUnbondingPeriodSessions = 4 // 4 sessions + DefaultSupplierUnbondingPeriodSessions = 1 // 1 session ParamSupplierUnbondingPeriodSessions = "supplier_unbonding_period_sessions" - DefaultApplicationUnbondingPeriodSessions = 4 // 4 sessions + DefaultApplicationUnbondingPeriodSessions = 1 // 1 session ParamApplicationUnbondingPeriodSessions = "application_unbonding_period_sessions" DefaultComputeUnitsToTokensMultiplier = 42 // TODO_MAINNET: Determine the default value. ParamComputeUnitsToTokensMultiplier = "compute_units_to_tokens_multiplier" From 5c46e3dfb1a99551637c33d3845c1db06ffead7c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 19:37:06 +0200 Subject: [PATCH 40/77] chore: add comment --- e2e/tests/stake_supplier_steps_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/tests/stake_supplier_steps_test.go b/e2e/tests/stake_supplier_steps_test.go index d0d8f99e9..2b1e9e28e 100644 --- a/e2e/tests/stake_supplier_steps_test.go +++ b/e2e/tests/stake_supplier_steps_test.go @@ -64,6 +64,7 @@ func paramsAnyMapFromParamsStruct(paramStruct any) paramsAnyMap { paramName := toSnakeCase(fieldStruct.Name) fieldTypeName := fieldStruct.Type.Name() + // TODO_IMPROVE: MsgUpdateParam currently only supports int64 and not uint64 value types. if fieldTypeName == "uint64" { fieldTypeName = "int64" fieldValue = reflect.ValueOf(int64(fieldValue.Interface().(uint64))) From 3324d1746b0eb1ffcaa1437b3e79921fe594b321 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 19:53:18 +0200 Subject: [PATCH 41/77] chore: review feedback improvements --- e2e/tests/params_tx_test.go | 3 ++- e2e/tests/params_types_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/tests/params_tx_test.go b/e2e/tests/params_tx_test.go index 6a3bb155a..f01a21b6b 100644 --- a/e2e/tests/params_tx_test.go +++ b/e2e/tests/params_tx_test.go @@ -48,7 +48,8 @@ func (s *suite) sendAuthzExecTx(signingKeyName, txJSONFilePath string) { // // This resulted in observing many more events than expected, even accounting // for those corresponding to the param reset step, which is automatically - // registered in a s.Cleanup() below. + // registered in a s.Cleanup() below. There are no useful attributes on these + // events such that we can filter out the noise. s.Logf("waiting %d seconds for the authz exec tx to be committed...", txDelaySeconds) time.Sleep(txDelaySeconds * time.Second) diff --git a/e2e/tests/params_types_test.go b/e2e/tests/params_types_test.go index 8da752793..2dbee73b2 100644 --- a/e2e/tests/params_types_test.go +++ b/e2e/tests/params_types_test.go @@ -9,7 +9,7 @@ type ( paramNameKey = string ) -// paramsAnyMap is a map of param names to param values. +// paramsAnyMap is a map of param names to param any values. type paramsAnyMap map[paramNameKey]paramAny // moduleParamsMap is a map of module names to params maps. From 4c1c962b99887a9d4583163d607f17576fa29299 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 21:06:10 +0200 Subject: [PATCH 42/77] fix: update_param e2e test --- e2e/tests/update_params.feature | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/e2e/tests/update_params.feature b/e2e/tests/update_params.feature index c1a9b77f9..a84cad537 100644 --- a/e2e/tests/update_params.feature +++ b/e2e/tests/update_params.feature @@ -68,22 +68,22 @@ Feature: Params Namespace Then the "" module param "" should be updated Examples: - | module | message_type | param_name | param_value | param_type | - | proof | /poktroll.proof.MsgUpdateParam | min_relay_difficulty_bits | 12 | int64 | - | proof | /poktroll.proof.MsgUpdateParam | proof_request_probability | 0.1 | float | - | proof | /poktroll.proof.MsgUpdateParam | proof_requirement_threshold | 100 | coin | - | proof | /poktroll.proof.MsgUpdateParam | proof_missing_penalty | 500 | coin | - | proof | /poktroll.proof.MsgUpdateParam | proof_submission_fee | 5000000 | coin | - | shared | /poktroll.shared.MsgUpdateParam | num_blocks_per_session | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | grace_period_end_offset_blocks | 2 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | claim_window_open_offset_blocks | 2 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | claim_window_close_offset_blocks | 3 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | proof_window_open_offset_blocks | 1 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | proof_window_close_offset_blocks | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | supplier_unbonding_period_sessions | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | application_unbonding_period_sessions | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | compute_units_to_tokens_multiplier | 68 | int64 | - | service | /poktroll.service.MsgUpdateParam | add_service_fee | 1000000001 | coin | + | module | message_type | param_name | param_value | param_type | + | proof | /poktroll.proof.MsgUpdateParam | min_relay_difficulty_bits | 12 | int64 | + | proof | /poktroll.proof.MsgUpdateParam | proof_request_probability | 0.1 | float | + | proof | /poktroll.proof.MsgUpdateParam | proof_requirement_threshold | 100 | coin | + | proof | /poktroll.proof.MsgUpdateParam | proof_missing_penalty | 500 | coin | + | proof | /poktroll.proof.MsgUpdateParam | proof_submission_fee | 5000000 | coin | + | shared | /poktroll.shared.MsgUpdateParam | num_blocks_per_session | 9 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | grace_period_end_offset_blocks | 0 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | claim_window_open_offset_blocks | 2 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | claim_window_close_offset_blocks | 3 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | proof_window_open_offset_blocks | 1 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | proof_window_close_offset_blocks | 5 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | supplier_unbonding_period_sessions | 5 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | application_unbonding_period_sessions | 5 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | compute_units_to_tokens_multiplier | 68 | int64 | + | service | /poktroll.service.MsgUpdateParam | add_service_fee | 1000000001 | coin | Scenario: An unauthorized user cannot update individual module params Given the user has the pocketd binary installed From 7cfb00c874308dce3b63e492173394de2ed23503 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 21:20:22 +0200 Subject: [PATCH 43/77] chore: add unbonding_height fields & missing JSON tags --- api/poktroll/application/query_grpc.pb.go | 194 -- api/poktroll/application/tx_grpc.pb.go | 270 -- api/poktroll/gateway/query_grpc.pb.go | 194 -- api/poktroll/gateway/tx_grpc.pb.go | 194 -- api/poktroll/proof/query_grpc.pb.go | 272 -- api/poktroll/proof/tx_grpc.pb.go | 232 -- api/poktroll/service/query_grpc.pb.go | 194 -- api/poktroll/service/tx_grpc.pb.go | 194 -- api/poktroll/session/query_grpc.pb.go | 156 - api/poktroll/session/tx_grpc.pb.go | 118 - api/poktroll/shared/query_grpc.pb.go | 116 - api/poktroll/shared/tx_grpc.pb.go | 156 - api/poktroll/supplier/event.pulsar.go | 189 +- api/poktroll/supplier/query_grpc.pb.go | 194 -- api/poktroll/supplier/tx_grpc.pb.go | 194 -- api/poktroll/tokenomics/query_grpc.pb.go | 194 -- api/poktroll/tokenomics/tx_grpc.pb.go | 156 - proto/poktroll/supplier/event.proto | 8 +- x/application/types/event.pb.go | 372 --- x/application/types/genesis.pb.go | 387 --- x/application/types/params.pb.go | 330 -- x/application/types/query.pb.go | 1366 -------- x/application/types/query.pb.gw.go | 337 -- x/application/types/tx.pb.go | 2103 ------------- x/application/types/types.pb.go | 896 ------ x/gateway/types/event.pb.go | 317 -- x/gateway/types/genesis.pb.go | 385 --- x/gateway/types/params.pb.go | 285 -- x/gateway/types/query.pb.go | 1367 -------- x/gateway/types/query.pb.gw.go | 337 -- x/gateway/types/tx.pb.go | 1293 -------- x/gateway/types/types.pb.go | 379 --- x/proof/types/event.pb.go | 1259 -------- x/proof/types/genesis.pb.go | 448 --- x/proof/types/params.pb.go | 599 ---- x/proof/types/query.pb.go | 2756 ----------------- x/proof/types/query.pb.gw.go | 565 ---- x/proof/types/tx.pb.go | 2396 -------------- x/proof/types/types.pb.go | 791 ----- x/service/types/genesis.pb.go | 386 --- x/service/types/params.pb.go | 358 --- x/service/types/query.pb.go | 1366 -------- x/service/types/query.pb.gw.go | 337 -- x/service/types/relay.pb.go | 1370 -------- x/service/types/tx.pb.go | 1529 --------- x/session/types/genesis.pb.go | 320 -- x/session/types/params.pb.go | 285 -- x/session/types/query.pb.go | 1008 ------ x/session/types/query.pb.gw.go | 236 -- x/session/types/tx.pb.go | 590 ---- x/session/types/types.pb.go | 933 ------ x/shared/types/genesis.pb.go | 320 -- x/shared/types/params.pb.go | 671 ---- x/shared/types/query.pb.go | 532 ---- x/shared/types/query.pb.gw.go | 153 - x/shared/types/service.pb.go | 1675 ---------- x/shared/types/supplier.pb.go | 706 ----- x/shared/types/tx.pb.go | 1262 -------- .../keeper/msg_server_unstake_supplier.go | 4 +- x/supplier/keeper/unbond_suppliers.go | 3 +- x/supplier/types/event.pb.go | 682 ---- x/supplier/types/genesis.pb.go | 386 --- x/supplier/types/params.pb.go | 285 -- x/supplier/types/query.pb.go | 1370 -------- x/supplier/types/query.pb.gw.go | 337 -- x/supplier/types/tx.pb.go | 1515 --------- x/tokenomics/types/event.pb.go | 1736 ----------- x/tokenomics/types/genesis.pb.go | 387 --- x/tokenomics/types/params.pb.go | 285 -- x/tokenomics/types/query.pb.go | 1369 -------- x/tokenomics/types/query.pb.gw.go | 337 -- .../types/relay_mining_difficulty.pb.go | 456 --- x/tokenomics/types/tx.pb.go | 1266 -------- 73 files changed, 166 insertions(+), 46482 deletions(-) delete mode 100644 api/poktroll/application/query_grpc.pb.go delete mode 100644 api/poktroll/application/tx_grpc.pb.go delete mode 100644 api/poktroll/gateway/query_grpc.pb.go delete mode 100644 api/poktroll/gateway/tx_grpc.pb.go delete mode 100644 api/poktroll/proof/query_grpc.pb.go delete mode 100644 api/poktroll/proof/tx_grpc.pb.go delete mode 100644 api/poktroll/service/query_grpc.pb.go delete mode 100644 api/poktroll/service/tx_grpc.pb.go delete mode 100644 api/poktroll/session/query_grpc.pb.go delete mode 100644 api/poktroll/session/tx_grpc.pb.go delete mode 100644 api/poktroll/shared/query_grpc.pb.go delete mode 100644 api/poktroll/shared/tx_grpc.pb.go delete mode 100644 api/poktroll/supplier/query_grpc.pb.go delete mode 100644 api/poktroll/supplier/tx_grpc.pb.go delete mode 100644 api/poktroll/tokenomics/query_grpc.pb.go delete mode 100644 api/poktroll/tokenomics/tx_grpc.pb.go delete mode 100644 x/application/types/event.pb.go delete mode 100644 x/application/types/genesis.pb.go delete mode 100644 x/application/types/params.pb.go delete mode 100644 x/application/types/query.pb.go delete mode 100644 x/application/types/query.pb.gw.go delete mode 100644 x/application/types/tx.pb.go delete mode 100644 x/application/types/types.pb.go delete mode 100644 x/gateway/types/event.pb.go delete mode 100644 x/gateway/types/genesis.pb.go delete mode 100644 x/gateway/types/params.pb.go delete mode 100644 x/gateway/types/query.pb.go delete mode 100644 x/gateway/types/query.pb.gw.go delete mode 100644 x/gateway/types/tx.pb.go delete mode 100644 x/gateway/types/types.pb.go delete mode 100644 x/proof/types/event.pb.go delete mode 100644 x/proof/types/genesis.pb.go delete mode 100644 x/proof/types/params.pb.go delete mode 100644 x/proof/types/query.pb.go delete mode 100644 x/proof/types/query.pb.gw.go delete mode 100644 x/proof/types/tx.pb.go delete mode 100644 x/proof/types/types.pb.go delete mode 100644 x/service/types/genesis.pb.go delete mode 100644 x/service/types/params.pb.go delete mode 100644 x/service/types/query.pb.go delete mode 100644 x/service/types/query.pb.gw.go delete mode 100644 x/service/types/relay.pb.go delete mode 100644 x/service/types/tx.pb.go delete mode 100644 x/session/types/genesis.pb.go delete mode 100644 x/session/types/params.pb.go delete mode 100644 x/session/types/query.pb.go delete mode 100644 x/session/types/query.pb.gw.go delete mode 100644 x/session/types/tx.pb.go delete mode 100644 x/session/types/types.pb.go delete mode 100644 x/shared/types/genesis.pb.go delete mode 100644 x/shared/types/params.pb.go delete mode 100644 x/shared/types/query.pb.go delete mode 100644 x/shared/types/query.pb.gw.go delete mode 100644 x/shared/types/service.pb.go delete mode 100644 x/shared/types/supplier.pb.go delete mode 100644 x/shared/types/tx.pb.go delete mode 100644 x/supplier/types/event.pb.go delete mode 100644 x/supplier/types/genesis.pb.go delete mode 100644 x/supplier/types/params.pb.go delete mode 100644 x/supplier/types/query.pb.go delete mode 100644 x/supplier/types/query.pb.gw.go delete mode 100644 x/supplier/types/tx.pb.go delete mode 100644 x/tokenomics/types/event.pb.go delete mode 100644 x/tokenomics/types/genesis.pb.go delete mode 100644 x/tokenomics/types/params.pb.go delete mode 100644 x/tokenomics/types/query.pb.go delete mode 100644 x/tokenomics/types/query.pb.gw.go delete mode 100644 x/tokenomics/types/relay_mining_difficulty.pb.go delete mode 100644 x/tokenomics/types/tx.pb.go diff --git a/api/poktroll/application/query_grpc.pb.go b/api/poktroll/application/query_grpc.pb.go deleted file mode 100644 index 38b436639..000000000 --- a/api/poktroll/application/query_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/application/query.proto - -package application - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.application.Query/Params" - Query_Application_FullMethodName = "/poktroll.application.Query/Application" - Query_AllApplications_FullMethodName = "/poktroll.application.Query/AllApplications" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 Application items. - Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) - AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetApplicationResponse) - err := c.cc.Invoke(ctx, Query_Application_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllApplicationsResponse) - err := c.cc.Invoke(ctx, Query_AllApplications_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Application items. - Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) - AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Application not implemented") -} -func (UnimplementedQueryServer) AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllApplications not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Application_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetApplicationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Application(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Application_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Application(ctx, req.(*QueryGetApplicationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllApplicationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllApplications(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllApplications_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllApplications(ctx, req.(*QueryAllApplicationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.application.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Application", - Handler: _Query_Application_Handler, - }, - { - MethodName: "AllApplications", - Handler: _Query_AllApplications_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/application/query.proto", -} diff --git a/api/poktroll/application/tx_grpc.pb.go b/api/poktroll/application/tx_grpc.pb.go deleted file mode 100644 index b8a8e8cee..000000000 --- a/api/poktroll/application/tx_grpc.pb.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/application/tx.proto - -package application - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.application.Msg/UpdateParams" - Msg_StakeApplication_FullMethodName = "/poktroll.application.Msg/StakeApplication" - Msg_UnstakeApplication_FullMethodName = "/poktroll.application.Msg/UnstakeApplication" - Msg_DelegateToGateway_FullMethodName = "/poktroll.application.Msg/DelegateToGateway" - Msg_UndelegateFromGateway_FullMethodName = "/poktroll.application.Msg/UndelegateFromGateway" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) - UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) - DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) - UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgStakeApplicationResponse) - err := c.cc.Invoke(ctx, Msg_StakeApplication_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUnstakeApplicationResponse) - err := c.cc.Invoke(ctx, Msg_UnstakeApplication_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgDelegateToGatewayResponse) - err := c.cc.Invoke(ctx, Msg_DelegateToGateway_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUndelegateFromGatewayResponse) - err := c.cc.Invoke(ctx, Msg_UndelegateFromGateway_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) - UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) - DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) - UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeApplication not implemented") -} -func (UnimplementedMsgServer) UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeApplication not implemented") -} -func (UnimplementedMsgServer) DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegateToGateway not implemented") -} -func (UnimplementedMsgServer) UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeApplication) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeApplication(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_StakeApplication_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeApplication(ctx, req.(*MsgStakeApplication)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeApplication) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeApplication(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UnstakeApplication_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeApplication(ctx, req.(*MsgUnstakeApplication)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_DelegateToGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDelegateToGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DelegateToGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_DelegateToGateway_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DelegateToGateway(ctx, req.(*MsgDelegateToGateway)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUndelegateFromGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UndelegateFromGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UndelegateFromGateway_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UndelegateFromGateway(ctx, req.(*MsgUndelegateFromGateway)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.application.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeApplication", - Handler: _Msg_StakeApplication_Handler, - }, - { - MethodName: "UnstakeApplication", - Handler: _Msg_UnstakeApplication_Handler, - }, - { - MethodName: "DelegateToGateway", - Handler: _Msg_DelegateToGateway_Handler, - }, - { - MethodName: "UndelegateFromGateway", - Handler: _Msg_UndelegateFromGateway_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/application/tx.proto", -} diff --git a/api/poktroll/gateway/query_grpc.pb.go b/api/poktroll/gateway/query_grpc.pb.go deleted file mode 100644 index d6106bde7..000000000 --- a/api/poktroll/gateway/query_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/gateway/query.proto - -package gateway - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.gateway.Query/Params" - Query_Gateway_FullMethodName = "/poktroll.gateway.Query/Gateway" - Query_AllGateways_FullMethodName = "/poktroll.gateway.Query/AllGateways" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 Gateway items. - Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) - AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetGatewayResponse) - err := c.cc.Invoke(ctx, Query_Gateway_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllGatewaysResponse) - err := c.cc.Invoke(ctx, Query_AllGateways_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Gateway items. - Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) - AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Gateway not implemented") -} -func (UnimplementedQueryServer) AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllGateways not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Gateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetGatewayRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Gateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Gateway_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Gateway(ctx, req.(*QueryGetGatewayRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllGatewaysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllGateways(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllGateways_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllGateways(ctx, req.(*QueryAllGatewaysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.gateway.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Gateway", - Handler: _Query_Gateway_Handler, - }, - { - MethodName: "AllGateways", - Handler: _Query_AllGateways_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/gateway/query.proto", -} diff --git a/api/poktroll/gateway/tx_grpc.pb.go b/api/poktroll/gateway/tx_grpc.pb.go deleted file mode 100644 index 097b42380..000000000 --- a/api/poktroll/gateway/tx_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/gateway/tx.proto - -package gateway - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.gateway.Msg/UpdateParams" - Msg_StakeGateway_FullMethodName = "/poktroll.gateway.Msg/StakeGateway" - Msg_UnstakeGateway_FullMethodName = "/poktroll.gateway.Msg/UnstakeGateway" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) - UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgStakeGatewayResponse) - err := c.cc.Invoke(ctx, Msg_StakeGateway_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUnstakeGatewayResponse) - err := c.cc.Invoke(ctx, Msg_UnstakeGateway_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) - UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeGateway not implemented") -} -func (UnimplementedMsgServer) UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeGateway not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_StakeGateway_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeGateway(ctx, req.(*MsgStakeGateway)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UnstakeGateway_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeGateway(ctx, req.(*MsgUnstakeGateway)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.gateway.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeGateway", - Handler: _Msg_StakeGateway_Handler, - }, - { - MethodName: "UnstakeGateway", - Handler: _Msg_UnstakeGateway_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/gateway/tx.proto", -} diff --git a/api/poktroll/proof/query_grpc.pb.go b/api/poktroll/proof/query_grpc.pb.go deleted file mode 100644 index aa2dc91eb..000000000 --- a/api/poktroll/proof/query_grpc.pb.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/proof/query.proto - -package proof - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.proof.Query/Params" - Query_Claim_FullMethodName = "/poktroll.proof.Query/Claim" - Query_AllClaims_FullMethodName = "/poktroll.proof.Query/AllClaims" - Query_Proof_FullMethodName = "/poktroll.proof.Query/Proof" - Query_AllProofs_FullMethodName = "/poktroll.proof.Query/AllProofs" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 Claim items. - Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) - AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) - // Queries a list of Proof items. - Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) - AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetClaimResponse) - err := c.cc.Invoke(ctx, Query_Claim_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllClaimsResponse) - err := c.cc.Invoke(ctx, Query_AllClaims_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetProofResponse) - err := c.cc.Invoke(ctx, Query_Proof_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllProofsResponse) - err := c.cc.Invoke(ctx, Query_AllProofs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Claim items. - Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) - AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) - // Queries a list of Proof items. - Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) - AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") -} -func (UnimplementedQueryServer) AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllClaims not implemented") -} -func (UnimplementedQueryServer) Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") -} -func (UnimplementedQueryServer) AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllProofs not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetClaimRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Claim(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Claim_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Claim(ctx, req.(*QueryGetClaimRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllClaims_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllClaimsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllClaims(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllClaims_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllClaims(ctx, req.(*QueryAllClaimsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetProofRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Proof_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proof(ctx, req.(*QueryGetProofRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllProofs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllProofsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllProofs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllProofs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllProofs(ctx, req.(*QueryAllProofsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.proof.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Claim", - Handler: _Query_Claim_Handler, - }, - { - MethodName: "AllClaims", - Handler: _Query_AllClaims_Handler, - }, - { - MethodName: "Proof", - Handler: _Query_Proof_Handler, - }, - { - MethodName: "AllProofs", - Handler: _Query_AllProofs_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/proof/query.proto", -} diff --git a/api/poktroll/proof/tx_grpc.pb.go b/api/poktroll/proof/tx_grpc.pb.go deleted file mode 100644 index 51c26c023..000000000 --- a/api/poktroll/proof/tx_grpc.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/proof/tx.proto - -package proof - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.proof.Msg/UpdateParams" - Msg_CreateClaim_FullMethodName = "/poktroll.proof.Msg/CreateClaim" - Msg_SubmitProof_FullMethodName = "/poktroll.proof.Msg/SubmitProof" - Msg_UpdateParam_FullMethodName = "/poktroll.proof.Msg/UpdateParam" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) - SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgCreateClaimResponse) - err := c.cc.Invoke(ctx, Msg_CreateClaim_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgSubmitProofResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProof_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) - SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateClaim not implemented") -} -func (UnimplementedMsgServer) SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitProof not implemented") -} -func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CreateClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateClaim) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateClaim(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_CreateClaim_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateClaim(ctx, req.(*MsgCreateClaim)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitProof) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_SubmitProof_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitProof(ctx, req.(*MsgSubmitProof)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParam_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.proof.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "CreateClaim", - Handler: _Msg_CreateClaim_Handler, - }, - { - MethodName: "SubmitProof", - Handler: _Msg_SubmitProof_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/proof/tx.proto", -} diff --git a/api/poktroll/service/query_grpc.pb.go b/api/poktroll/service/query_grpc.pb.go deleted file mode 100644 index 98d68bf29..000000000 --- a/api/poktroll/service/query_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/service/query.proto - -package service - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.service.Query/Params" - Query_Service_FullMethodName = "/poktroll.service.Query/Service" - Query_AllServices_FullMethodName = "/poktroll.service.Query/AllServices" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 Service items. - Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) - AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetServiceResponse) - err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllServicesResponse) - err := c.cc.Invoke(ctx, Query_AllServices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Service items. - Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) - AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") -} -func (UnimplementedQueryServer) AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Service(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Service_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Service(ctx, req.(*QueryGetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllServices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllServices(ctx, req.(*QueryAllServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.service.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Service", - Handler: _Query_Service_Handler, - }, - { - MethodName: "AllServices", - Handler: _Query_AllServices_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/service/query.proto", -} diff --git a/api/poktroll/service/tx_grpc.pb.go b/api/poktroll/service/tx_grpc.pb.go deleted file mode 100644 index 45f7d6418..000000000 --- a/api/poktroll/service/tx_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/service/tx.proto - -package service - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.service.Msg/UpdateParams" - Msg_UpdateParam_FullMethodName = "/poktroll.service.Msg/UpdateParam" - Msg_AddService_FullMethodName = "/poktroll.service.Msg/AddService" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) - AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgAddServiceResponse) - err := c.cc.Invoke(ctx, Msg_AddService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) - AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} -func (UnimplementedMsgServer) AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParam_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddService) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AddService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_AddService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddService(ctx, req.(*MsgAddService)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.service.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - { - MethodName: "AddService", - Handler: _Msg_AddService_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/service/tx.proto", -} diff --git a/api/poktroll/session/query_grpc.pb.go b/api/poktroll/session/query_grpc.pb.go deleted file mode 100644 index ea6063319..000000000 --- a/api/poktroll/session/query_grpc.pb.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/session/query.proto - -package session - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.session.Query/Params" - Query_GetSession_FullMethodName = "/poktroll.session.Query/GetSession" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries the session given app_address, service and block_height. - GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetSessionResponse) - err := c.cc.Invoke(ctx, Query_GetSession_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries the session given app_address, service and block_height. - GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetSessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetSession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_GetSession_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetSession(ctx, req.(*QueryGetSessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.session.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "GetSession", - Handler: _Query_GetSession_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/session/query.proto", -} diff --git a/api/poktroll/session/tx_grpc.pb.go b/api/poktroll/session/tx_grpc.pb.go deleted file mode 100644 index 33cba3055..000000000 --- a/api/poktroll/session/tx_grpc.pb.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/session/tx.proto - -package session - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.session.Msg/UpdateParams" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.session.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/session/tx.proto", -} diff --git a/api/poktroll/shared/query_grpc.pb.go b/api/poktroll/shared/query_grpc.pb.go deleted file mode 100644 index 95d4fc364..000000000 --- a/api/poktroll/shared/query_grpc.pb.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/shared/query.proto - -package shared - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.shared.Query/Params" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.shared.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/shared/query.proto", -} diff --git a/api/poktroll/shared/tx_grpc.pb.go b/api/poktroll/shared/tx_grpc.pb.go deleted file mode 100644 index 19e2023a9..000000000 --- a/api/poktroll/shared/tx_grpc.pb.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/shared/tx.proto - -package shared - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.shared.Msg/UpdateParams" - Msg_UpdateParam_FullMethodName = "/poktroll.shared.Msg/UpdateParam" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParam_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.shared.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/shared/tx.proto", -} diff --git a/api/poktroll/supplier/event.pulsar.go b/api/poktroll/supplier/event.pulsar.go index 510d3671a..a32d25aad 100644 --- a/api/poktroll/supplier/event.pulsar.go +++ b/api/poktroll/supplier/event.pulsar.go @@ -2,11 +2,11 @@ package supplier import ( - shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -451,14 +451,16 @@ func (x *fastReflection_EventSupplierStaked) ProtoMethods() *protoiface.Methods } var ( - md_EventSupplierUnbondingBegin protoreflect.MessageDescriptor - fd_EventSupplierUnbondingBegin_supplier protoreflect.FieldDescriptor + md_EventSupplierUnbondingBegin protoreflect.MessageDescriptor + fd_EventSupplierUnbondingBegin_supplier protoreflect.FieldDescriptor + fd_EventSupplierUnbondingBegin_unbonding_height protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_event_proto_init() md_EventSupplierUnbondingBegin = File_poktroll_supplier_event_proto.Messages().ByName("EventSupplierUnbondingBegin") fd_EventSupplierUnbondingBegin_supplier = md_EventSupplierUnbondingBegin.Fields().ByName("supplier") + fd_EventSupplierUnbondingBegin_unbonding_height = md_EventSupplierUnbondingBegin.Fields().ByName("unbonding_height") } var _ protoreflect.Message = (*fastReflection_EventSupplierUnbondingBegin)(nil) @@ -532,6 +534,12 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Range(f func(protoreflect.F return } } + if x.UnbondingHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.UnbondingHeight) + if !f(fd_EventSupplierUnbondingBegin_unbonding_height, value) { + return + } + } } // Has reports whether a field is populated. @@ -549,6 +557,8 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Has(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": return x.Supplier != nil + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + return x.UnbondingHeight != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -567,6 +577,8 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Clear(fd protoreflect.Field switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": x.Supplier = nil + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + x.UnbondingHeight = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -586,6 +598,9 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Get(descriptor protoreflect case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": value := x.Supplier return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + value := x.UnbondingHeight + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -608,6 +623,8 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Set(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": x.Supplier = value.Message().Interface().(*shared.Supplier) + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + x.UnbondingHeight = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -633,6 +650,8 @@ func (x *fastReflection_EventSupplierUnbondingBegin) Mutable(fd protoreflect.Fie x.Supplier = new(shared.Supplier) } return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + panic(fmt.Errorf("field unbonding_height of message poktroll.supplier.EventSupplierUnbondingBegin is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -649,6 +668,8 @@ func (x *fastReflection_EventSupplierUnbondingBegin) NewField(fd protoreflect.Fi case "poktroll.supplier.EventSupplierUnbondingBegin.supplier": m := new(shared.Supplier) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingBegin.unbonding_height": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingBegin")) @@ -722,6 +743,9 @@ func (x *fastReflection_EventSupplierUnbondingBegin) ProtoMethods() *protoiface. l = options.Size(x.Supplier) n += 1 + l + runtime.Sov(uint64(l)) } + if x.UnbondingHeight != 0 { + n += 1 + runtime.Sov(uint64(x.UnbondingHeight)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -751,6 +775,11 @@ func (x *fastReflection_EventSupplierUnbondingBegin) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.UnbondingHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.UnbondingHeight)) + i-- + dAtA[i] = 0x10 + } if x.Supplier != nil { encoded, err := options.Marshal(x.Supplier) if err != nil { @@ -850,6 +879,25 @@ func (x *fastReflection_EventSupplierUnbondingBegin) ProtoMethods() *protoiface. return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType) + } + x.UnbondingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.UnbondingHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -886,14 +934,16 @@ func (x *fastReflection_EventSupplierUnbondingBegin) ProtoMethods() *protoiface. } var ( - md_EventSupplierUnbondingEnd protoreflect.MessageDescriptor - fd_EventSupplierUnbondingEnd_supplier protoreflect.FieldDescriptor + md_EventSupplierUnbondingEnd protoreflect.MessageDescriptor + fd_EventSupplierUnbondingEnd_supplier protoreflect.FieldDescriptor + fd_EventSupplierUnbondingEnd_unbonding_height protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_event_proto_init() md_EventSupplierUnbondingEnd = File_poktroll_supplier_event_proto.Messages().ByName("EventSupplierUnbondingEnd") fd_EventSupplierUnbondingEnd_supplier = md_EventSupplierUnbondingEnd.Fields().ByName("supplier") + fd_EventSupplierUnbondingEnd_unbonding_height = md_EventSupplierUnbondingEnd.Fields().ByName("unbonding_height") } var _ protoreflect.Message = (*fastReflection_EventSupplierUnbondingEnd)(nil) @@ -967,6 +1017,12 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Range(f func(protoreflect.Fie return } } + if x.UnbondingHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.UnbondingHeight) + if !f(fd_EventSupplierUnbondingEnd_unbonding_height, value) { + return + } + } } // Has reports whether a field is populated. @@ -984,6 +1040,8 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Has(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": return x.Supplier != nil + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + return x.UnbondingHeight != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1002,6 +1060,8 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Clear(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": x.Supplier = nil + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + x.UnbondingHeight = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1021,6 +1081,9 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Get(descriptor protoreflect.F case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": value := x.Supplier return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + value := x.UnbondingHeight + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1043,6 +1106,8 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Set(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": x.Supplier = value.Message().Interface().(*shared.Supplier) + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + x.UnbondingHeight = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1068,6 +1133,8 @@ func (x *fastReflection_EventSupplierUnbondingEnd) Mutable(fd protoreflect.Field x.Supplier = new(shared.Supplier) } return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + panic(fmt.Errorf("field unbonding_height of message poktroll.supplier.EventSupplierUnbondingEnd is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1084,6 +1151,8 @@ func (x *fastReflection_EventSupplierUnbondingEnd) NewField(fd protoreflect.Fiel case "poktroll.supplier.EventSupplierUnbondingEnd.supplier": m := new(shared.Supplier) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.supplier.EventSupplierUnbondingEnd.unbonding_height": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.EventSupplierUnbondingEnd")) @@ -1157,6 +1226,9 @@ func (x *fastReflection_EventSupplierUnbondingEnd) ProtoMethods() *protoiface.Me l = options.Size(x.Supplier) n += 1 + l + runtime.Sov(uint64(l)) } + if x.UnbondingHeight != 0 { + n += 1 + runtime.Sov(uint64(x.UnbondingHeight)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1186,6 +1258,11 @@ func (x *fastReflection_EventSupplierUnbondingEnd) ProtoMethods() *protoiface.Me i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.UnbondingHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.UnbondingHeight)) + i-- + dAtA[i] = 0x10 + } if x.Supplier != nil { encoded, err := options.Marshal(x.Supplier) if err != nil { @@ -1285,6 +1362,25 @@ func (x *fastReflection_EventSupplierUnbondingEnd) ProtoMethods() *protoiface.Me return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType) + } + x.UnbondingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.UnbondingHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1375,7 +1471,8 @@ type EventSupplierUnbondingBegin struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + UnbondingHeight int64 `protobuf:"varint,2,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` } func (x *EventSupplierUnbondingBegin) Reset() { @@ -1405,6 +1502,13 @@ func (x *EventSupplierUnbondingBegin) GetSupplier() *shared.Supplier { return nil } +func (x *EventSupplierUnbondingBegin) GetUnbondingHeight() int64 { + if x != nil { + return x.UnbondingHeight + } + return 0 +} + // EventSupplierUnbondingEnd is emitted with the commitment of last block of the // supplier unbonding period. type EventSupplierUnbondingEnd struct { @@ -1412,7 +1516,8 @@ type EventSupplierUnbondingEnd struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + UnbondingHeight int64 `protobuf:"varint,2,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` } func (x *EventSupplierUnbondingEnd) Reset() { @@ -1442,6 +1547,13 @@ func (x *EventSupplierUnbondingEnd) GetSupplier() *shared.Supplier { return nil } +func (x *EventSupplierUnbondingEnd) GetUnbondingHeight() int64 { + if x != nil { + return x.UnbondingHeight + } + return 0 +} + var File_poktroll_supplier_event_proto protoreflect.FileDescriptor var file_poktroll_supplier_event_proto_rawDesc = []byte{ @@ -1453,34 +1565,45 @@ var file_poktroll_supplier_event_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, + 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x43, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x22, 0x54, 0x0a, 0x1b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, - 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x19, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x45, 0x6e, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0xb0, 0x01, 0xd8, 0xe2, - 0x1e, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, - 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, + 0xa3, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x12, + 0x43, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0c, 0xea, 0xde, + 0x1f, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x14, + 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x19, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x45, 0x6e, 0x64, 0x12, 0x43, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xb0, 0x01, 0xd8, 0xe2, 0x1e, 0x01, + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/supplier/query_grpc.pb.go b/api/poktroll/supplier/query_grpc.pb.go deleted file mode 100644 index aa83f20ec..000000000 --- a/api/poktroll/supplier/query_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/supplier/query.proto - -package supplier - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.supplier.Query/Params" - Query_Supplier_FullMethodName = "/poktroll.supplier.Query/Supplier" - Query_AllSuppliers_FullMethodName = "/poktroll.supplier.Query/AllSuppliers" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 Supplier items. - Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) - AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetSupplierResponse) - err := c.cc.Invoke(ctx, Query_Supplier_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllSuppliersResponse) - err := c.cc.Invoke(ctx, Query_AllSuppliers_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Supplier items. - Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) - AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Supplier not implemented") -} -func (UnimplementedQueryServer) AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllSuppliers not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Supplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetSupplierRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Supplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Supplier_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Supplier(ctx, req.(*QueryGetSupplierRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllSuppliers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllSuppliersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllSuppliers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_AllSuppliers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllSuppliers(ctx, req.(*QueryAllSuppliersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.supplier.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Supplier", - Handler: _Query_Supplier_Handler, - }, - { - MethodName: "AllSuppliers", - Handler: _Query_AllSuppliers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/supplier/query.proto", -} diff --git a/api/poktroll/supplier/tx_grpc.pb.go b/api/poktroll/supplier/tx_grpc.pb.go deleted file mode 100644 index a95a976c9..000000000 --- a/api/poktroll/supplier/tx_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/supplier/tx.proto - -package supplier - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.supplier.Msg/UpdateParams" - Msg_StakeSupplier_FullMethodName = "/poktroll.supplier.Msg/StakeSupplier" - Msg_UnstakeSupplier_FullMethodName = "/poktroll.supplier.Msg/UnstakeSupplier" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) - UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgStakeSupplierResponse) - err := c.cc.Invoke(ctx, Msg_StakeSupplier_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUnstakeSupplierResponse) - err := c.cc.Invoke(ctx, Msg_UnstakeSupplier_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) - UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeSupplier not implemented") -} -func (UnimplementedMsgServer) UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeSupplier not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeSupplier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeSupplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_StakeSupplier_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeSupplier(ctx, req.(*MsgStakeSupplier)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeSupplier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeSupplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UnstakeSupplier_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeSupplier(ctx, req.(*MsgUnstakeSupplier)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.supplier.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeSupplier", - Handler: _Msg_StakeSupplier_Handler, - }, - { - MethodName: "UnstakeSupplier", - Handler: _Msg_UnstakeSupplier_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/supplier/tx.proto", -} diff --git a/api/poktroll/tokenomics/query_grpc.pb.go b/api/poktroll/tokenomics/query_grpc.pb.go deleted file mode 100644 index e45017866..000000000 --- a/api/poktroll/tokenomics/query_grpc.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/tokenomics/query.proto - -package tokenomics - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Query_Params_FullMethodName = "/poktroll.tokenomics.Query/Params" - Query_RelayMiningDifficulty_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficulty" - Query_RelayMiningDifficultyAll_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficultyAll" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Query defines the gRPC querier service. -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 RelayMiningDifficulty items. - RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, Query_RelayMiningDifficulty_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, Query_RelayMiningDifficultyAll_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -// -// Query defines the gRPC querier service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of RelayMiningDifficulty items. - RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") -} -func (UnimplementedQueryServer) RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -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: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficulty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_RelayMiningDifficulty_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_RelayMiningDifficultyAll_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.tokenomics.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "RelayMiningDifficulty", - Handler: _Query_RelayMiningDifficulty_Handler, - }, - { - MethodName: "RelayMiningDifficultyAll", - Handler: _Query_RelayMiningDifficultyAll_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/tokenomics/query.proto", -} diff --git a/api/poktroll/tokenomics/tx_grpc.pb.go b/api/poktroll/tokenomics/tx_grpc.pb.go deleted file mode 100644 index 307e37b0b..000000000 --- a/api/poktroll/tokenomics/tx_grpc.pb.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: poktroll/tokenomics/tx.proto - -package tokenomics - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - Msg_UpdateParams_FullMethodName = "/poktroll.tokenomics.Msg/UpdateParams" - Msg_UpdateParam_FullMethodName = "/poktroll.tokenomics.Msg/UpdateParam" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Msg defines the Msg service. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -// -// Msg defines the Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParam_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.tokenomics.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/tokenomics/tx.proto", -} diff --git a/proto/poktroll/supplier/event.proto b/proto/poktroll/supplier/event.proto index 970b9b91e..0227eddd7 100644 --- a/proto/poktroll/supplier/event.proto +++ b/proto/poktroll/supplier/event.proto @@ -11,16 +11,18 @@ import "poktroll/shared/supplier.proto"; // EventSupplierStaked is emitted with the commitment of the supplier is stake message. message EventSupplierStaked { - poktroll.shared.Supplier supplier = 1; + poktroll.shared.Supplier supplier = 1 [(gogoproto.jsontag) = "supplier"]; } // EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. message EventSupplierUnbondingBegin { - poktroll.shared.Supplier supplier = 1; + poktroll.shared.Supplier supplier = 1 [(gogoproto.jsontag) = "supplier"]; + int64 unbonding_height = 2 [(gogoproto.jsontag) = "unbonding_height"]; } // EventSupplierUnbondingEnd is emitted with the commitment of last block of the // supplier unbonding period. message EventSupplierUnbondingEnd { - poktroll.shared.Supplier supplier = 1; + poktroll.shared.Supplier supplier = 1 [(gogoproto.jsontag) = "supplier"]; + int64 unbonding_height = 2 [(gogoproto.jsontag) = "unbonding_height"]; } diff --git a/x/application/types/event.pb.go b/x/application/types/event.pb.go deleted file mode 100644 index 7d331adec..000000000 --- a/x/application/types/event.pb.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/event.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// EventRedelegation is an event emitted whenever an application changes its -// delegatee gateways on chain. This is in response to both a DelegateToGateway -// and UndelegateFromGateway message. -type EventRedelegation struct { - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` -} - -func (m *EventRedelegation) Reset() { *m = EventRedelegation{} } -func (m *EventRedelegation) String() string { return proto.CompactTextString(m) } -func (*EventRedelegation) ProtoMessage() {} -func (*EventRedelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_d0d229437c622598, []int{0} -} -func (m *EventRedelegation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventRedelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventRedelegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRedelegation.Merge(m, src) -} -func (m *EventRedelegation) XXX_Size() int { - return m.Size() -} -func (m *EventRedelegation) XXX_DiscardUnknown() { - xxx_messageInfo_EventRedelegation.DiscardUnknown(m) -} - -var xxx_messageInfo_EventRedelegation proto.InternalMessageInfo - -func (m *EventRedelegation) GetAppAddress() string { - if m != nil { - return m.AppAddress - } - return "" -} - -func (m *EventRedelegation) GetGatewayAddress() string { - if m != nil { - return m.GatewayAddress - } - return "" -} - -func init() { - proto.RegisterType((*EventRedelegation)(nil), "poktroll.application.EventRedelegation") -} - -func init() { proto.RegisterFile("poktroll/application/event.proto", fileDescriptor_d0d229437c622598) } - -var fileDescriptor_d0d229437c622598 = []byte{ - // 248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, - 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa9, - 0xd0, 0x43, 0x52, 0x21, 0x25, 0x99, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x1c, 0x0f, 0x56, 0xa3, 0x0f, - 0xe1, 0x40, 0x34, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x43, 0xc4, 0x41, 0x2c, 0x88, 0xa8, 0xd2, - 0x44, 0x46, 0x2e, 0x41, 0x57, 0x90, 0xb1, 0x41, 0xa9, 0x29, 0xa9, 0x39, 0xa9, 0xe9, 0x60, 0x63, - 0x84, 0x2c, 0xb9, 0xb8, 0x13, 0x0b, 0x0a, 0xe2, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, - 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x1a, 0xe9, 0x08, 0x91, - 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0xe2, 0x4a, 0x2c, 0x28, 0x80, 0x8a, 0x08, 0x39, 0x72, - 0xf1, 0xa7, 0x27, 0x96, 0xa4, 0x96, 0x27, 0x56, 0xc2, 0xb5, 0x33, 0x11, 0xd0, 0xce, 0x07, 0xd5, - 0x00, 0x15, 0x75, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, - 0x61, 0xa0, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0f, 0xb2, 0x0a, 0x94, 0x40, - 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x7b, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0xca, 0xe7, 0xe9, 0xb0, 0x59, 0x01, 0x00, 0x00, -} - -func (m *EventRedelegation) 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 *EventRedelegation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventRedelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GatewayAddress) > 0 { - i -= len(m.GatewayAddress) - copy(dAtA[i:], m.GatewayAddress) - i = encodeVarintEvent(dAtA, i, uint64(len(m.GatewayAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.AppAddress) > 0 { - i -= len(m.AppAddress) - copy(dAtA[i:], m.AppAddress) - i = encodeVarintEvent(dAtA, i, uint64(len(m.AppAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventRedelegation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AppAddress) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.GatewayAddress) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventRedelegation) 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 ErrIntOverflowEvent - } - 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: EventRedelegation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventRedelegation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GatewayAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/application/types/genesis.pb.go b/x/application/types/genesis.pb.go deleted file mode 100644 index 0f0b4e831..000000000 --- a/x/application/types/genesis.pb.go +++ /dev/null @@ -1,387 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the application module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ApplicationList []Application `protobuf:"bytes,2,rep,name=application_list,json=applicationList,proto3" json:"application_list"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad2a010ae2744ea, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetApplicationList() []Application { - if m != nil { - return m.ApplicationList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.application.GenesisState") -} - -func init() { - proto.RegisterFile("poktroll/application/genesis.proto", fileDescriptor_7ad2a010ae2744ea) -} - -var fileDescriptor_7ad2a010ae2744ea = []byte{ - // 265 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, - 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x81, 0xa9, 0xd1, 0x43, 0x52, 0x23, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, - 0x0a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a, 0xaa, 0x88, 0xd5, - 0x8a, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x0d, 0x52, 0x0a, 0x58, 0x95, 0x94, 0x54, 0x16, 0xa4, - 0x42, 0x55, 0x28, 0x2d, 0x66, 0xe4, 0xe2, 0x71, 0x87, 0xb8, 0x2a, 0xb8, 0x24, 0xb1, 0x24, 0x55, - 0xc8, 0x9e, 0x8b, 0x0d, 0x62, 0x84, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x8c, 0x1e, 0x36, - 0x57, 0xea, 0x05, 0x80, 0xd5, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, - 0xc6, 0x20, 0xa8, 0x36, 0xa1, 0x20, 0x2e, 0x01, 0x24, 0x85, 0xf1, 0x39, 0x99, 0xc5, 0x25, 0x12, - 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x8a, 0xd8, 0x8d, 0x72, 0x44, 0xb0, 0x9d, 0x58, 0x40, 0xe6, - 0x05, 0xf1, 0x23, 0x49, 0xfb, 0x64, 0x16, 0x97, 0x38, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, - 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x1b, 0x74, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, - 0xe1, 0xbe, 0xaf, 0xc0, 0xf4, 0x7f, 0x12, 0x1b, 0x38, 0x00, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xc5, 0x7a, 0x1b, 0xd6, 0xaa, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ApplicationList) > 0 { - for iNdEx := len(m.ApplicationList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ApplicationList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.ApplicationList) > 0 { - for _, e := range m.ApplicationList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationList", 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.ApplicationList = append(m.ApplicationList, Application{}) - if err := m.ApplicationList[len(m.ApplicationList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/application/types/params.pb.go b/x/application/types/params.pb.go deleted file mode 100644 index 83ea72845..000000000 --- a/x/application/types/params.pb.go +++ /dev/null @@ -1,330 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { - // max_delegated_gateways defines the maximum number of gateways that a single - // application can delegate to. This is used to prevent performance issues - // in case the relay ring signature becomes too large. - MaxDelegatedGateways uint64 `protobuf:"varint,1,opt,name=max_delegated_gateways,json=maxDelegatedGateways,proto3" json:"max_delegated_gateways" yaml:"max_delegated_gateways"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_16533d77d399ef60, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetMaxDelegatedGateways() uint64 { - if m != nil { - return m.MaxDelegatedGateways - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.application.Params") -} - -func init() { proto.RegisterFile("poktroll/application/params.proto", fileDescriptor_16533d77d399ef60) } - -var fileDescriptor_16533d77d399ef60 = []byte{ - // 248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, - 0xd3, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, - 0x29, 0xd1, 0x43, 0x52, 0x22, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x0a, - 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x22, 0xaa, 0xb4, 0x98, 0x91, - 0x8b, 0x2d, 0x00, 0x6c, 0x9e, 0x50, 0x21, 0x97, 0x58, 0x6e, 0x62, 0x45, 0x7c, 0x4a, 0x6a, 0x4e, - 0x6a, 0x7a, 0x62, 0x49, 0x6a, 0x4a, 0x3c, 0x88, 0x2c, 0x4f, 0xac, 0x2c, 0x96, 0x60, 0x54, 0x60, - 0xd4, 0x60, 0x71, 0xb2, 0x7e, 0x75, 0x4f, 0x1e, 0x87, 0x8a, 0x4f, 0xf7, 0xe4, 0x65, 0x2b, 0x13, - 0x73, 0x73, 0xac, 0x94, 0xb0, 0xcb, 0x2b, 0x05, 0x89, 0xe4, 0x26, 0x56, 0xb8, 0xc0, 0xc4, 0xdd, - 0xa1, 0xc2, 0x56, 0x6a, 0x2f, 0x16, 0xc8, 0x33, 0x76, 0x3d, 0xdf, 0xa0, 0x25, 0x0b, 0xf7, 0x68, - 0x05, 0x8a, 0x57, 0x21, 0x4e, 0x73, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, - 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, - 0x73, 0xf5, 0x41, 0xe6, 0xe8, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xe3, 0x30, 0xb4, - 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x00, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xcb, 0xd1, 0x5a, 0xaa, 0x64, 0x01, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxDelegatedGateways != that1.MaxDelegatedGateways { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxDelegatedGateways != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxDelegatedGateways)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxDelegatedGateways != 0 { - n += 1 + sovParams(uint64(m.MaxDelegatedGateways)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxDelegatedGateways", wireType) - } - m.MaxDelegatedGateways = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxDelegatedGateways |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/application/types/query.pb.go b/x/application/types/query.pb.go deleted file mode 100644 index fa797343a..000000000 --- a/x/application/types/query.pb.go +++ /dev/null @@ -1,1366 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetApplicationRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryGetApplicationRequest) Reset() { *m = QueryGetApplicationRequest{} } -func (m *QueryGetApplicationRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetApplicationRequest) ProtoMessage() {} -func (*QueryGetApplicationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{2} -} -func (m *QueryGetApplicationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetApplicationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetApplicationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetApplicationRequest.Merge(m, src) -} -func (m *QueryGetApplicationRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetApplicationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetApplicationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetApplicationRequest proto.InternalMessageInfo - -func (m *QueryGetApplicationRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type QueryGetApplicationResponse struct { - Application Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application"` -} - -func (m *QueryGetApplicationResponse) Reset() { *m = QueryGetApplicationResponse{} } -func (m *QueryGetApplicationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetApplicationResponse) ProtoMessage() {} -func (*QueryGetApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{3} -} -func (m *QueryGetApplicationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetApplicationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetApplicationResponse.Merge(m, src) -} -func (m *QueryGetApplicationResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetApplicationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetApplicationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetApplicationResponse proto.InternalMessageInfo - -func (m *QueryGetApplicationResponse) GetApplication() Application { - if m != nil { - return m.Application - } - return Application{} -} - -type QueryAllApplicationsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllApplicationsRequest) Reset() { *m = QueryAllApplicationsRequest{} } -func (m *QueryAllApplicationsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllApplicationsRequest) ProtoMessage() {} -func (*QueryAllApplicationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{4} -} -func (m *QueryAllApplicationsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllApplicationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllApplicationsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllApplicationsRequest.Merge(m, src) -} -func (m *QueryAllApplicationsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllApplicationsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllApplicationsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllApplicationsRequest proto.InternalMessageInfo - -func (m *QueryAllApplicationsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllApplicationsResponse struct { - Applications []Application `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllApplicationsResponse) Reset() { *m = QueryAllApplicationsResponse{} } -func (m *QueryAllApplicationsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllApplicationsResponse) ProtoMessage() {} -func (*QueryAllApplicationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5cf77e4e046ed3a7, []int{5} -} -func (m *QueryAllApplicationsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllApplicationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllApplicationsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllApplicationsResponse.Merge(m, src) -} -func (m *QueryAllApplicationsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllApplicationsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllApplicationsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllApplicationsResponse proto.InternalMessageInfo - -func (m *QueryAllApplicationsResponse) GetApplications() []Application { - if m != nil { - return m.Applications - } - return nil -} - -func (m *QueryAllApplicationsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.application.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.application.QueryParamsResponse") - proto.RegisterType((*QueryGetApplicationRequest)(nil), "poktroll.application.QueryGetApplicationRequest") - proto.RegisterType((*QueryGetApplicationResponse)(nil), "poktroll.application.QueryGetApplicationResponse") - proto.RegisterType((*QueryAllApplicationsRequest)(nil), "poktroll.application.QueryAllApplicationsRequest") - proto.RegisterType((*QueryAllApplicationsResponse)(nil), "poktroll.application.QueryAllApplicationsResponse") -} - -func init() { proto.RegisterFile("poktroll/application/query.proto", fileDescriptor_5cf77e4e046ed3a7) } - -var fileDescriptor_5cf77e4e046ed3a7 = []byte{ - // 538 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x73, 0xa5, 0x04, 0xf5, 0x82, 0x84, 0x38, 0x32, 0x54, 0x26, 0x32, 0xad, 0x07, 0x68, - 0x8b, 0xb8, 0x6b, 0x02, 0xaa, 0x10, 0x0b, 0x34, 0x03, 0x15, 0x62, 0x29, 0x1e, 0x18, 0xd8, 0x2e, - 0xe9, 0xc9, 0xb5, 0xea, 0xf8, 0x75, 0xed, 0x0b, 0x50, 0x21, 0x16, 0xc4, 0x07, 0xa8, 0xc4, 0x97, - 0x60, 0xec, 0xd0, 0x0f, 0xd1, 0xb1, 0x12, 0x4b, 0x27, 0x84, 0x12, 0x24, 0xbe, 0x06, 0xf2, 0xdd, - 0x59, 0xbd, 0xd0, 0x23, 0x6d, 0x96, 0xe8, 0x62, 0x3f, 0xcf, 0x3d, 0xbf, 0xf7, 0x8f, 0x8c, 0x97, - 0x32, 0xd8, 0x93, 0x39, 0x24, 0x09, 0xe3, 0x59, 0x96, 0xc4, 0x7d, 0x2e, 0x63, 0x48, 0xd9, 0xfe, - 0x50, 0xe4, 0x07, 0x34, 0xcb, 0x41, 0x02, 0x69, 0x56, 0x0a, 0x6a, 0x29, 0xbc, 0xdb, 0x7c, 0x10, - 0xa7, 0xc0, 0xd4, 0xaf, 0x16, 0x7a, 0xcd, 0x08, 0x22, 0x50, 0x47, 0x56, 0x9e, 0xcc, 0xd3, 0x56, - 0x04, 0x10, 0x25, 0x82, 0xf1, 0x2c, 0x66, 0x3c, 0x4d, 0x41, 0x2a, 0x7f, 0x61, 0xde, 0xae, 0xf5, - 0xa1, 0x18, 0x40, 0xc1, 0x7a, 0xbc, 0x10, 0x3a, 0x95, 0xbd, 0x6f, 0xf7, 0x84, 0xe4, 0x6d, 0x96, - 0xf1, 0x28, 0x4e, 0x95, 0xd8, 0x68, 0x7d, 0x5b, 0x5b, 0xa9, 0xfa, 0x10, 0x57, 0xef, 0x97, 0x9d, - 0xa5, 0x64, 0x3c, 0xe7, 0x83, 0x2a, 0xce, 0x5d, 0xad, 0x3c, 0xc8, 0x84, 0x51, 0x04, 0x4d, 0x4c, - 0xde, 0x94, 0x18, 0xdb, 0xca, 0x16, 0x8a, 0xfd, 0xa1, 0x28, 0x64, 0xf0, 0x16, 0xdf, 0x99, 0x78, - 0x5a, 0x64, 0x90, 0x16, 0x82, 0x3c, 0xc7, 0x75, 0x7d, 0xfd, 0x22, 0x5a, 0x42, 0x2b, 0x8d, 0x4e, - 0x8b, 0xba, 0x7a, 0x45, 0xb5, 0xab, 0xbb, 0x70, 0xf2, 0xf3, 0x5e, 0xed, 0xfb, 0x9f, 0xa3, 0x35, - 0x14, 0x1a, 0x5b, 0xb0, 0x81, 0x3d, 0x75, 0xef, 0x96, 0x90, 0x9b, 0xe7, 0x06, 0x93, 0x4a, 0x16, - 0xf1, 0x0d, 0xbe, 0xb3, 0x93, 0x8b, 0x42, 0xdf, 0xbf, 0x10, 0x56, 0x7f, 0x83, 0x5d, 0x7c, 0xd7, - 0xe9, 0x33, 0x5c, 0xaf, 0x70, 0xc3, 0xca, 0x37, 0x70, 0xcb, 0x6e, 0x38, 0xcb, 0xdf, 0x9d, 0x2f, - 0x09, 0x43, 0xdb, 0x1b, 0x08, 0x93, 0xb4, 0x99, 0x24, 0x96, 0xb2, 0x6a, 0x0c, 0x79, 0x89, 0xf1, - 0xf9, 0x9c, 0x4c, 0xd0, 0x7d, 0xaa, 0x07, 0x45, 0xcb, 0x41, 0x51, 0xbd, 0x4a, 0x66, 0x5c, 0x74, - 0x9b, 0x47, 0xc2, 0x78, 0x43, 0xcb, 0x19, 0x1c, 0x23, 0xdc, 0x72, 0xe7, 0x98, 0x92, 0x5e, 0xe3, - 0x9b, 0x16, 0x56, 0xd9, 0x90, 0x6b, 0xb3, 0xd4, 0x34, 0x61, 0x26, 0x5b, 0x13, 0xd4, 0x73, 0x8a, - 0xfa, 0xc1, 0xa5, 0xd4, 0x9a, 0xc4, 0xc6, 0xee, 0x7c, 0x9d, 0xc7, 0xd7, 0x15, 0x36, 0x39, 0x44, - 0xb8, 0xae, 0xe7, 0x4c, 0x56, 0xdc, 0x50, 0x17, 0xd7, 0xca, 0x5b, 0xbd, 0x82, 0x52, 0xa7, 0x06, - 0xed, 0x2f, 0x3f, 0x7e, 0x7f, 0x9b, 0x7b, 0x48, 0x56, 0x59, 0x69, 0x79, 0x94, 0x0a, 0xf9, 0x01, - 0xf2, 0x3d, 0x36, 0x65, 0xe5, 0xc9, 0x31, 0xc2, 0x0d, 0xab, 0x13, 0x64, 0x7d, 0x4a, 0x9a, 0x73, - 0x01, 0xbd, 0xf6, 0x0c, 0x0e, 0xc3, 0xf9, 0x42, 0x71, 0x3e, 0x23, 0x4f, 0xaf, 0xc0, 0x69, 0x9f, - 0x3f, 0x99, 0xd5, 0xfe, 0x4c, 0x8e, 0x10, 0xbe, 0xf5, 0xcf, 0x16, 0x90, 0x69, 0x20, 0xee, 0xcd, - 0xf4, 0x3a, 0xb3, 0x58, 0x0c, 0xfc, 0x86, 0x82, 0x5f, 0x27, 0x74, 0x36, 0xf8, 0x6e, 0x78, 0x32, - 0xf2, 0xd1, 0xe9, 0xc8, 0x47, 0x67, 0x23, 0x1f, 0xfd, 0x1a, 0xf9, 0xe8, 0x70, 0xec, 0xd7, 0x4e, - 0xc7, 0x7e, 0xed, 0x6c, 0xec, 0xd7, 0xde, 0x3d, 0x89, 0x62, 0xb9, 0x3b, 0xec, 0xd1, 0x3e, 0x0c, - 0xfe, 0x73, 0xef, 0xc7, 0x8b, 0x9f, 0xa3, 0x5e, 0x5d, 0x7d, 0x8f, 0x1e, 0xff, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0xab, 0x23, 0x79, 0xa6, 0xa1, 0x05, 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 Application items. - Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) - AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.application.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) { - out := new(QueryGetApplicationResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Query/Application", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) { - out := new(QueryAllApplicationsResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Query/AllApplications", in, out, opts...) - 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 Application items. - Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) - AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, 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) Application(ctx context.Context, req *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Application not implemented") -} -func (*UnimplementedQueryServer) AllApplications(ctx context.Context, req *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllApplications not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.application.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 _Query_Application_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetApplicationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Application(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Query/Application", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Application(ctx, req.(*QueryGetApplicationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllApplicationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllApplications(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Query/AllApplications", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllApplications(ctx, req.(*QueryAllApplicationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.application.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Application", - Handler: _Query_Application_Handler, - }, - { - MethodName: "AllApplications", - Handler: _Query_AllApplications_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/application/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetApplicationRequest) 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 *QueryGetApplicationRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetApplicationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 len(dAtA) - i, nil -} - -func (m *QueryGetApplicationResponse) 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 *QueryGetApplicationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Application.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 *QueryAllApplicationsRequest) 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 *QueryAllApplicationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllApplicationsRequest) 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 *QueryAllApplicationsResponse) 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 *QueryAllApplicationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllApplicationsResponse) 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.Applications) > 0 { - for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Applications[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 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 *QueryGetApplicationRequest) 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)) - } - return n -} - -func (m *QueryGetApplicationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Application.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllApplicationsRequest) 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 *QueryAllApplicationsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Applications) > 0 { - for _, e := range m.Applications { - 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 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 *QueryGetApplicationRequest) 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: QueryGetApplicationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetApplicationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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 *QueryGetApplicationResponse) 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: QueryGetApplicationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Application", 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.Application.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 *QueryAllApplicationsRequest) 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: QueryAllApplicationsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllApplicationsRequest: 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllApplicationsResponse) 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: QueryAllApplicationsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllApplicationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Applications", 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.Applications = append(m.Applications, Application{}) - if err := m.Applications[len(m.Applications)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/application/types/query.pb.gw.go b/x/application/types/query.pb.gw.go deleted file mode 100644 index 362f63ea2..000000000 --- a/x/application/types/query.pb.gw.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/application/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Application_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetApplicationRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.Application(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Application_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetApplicationRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.Application(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllApplications_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllApplications_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllApplicationsRequest - 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_AllApplications_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllApplications(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllApplications_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllApplicationsRequest - 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_AllApplications_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllApplications(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Application_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_Application_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_Application_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllApplications_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_AllApplications_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_AllApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Application_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_Application_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_Application_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllApplications_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_AllApplications_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_AllApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "application", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Application_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "application", "address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllApplications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "application"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Application_0 = runtime.ForwardResponseMessage - - forward_Query_AllApplications_0 = runtime.ForwardResponseMessage -) diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go deleted file mode 100644 index eb938d65d..000000000 --- a/x/application/types/tx.pb.go +++ /dev/null @@ -1,2103 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/pokt-network/poktroll/x/shared/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/application parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -type MsgStakeApplication struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*types1.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` -} - -func (m *MsgStakeApplication) Reset() { *m = MsgStakeApplication{} } -func (m *MsgStakeApplication) String() string { return proto.CompactTextString(m) } -func (*MsgStakeApplication) ProtoMessage() {} -func (*MsgStakeApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{2} -} -func (m *MsgStakeApplication) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeApplication) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeApplication.Merge(m, src) -} -func (m *MsgStakeApplication) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeApplication) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeApplication.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeApplication proto.InternalMessageInfo - -func (m *MsgStakeApplication) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *MsgStakeApplication) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -func (m *MsgStakeApplication) GetServices() []*types1.ApplicationServiceConfig { - if m != nil { - return m.Services - } - return nil -} - -type MsgStakeApplicationResponse struct { -} - -func (m *MsgStakeApplicationResponse) Reset() { *m = MsgStakeApplicationResponse{} } -func (m *MsgStakeApplicationResponse) String() string { return proto.CompactTextString(m) } -func (*MsgStakeApplicationResponse) ProtoMessage() {} -func (*MsgStakeApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{3} -} -func (m *MsgStakeApplicationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeApplicationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeApplicationResponse.Merge(m, src) -} -func (m *MsgStakeApplicationResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeApplicationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeApplicationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeApplicationResponse proto.InternalMessageInfo - -type MsgUnstakeApplication struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *MsgUnstakeApplication) Reset() { *m = MsgUnstakeApplication{} } -func (m *MsgUnstakeApplication) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeApplication) ProtoMessage() {} -func (*MsgUnstakeApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{4} -} -func (m *MsgUnstakeApplication) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeApplication) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeApplication.Merge(m, src) -} -func (m *MsgUnstakeApplication) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeApplication) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeApplication.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeApplication proto.InternalMessageInfo - -func (m *MsgUnstakeApplication) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type MsgUnstakeApplicationResponse struct { -} - -func (m *MsgUnstakeApplicationResponse) Reset() { *m = MsgUnstakeApplicationResponse{} } -func (m *MsgUnstakeApplicationResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeApplicationResponse) ProtoMessage() {} -func (*MsgUnstakeApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{5} -} -func (m *MsgUnstakeApplicationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeApplicationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeApplicationResponse.Merge(m, src) -} -func (m *MsgUnstakeApplicationResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeApplicationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeApplicationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeApplicationResponse proto.InternalMessageInfo - -type MsgDelegateToGateway struct { - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` -} - -func (m *MsgDelegateToGateway) Reset() { *m = MsgDelegateToGateway{} } -func (m *MsgDelegateToGateway) String() string { return proto.CompactTextString(m) } -func (*MsgDelegateToGateway) ProtoMessage() {} -func (*MsgDelegateToGateway) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{6} -} -func (m *MsgDelegateToGateway) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDelegateToGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgDelegateToGateway) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDelegateToGateway.Merge(m, src) -} -func (m *MsgDelegateToGateway) XXX_Size() int { - return m.Size() -} -func (m *MsgDelegateToGateway) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDelegateToGateway.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDelegateToGateway proto.InternalMessageInfo - -func (m *MsgDelegateToGateway) GetAppAddress() string { - if m != nil { - return m.AppAddress - } - return "" -} - -func (m *MsgDelegateToGateway) GetGatewayAddress() string { - if m != nil { - return m.GatewayAddress - } - return "" -} - -type MsgDelegateToGatewayResponse struct { -} - -func (m *MsgDelegateToGatewayResponse) Reset() { *m = MsgDelegateToGatewayResponse{} } -func (m *MsgDelegateToGatewayResponse) String() string { return proto.CompactTextString(m) } -func (*MsgDelegateToGatewayResponse) ProtoMessage() {} -func (*MsgDelegateToGatewayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{7} -} -func (m *MsgDelegateToGatewayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDelegateToGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgDelegateToGatewayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDelegateToGatewayResponse.Merge(m, src) -} -func (m *MsgDelegateToGatewayResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgDelegateToGatewayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDelegateToGatewayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDelegateToGatewayResponse proto.InternalMessageInfo - -type MsgUndelegateFromGateway struct { - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` -} - -func (m *MsgUndelegateFromGateway) Reset() { *m = MsgUndelegateFromGateway{} } -func (m *MsgUndelegateFromGateway) String() string { return proto.CompactTextString(m) } -func (*MsgUndelegateFromGateway) ProtoMessage() {} -func (*MsgUndelegateFromGateway) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{8} -} -func (m *MsgUndelegateFromGateway) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUndelegateFromGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUndelegateFromGateway) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUndelegateFromGateway.Merge(m, src) -} -func (m *MsgUndelegateFromGateway) XXX_Size() int { - return m.Size() -} -func (m *MsgUndelegateFromGateway) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUndelegateFromGateway.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUndelegateFromGateway proto.InternalMessageInfo - -func (m *MsgUndelegateFromGateway) GetAppAddress() string { - if m != nil { - return m.AppAddress - } - return "" -} - -func (m *MsgUndelegateFromGateway) GetGatewayAddress() string { - if m != nil { - return m.GatewayAddress - } - return "" -} - -type MsgUndelegateFromGatewayResponse struct { -} - -func (m *MsgUndelegateFromGatewayResponse) Reset() { *m = MsgUndelegateFromGatewayResponse{} } -func (m *MsgUndelegateFromGatewayResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUndelegateFromGatewayResponse) ProtoMessage() {} -func (*MsgUndelegateFromGatewayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bed224e38ab1cc6d, []int{9} -} -func (m *MsgUndelegateFromGatewayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUndelegateFromGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUndelegateFromGatewayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUndelegateFromGatewayResponse.Merge(m, src) -} -func (m *MsgUndelegateFromGatewayResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUndelegateFromGatewayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUndelegateFromGatewayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUndelegateFromGatewayResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.application.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.application.MsgUpdateParamsResponse") - proto.RegisterType((*MsgStakeApplication)(nil), "poktroll.application.MsgStakeApplication") - proto.RegisterType((*MsgStakeApplicationResponse)(nil), "poktroll.application.MsgStakeApplicationResponse") - proto.RegisterType((*MsgUnstakeApplication)(nil), "poktroll.application.MsgUnstakeApplication") - proto.RegisterType((*MsgUnstakeApplicationResponse)(nil), "poktroll.application.MsgUnstakeApplicationResponse") - proto.RegisterType((*MsgDelegateToGateway)(nil), "poktroll.application.MsgDelegateToGateway") - proto.RegisterType((*MsgDelegateToGatewayResponse)(nil), "poktroll.application.MsgDelegateToGatewayResponse") - proto.RegisterType((*MsgUndelegateFromGateway)(nil), "poktroll.application.MsgUndelegateFromGateway") - proto.RegisterType((*MsgUndelegateFromGatewayResponse)(nil), "poktroll.application.MsgUndelegateFromGatewayResponse") -} - -func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } - -var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 670 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x4f, 0x13, 0x41, - 0x14, 0xef, 0x82, 0xa0, 0x3c, 0x88, 0xc0, 0x5a, 0x42, 0x59, 0x61, 0xa9, 0x4d, 0x34, 0x50, 0xc3, - 0x4e, 0x5a, 0x0c, 0x09, 0x5c, 0x08, 0xe0, 0x9f, 0x53, 0x13, 0x53, 0xf4, 0xe2, 0x85, 0x4c, 0xdb, - 0x71, 0xd8, 0xd0, 0xee, 0x4c, 0x76, 0x86, 0x02, 0x27, 0x8d, 0x47, 0x4f, 0x7e, 0x0a, 0x63, 0x3c, - 0x71, 0xf0, 0x2b, 0x98, 0x70, 0x93, 0x70, 0xe2, 0x64, 0x4c, 0x39, 0xf0, 0x35, 0xcc, 0x76, 0x66, - 0xb7, 0xb0, 0xdd, 0x4a, 0xb9, 0x79, 0x69, 0xbb, 0xf3, 0x7e, 0xef, 0xf7, 0xe7, 0xcd, 0xcc, 0x16, - 0xe6, 0x38, 0xdb, 0x93, 0x3e, 0xab, 0xd7, 0x11, 0xe6, 0xbc, 0xee, 0x56, 0xb1, 0x74, 0x99, 0x87, - 0xe4, 0xa1, 0xc3, 0x7d, 0x26, 0x99, 0x99, 0x0e, 0xcb, 0xce, 0x95, 0xb2, 0x35, 0x89, 0x1b, 0xae, - 0xc7, 0x50, 0xfb, 0x53, 0x01, 0xad, 0x99, 0x2a, 0x13, 0x0d, 0x26, 0x76, 0xda, 0x4f, 0x48, 0x3d, - 0xe8, 0x92, 0xad, 0x9e, 0x50, 0x05, 0x0b, 0x82, 0x9a, 0x85, 0x0a, 0x91, 0xb8, 0x80, 0xaa, 0xcc, - 0xf5, 0x74, 0x7d, 0x5a, 0xd7, 0x1b, 0x82, 0xa2, 0x66, 0x21, 0xf8, 0xd2, 0x85, 0x34, 0x65, 0x94, - 0x29, 0xc2, 0xe0, 0x97, 0x5e, 0x7d, 0x94, 0xe8, 0x98, 0x63, 0x1f, 0x37, 0x42, 0xc5, 0x4e, 0x28, - 0xb1, 0x8b, 0x7d, 0x52, 0x43, 0x82, 0xf8, 0x4d, 0xb7, 0x4a, 0x54, 0x39, 0xf7, 0xd3, 0x80, 0xf1, - 0x92, 0xa0, 0x6f, 0x79, 0x0d, 0x4b, 0xf2, 0xba, 0xdd, 0x68, 0xae, 0xc0, 0x08, 0xde, 0x97, 0xbb, - 0xcc, 0x77, 0xe5, 0x51, 0xc6, 0xc8, 0x1a, 0x0b, 0x23, 0x9b, 0x99, 0xb3, 0x1f, 0x4b, 0x69, 0x9d, - 0x64, 0xa3, 0x56, 0xf3, 0x89, 0x10, 0xdb, 0xd2, 0x77, 0x3d, 0x5a, 0xee, 0x40, 0xcd, 0x75, 0x18, - 0x56, 0xd2, 0x99, 0x81, 0xac, 0xb1, 0x30, 0x5a, 0x9c, 0x75, 0x92, 0x26, 0xe6, 0x28, 0x95, 0xcd, - 0x91, 0x93, 0xdf, 0xf3, 0xa9, 0x6f, 0x97, 0xc7, 0x79, 0xa3, 0xac, 0xdb, 0xd6, 0x56, 0x3f, 0x5d, - 0x1e, 0xe7, 0x3b, 0x84, 0x9f, 0x2f, 0x8f, 0xf3, 0x4f, 0x22, 0xfb, 0x87, 0xd7, 0x32, 0xc6, 0x3c, - 0xe7, 0x66, 0x60, 0x3a, 0xb6, 0x54, 0x26, 0x82, 0x33, 0x4f, 0x90, 0xdc, 0x2f, 0x03, 0x1e, 0x94, - 0x04, 0xdd, 0x96, 0x78, 0x8f, 0x6c, 0x74, 0x28, 0xcc, 0x22, 0xdc, 0xc5, 0x2a, 0xca, 0x8d, 0x21, - 0x43, 0xa0, 0x89, 0x60, 0x48, 0x04, 0x3c, 0x3a, 0xe1, 0x8c, 0xa3, 0xe1, 0xc1, 0x7e, 0x3a, 0x7a, - 0x3f, 0x9d, 0x2d, 0xe6, 0x7a, 0x65, 0x85, 0x33, 0x5f, 0xc0, 0x3d, 0x3d, 0x70, 0x91, 0x19, 0xcc, - 0x0e, 0x2e, 0x8c, 0x16, 0x17, 0x3b, 0x53, 0x51, 0x3b, 0xe2, 0x5c, 0x31, 0xb5, 0xad, 0xb0, 0x5b, - 0xcc, 0x7b, 0xef, 0xd2, 0x72, 0xd4, 0xba, 0x36, 0x16, 0x4c, 0x26, 0x74, 0x91, 0x9b, 0x83, 0x87, - 0x09, 0x81, 0xa2, 0xc0, 0xeb, 0x30, 0x15, 0xcc, 0xc2, 0x13, 0xf1, 0xc4, 0x99, 0x58, 0xe2, 0x28, - 0x57, 0x8c, 0x7f, 0x1e, 0xe6, 0x12, 0x09, 0x22, 0x85, 0xaf, 0x06, 0xa4, 0x4b, 0x82, 0x3e, 0x27, - 0x75, 0x42, 0xb1, 0x24, 0x6f, 0xd8, 0x2b, 0x2c, 0xc9, 0x01, 0x3e, 0x32, 0x57, 0x61, 0x14, 0x73, - 0xbe, 0xd3, 0xef, 0x5c, 0x01, 0x73, 0xae, 0x57, 0xcc, 0x0d, 0x18, 0xa7, 0x8a, 0x25, 0x6a, 0x1f, - 0xb8, 0xa1, 0xfd, 0xbe, 0x6e, 0xd0, 0xab, 0x6b, 0x13, 0x41, 0x8a, 0xab, 0x06, 0x72, 0x36, 0xcc, - 0x26, 0xf9, 0x8c, 0x82, 0x7c, 0x37, 0x20, 0xd3, 0x8e, 0x5a, 0xd3, 0x90, 0x97, 0x3e, 0x6b, 0xfc, - 0xaf, 0x61, 0x72, 0x90, 0xed, 0xe5, 0x35, 0x0c, 0x54, 0x3c, 0xbb, 0x03, 0x83, 0x25, 0x41, 0xcd, - 0x1a, 0x8c, 0x5d, 0xbb, 0xd3, 0x8f, 0x93, 0xef, 0x62, 0xec, 0xce, 0x58, 0x4b, 0x7d, 0xc1, 0x42, - 0x35, 0x93, 0xc3, 0x44, 0xd7, 0xb5, 0x5a, 0xec, 0x49, 0x11, 0x87, 0x5a, 0x85, 0xbe, 0xa1, 0x91, - 0x62, 0x13, 0xcc, 0x84, 0x83, 0xfd, 0xb4, 0xb7, 0xed, 0x2e, 0xb0, 0xb5, 0x7c, 0x0b, 0x70, 0xa4, - 0x2b, 0x60, 0xb2, 0xfb, 0xb4, 0xe7, 0x7b, 0x32, 0x75, 0x61, 0xad, 0x62, 0xff, 0xd8, 0x48, 0xf4, - 0x03, 0x4c, 0x25, 0x9f, 0x4c, 0xe7, 0x1f, 0x11, 0x12, 0xf0, 0xd6, 0xca, 0xed, 0xf0, 0xa1, 0x01, - 0x6b, 0xe8, 0x63, 0xf0, 0x7e, 0xde, 0x2c, 0x9f, 0xb4, 0x6c, 0xe3, 0xb4, 0x65, 0x1b, 0xe7, 0x2d, - 0xdb, 0xf8, 0xd3, 0xb2, 0x8d, 0x2f, 0x17, 0x76, 0xea, 0xf4, 0xc2, 0x4e, 0x9d, 0x5f, 0xd8, 0xa9, - 0x77, 0xcf, 0xa8, 0x2b, 0x77, 0xf7, 0x2b, 0x4e, 0x95, 0x35, 0x50, 0x20, 0xb3, 0xe4, 0x11, 0x79, - 0xc0, 0xfc, 0x3d, 0xd4, 0xe3, 0xd5, 0x2d, 0x8f, 0x38, 0x11, 0x95, 0xe1, 0xf6, 0xff, 0xcf, 0xf2, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x43, 0x0b, 0x7e, 0x75, 0x07, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) - UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) - DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) - UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) { - out := new(MsgStakeApplicationResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Msg/StakeApplication", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) { - out := new(MsgUnstakeApplicationResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UnstakeApplication", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) { - out := new(MsgDelegateToGatewayResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Msg/DelegateToGateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) { - out := new(MsgUndelegateFromGatewayResponse) - err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UndelegateFromGateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) - UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) - DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) - UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) StakeApplication(ctx context.Context, req *MsgStakeApplication) (*MsgStakeApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeApplication not implemented") -} -func (*UnimplementedMsgServer) UnstakeApplication(ctx context.Context, req *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeApplication not implemented") -} -func (*UnimplementedMsgServer) DelegateToGateway(ctx context.Context, req *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegateToGateway not implemented") -} -func (*UnimplementedMsgServer) UndelegateFromGateway(ctx context.Context, req *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeApplication) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeApplication(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Msg/StakeApplication", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeApplication(ctx, req.(*MsgStakeApplication)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeApplication) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeApplication(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Msg/UnstakeApplication", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeApplication(ctx, req.(*MsgUnstakeApplication)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_DelegateToGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDelegateToGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DelegateToGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Msg/DelegateToGateway", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DelegateToGateway(ctx, req.(*MsgDelegateToGateway)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUndelegateFromGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UndelegateFromGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.application.Msg/UndelegateFromGateway", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UndelegateFromGateway(ctx, req.(*MsgUndelegateFromGateway)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.application.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeApplication", - Handler: _Msg_StakeApplication_Handler, - }, - { - MethodName: "UnstakeApplication", - Handler: _Msg_UnstakeApplication_Handler, - }, - { - MethodName: "DelegateToGateway", - Handler: _Msg_DelegateToGateway_Handler, - }, - { - MethodName: "UndelegateFromGateway", - Handler: _Msg_UndelegateFromGateway_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/application/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgStakeApplication) 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 *MsgStakeApplication) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgStakeApplicationResponse) 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 *MsgStakeApplicationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeApplication) 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 *MsgUnstakeApplication) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeApplicationResponse) 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 *MsgUnstakeApplicationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgDelegateToGateway) 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 *MsgDelegateToGateway) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDelegateToGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GatewayAddress) > 0 { - i -= len(m.GatewayAddress) - copy(dAtA[i:], m.GatewayAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.GatewayAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.AppAddress) > 0 { - i -= len(m.AppAddress) - copy(dAtA[i:], m.AppAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.AppAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgDelegateToGatewayResponse) 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 *MsgDelegateToGatewayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDelegateToGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUndelegateFromGateway) 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 *MsgUndelegateFromGateway) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUndelegateFromGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GatewayAddress) > 0 { - i -= len(m.GatewayAddress) - copy(dAtA[i:], m.GatewayAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.GatewayAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.AppAddress) > 0 { - i -= len(m.AppAddress) - copy(dAtA[i:], m.AppAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.AppAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUndelegateFromGatewayResponse) 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 *MsgUndelegateFromGatewayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUndelegateFromGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgStakeApplication) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Services) > 0 { - for _, e := range m.Services { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgStakeApplicationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUnstakeApplication) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUnstakeApplicationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgDelegateToGateway) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AppAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.GatewayAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgDelegateToGatewayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUndelegateFromGateway) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AppAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.GatewayAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUndelegateFromGatewayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeApplication) 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 ErrIntOverflowTx - } - 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: MsgStakeApplication: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeApplication: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, &types1.ApplicationServiceConfig{}) - if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeApplicationResponse) 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 ErrIntOverflowTx - } - 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: MsgStakeApplicationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeApplication) 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 ErrIntOverflowTx - } - 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: MsgUnstakeApplication: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeApplication: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeApplicationResponse) 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 ErrIntOverflowTx - } - 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: MsgUnstakeApplicationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgDelegateToGateway) 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 ErrIntOverflowTx - } - 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: MsgDelegateToGateway: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegateToGateway: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GatewayAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgDelegateToGatewayResponse) 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 ErrIntOverflowTx - } - 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: MsgDelegateToGatewayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegateToGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUndelegateFromGateway) 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 ErrIntOverflowTx - } - 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: MsgUndelegateFromGateway: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateFromGateway: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GatewayAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUndelegateFromGatewayResponse) 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 ErrIntOverflowTx - } - 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: MsgUndelegateFromGatewayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateFromGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/application/types/types.pb.go b/x/application/types/types.pb.go deleted file mode 100644 index 1b90dba76..000000000 --- a/x/application/types/types.pb.go +++ /dev/null @@ -1,896 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/application/types.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" - types1 "github.com/pokt-network/poktroll/x/shared/types" - 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 - -// Application defines the type used to store an on-chain definition and state for an application -type Application struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` - // TODO_BETA(@red-0ne, @olshansk): Limit this to one service_config. - // Remove `repeated`, drop the `s` from service_configs and document why - // this is the case in the app config (and here) per this discussion: - // https://github.com/pokt-network/poktroll/pull/750#discussion_r1735025033 - ServiceConfigs []*types1.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=service_configs,json=serviceConfigs,proto3" json:"service_configs,omitempty"` - // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. - // Ensure to rename all relevant configs, comments, variables, function names, etc as well. - DelegateeGatewayAddresses []string `protobuf:"bytes,4,rep,name=delegatee_gateway_addresses,json=delegateeGatewayAddresses,proto3" json:"delegatee_gateway_addresses,omitempty"` - // A map from sessionEndHeights to a list of Gateways. - // The key is the height of the last block of the session during which the - // respective undelegation was committed. - // The value is a list of gateways being undelegated from. - // TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment - // so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906. - PendingUndelegations map[uint64]UndelegatingGatewayList `protobuf:"bytes,5,rep,name=pending_undelegations,json=pendingUndelegations,proto3" json:"pending_undelegations" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // The end height of the session at which an application initiated its unstaking process. - // If the application did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` -} - -func (m *Application) Reset() { *m = Application{} } -func (m *Application) String() string { return proto.CompactTextString(m) } -func (*Application) ProtoMessage() {} -func (*Application) Descriptor() ([]byte, []int) { - return fileDescriptor_1899440439257283, []int{0} -} -func (m *Application) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Application) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Application) XXX_Merge(src proto.Message) { - xxx_messageInfo_Application.Merge(m, src) -} -func (m *Application) XXX_Size() int { - return m.Size() -} -func (m *Application) XXX_DiscardUnknown() { - xxx_messageInfo_Application.DiscardUnknown(m) -} - -var xxx_messageInfo_Application proto.InternalMessageInfo - -func (m *Application) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *Application) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -func (m *Application) GetServiceConfigs() []*types1.ApplicationServiceConfig { - if m != nil { - return m.ServiceConfigs - } - return nil -} - -func (m *Application) GetDelegateeGatewayAddresses() []string { - if m != nil { - return m.DelegateeGatewayAddresses - } - return nil -} - -func (m *Application) GetPendingUndelegations() map[uint64]UndelegatingGatewayList { - if m != nil { - return m.PendingUndelegations - } - return nil -} - -func (m *Application) GetUnstakeSessionEndHeight() uint64 { - if m != nil { - return m.UnstakeSessionEndHeight - } - return 0 -} - -// UndelegatingGatewayList is used as the Value of `pending_undelegations`. -// It is required to store a repeated list of strings as a map value. -type UndelegatingGatewayList struct { - GatewayAddresses []string `protobuf:"bytes,2,rep,name=gateway_addresses,json=gatewayAddresses,proto3" json:"gateway_addresses,omitempty"` -} - -func (m *UndelegatingGatewayList) Reset() { *m = UndelegatingGatewayList{} } -func (m *UndelegatingGatewayList) String() string { return proto.CompactTextString(m) } -func (*UndelegatingGatewayList) ProtoMessage() {} -func (*UndelegatingGatewayList) Descriptor() ([]byte, []int) { - return fileDescriptor_1899440439257283, []int{1} -} -func (m *UndelegatingGatewayList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UndelegatingGatewayList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *UndelegatingGatewayList) XXX_Merge(src proto.Message) { - xxx_messageInfo_UndelegatingGatewayList.Merge(m, src) -} -func (m *UndelegatingGatewayList) XXX_Size() int { - return m.Size() -} -func (m *UndelegatingGatewayList) XXX_DiscardUnknown() { - xxx_messageInfo_UndelegatingGatewayList.DiscardUnknown(m) -} - -var xxx_messageInfo_UndelegatingGatewayList proto.InternalMessageInfo - -func (m *UndelegatingGatewayList) GetGatewayAddresses() []string { - if m != nil { - return m.GatewayAddresses - } - return nil -} - -func init() { - proto.RegisterType((*Application)(nil), "poktroll.application.Application") - proto.RegisterMapType((map[uint64]UndelegatingGatewayList)(nil), "poktroll.application.Application.PendingUndelegationsEntry") - proto.RegisterType((*UndelegatingGatewayList)(nil), "poktroll.application.UndelegatingGatewayList") -} - -func init() { proto.RegisterFile("poktroll/application/types.proto", fileDescriptor_1899440439257283) } - -var fileDescriptor_1899440439257283 = []byte{ - // 511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4d, 0x6f, 0xd3, 0x30, - 0x1c, 0xc6, 0x9b, 0xbe, 0x0c, 0xcd, 0x95, 0x60, 0x58, 0x45, 0x4b, 0x0b, 0x84, 0x68, 0xa7, 0x72, - 0xa8, 0xad, 0x15, 0x0e, 0x88, 0x9d, 0xda, 0x6a, 0x02, 0x24, 0x0e, 0x28, 0x15, 0x17, 0x84, 0x14, - 0xb9, 0x89, 0x71, 0xad, 0x76, 0x76, 0x14, 0xbb, 0x19, 0xfd, 0x16, 0x7c, 0x18, 0x3e, 0xc4, 0x8e, - 0x83, 0xd3, 0x4e, 0x08, 0xb5, 0x5f, 0x04, 0x25, 0x76, 0xbb, 0x88, 0xb5, 0xd2, 0x2e, 0x51, 0xac, - 0xe7, 0xf7, 0xd8, 0x8f, 0xfd, 0xe8, 0x0f, 0xfc, 0x44, 0xce, 0x74, 0x2a, 0xe7, 0x73, 0x4c, 0x92, - 0x64, 0xce, 0x23, 0xa2, 0xb9, 0x14, 0x58, 0x2f, 0x13, 0xaa, 0x50, 0x92, 0x4a, 0x2d, 0x61, 0x6b, - 0x43, 0xa0, 0x12, 0xd1, 0x69, 0x31, 0xc9, 0x64, 0x01, 0xe0, 0xfc, 0xcf, 0xb0, 0x1d, 0x2f, 0x92, - 0xea, 0x42, 0x2a, 0x3c, 0x21, 0x8a, 0xe2, 0xec, 0x74, 0x42, 0x35, 0x39, 0xc5, 0x91, 0xe4, 0xc2, - 0xea, 0x6d, 0xa3, 0x87, 0xc6, 0x68, 0x16, 0x56, 0x7a, 0xbe, 0x0d, 0xa2, 0xa6, 0x24, 0xa5, 0x31, - 0x56, 0x34, 0xcd, 0x78, 0x44, 0x8d, 0x7c, 0xf2, 0xab, 0x0e, 0x9a, 0x83, 0xdb, 0xf3, 0x61, 0x1f, - 0x3c, 0x20, 0x71, 0x9c, 0x52, 0xa5, 0x5c, 0xc7, 0x77, 0xba, 0x87, 0x43, 0xf7, 0xf7, 0xcf, 0x5e, - 0xcb, 0xee, 0x38, 0x30, 0xca, 0x58, 0xa7, 0x5c, 0xb0, 0x60, 0x03, 0x42, 0x0c, 0x1a, 0x4a, 0x93, - 0x19, 0x75, 0xab, 0xbe, 0xd3, 0x6d, 0xf6, 0xdb, 0xc8, 0xe2, 0x79, 0x5a, 0x64, 0xd3, 0xa2, 0x91, - 0xe4, 0x22, 0x30, 0x1c, 0x0c, 0xc0, 0x23, 0x9b, 0x22, 0x8c, 0xa4, 0xf8, 0xc6, 0x99, 0x72, 0x6b, - 0x7e, 0xad, 0xdb, 0xec, 0xbf, 0x44, 0xdb, 0x47, 0x31, 0x69, 0x51, 0x29, 0xdb, 0xd8, 0x58, 0x46, - 0x85, 0x23, 0x78, 0xa8, 0xca, 0x4b, 0x05, 0xbf, 0x82, 0xa7, 0x31, 0x9d, 0x53, 0x46, 0x34, 0xa5, - 0x61, 0xfe, 0xbd, 0x24, 0xcb, 0xd0, 0x26, 0xa4, 0xca, 0xad, 0xfb, 0xb5, 0xee, 0xe1, 0xf0, 0xd9, - 0xd5, 0x9f, 0x17, 0x95, 0xbd, 0x17, 0x6a, 0x6f, 0x37, 0x78, 0x67, 0xfc, 0x83, 0x8d, 0x1d, 0x66, - 0xe0, 0x49, 0x42, 0x45, 0xcc, 0x05, 0x0b, 0x17, 0xc2, 0x62, 0x5c, 0x0a, 0xe5, 0x36, 0x8a, 0xdc, - 0x67, 0x68, 0x57, 0x99, 0xe5, 0xf0, 0xe8, 0x93, 0xb1, 0x7f, 0x2e, 0xbb, 0xcf, 0x85, 0x4e, 0x97, - 0xc3, 0x7a, 0x1e, 0x2a, 0x68, 0x25, 0x3b, 0x00, 0x78, 0x06, 0x3a, 0x0b, 0x51, 0x3c, 0x5a, 0xa8, - 0xa8, 0x52, 0x5c, 0x8a, 0x90, 0x8a, 0x38, 0x9c, 0x52, 0xce, 0xa6, 0xda, 0x3d, 0xf0, 0x9d, 0x6e, - 0x3d, 0x38, 0xb6, 0xc4, 0xd8, 0x00, 0xe7, 0x22, 0x7e, 0x5f, 0xc8, 0x9d, 0x0c, 0xb4, 0xf7, 0x9e, - 0x0a, 0x8f, 0x40, 0x6d, 0x46, 0x97, 0x45, 0xc9, 0xf5, 0x20, 0xff, 0x85, 0x23, 0xd0, 0xc8, 0xc8, - 0x7c, 0xb1, 0xa9, 0xb1, 0xb7, 0xfb, 0x4e, 0xb7, 0x5b, 0x09, 0x66, 0x9f, 0xe9, 0x23, 0x57, 0x3a, - 0x30, 0xde, 0xb7, 0xd5, 0x37, 0xce, 0x49, 0x0c, 0x8e, 0xf7, 0x50, 0xf0, 0x03, 0x78, 0x7c, 0xb7, - 0x9b, 0xea, 0x3d, 0xba, 0x39, 0x62, 0xff, 0x55, 0x32, 0x0c, 0xae, 0x56, 0x9e, 0x73, 0xbd, 0xf2, - 0x9c, 0x9b, 0x95, 0xe7, 0xfc, 0x5d, 0x79, 0xce, 0x8f, 0xb5, 0x57, 0xb9, 0x5e, 0x7b, 0x95, 0x9b, - 0xb5, 0x57, 0xf9, 0xf2, 0x9a, 0x71, 0x3d, 0x5d, 0x4c, 0x50, 0x24, 0x2f, 0x70, 0x7e, 0x8f, 0x9e, - 0xa0, 0xfa, 0x52, 0xa6, 0x33, 0xbc, 0x1d, 0x87, 0xef, 0x77, 0x27, 0x73, 0x72, 0x50, 0x0c, 0xc5, - 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, 0x59, 0x36, 0xdf, 0xbe, 0x03, 0x00, 0x00, -} - -func (m *Application) 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 *Application) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Application) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UnstakeSessionEndHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.UnstakeSessionEndHeight)) - i-- - dAtA[i] = 0x30 - } - if len(m.PendingUndelegations) > 0 { - keysForPendingUndelegations := make([]uint64, 0, len(m.PendingUndelegations)) - for k := range m.PendingUndelegations { - keysForPendingUndelegations = append(keysForPendingUndelegations, uint64(k)) - } - github_com_cosmos_gogoproto_sortkeys.Uint64s(keysForPendingUndelegations) - for iNdEx := len(keysForPendingUndelegations) - 1; iNdEx >= 0; iNdEx-- { - v := m.PendingUndelegations[uint64(keysForPendingUndelegations[iNdEx])] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i = encodeVarintTypes(dAtA, i, uint64(keysForPendingUndelegations[iNdEx])) - i-- - dAtA[i] = 0x8 - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.DelegateeGatewayAddresses) > 0 { - for iNdEx := len(m.DelegateeGatewayAddresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DelegateeGatewayAddresses[iNdEx]) - copy(dAtA[i:], m.DelegateeGatewayAddresses[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.DelegateeGatewayAddresses[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.ServiceConfigs) > 0 { - for iNdEx := len(m.ServiceConfigs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ServiceConfigs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UndelegatingGatewayList) 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 *UndelegatingGatewayList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UndelegatingGatewayList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GatewayAddresses) > 0 { - for iNdEx := len(m.GatewayAddresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.GatewayAddresses[iNdEx]) - copy(dAtA[i:], m.GatewayAddresses[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.GatewayAddresses[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Application) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.ServiceConfigs) > 0 { - for _, e := range m.ServiceConfigs { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.DelegateeGatewayAddresses) > 0 { - for _, s := range m.DelegateeGatewayAddresses { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.PendingUndelegations) > 0 { - for k, v := range m.PendingUndelegations { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l)) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if m.UnstakeSessionEndHeight != 0 { - n += 1 + sovTypes(uint64(m.UnstakeSessionEndHeight)) - } - return n -} - -func (m *UndelegatingGatewayList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.GatewayAddresses) > 0 { - for _, s := range m.GatewayAddresses { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Application) 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 ErrIntOverflowTypes - } - 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: Application: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Application: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceConfigs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceConfigs = append(m.ServiceConfigs, &types1.ApplicationServiceConfig{}) - if err := m.ServiceConfigs[len(m.ServiceConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateeGatewayAddresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegateeGatewayAddresses = append(m.DelegateeGatewayAddresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingUndelegations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PendingUndelegations == nil { - m.PendingUndelegations = make(map[uint64]UndelegatingGatewayList) - } - var mapkey uint64 - mapvalue := &UndelegatingGatewayList{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthTypes - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthTypes - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &UndelegatingGatewayList{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.PendingUndelegations[mapkey] = *mapvalue - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) - } - m.UnstakeSessionEndHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnstakeSessionEndHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UndelegatingGatewayList) 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 ErrIntOverflowTypes - } - 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: UndelegatingGatewayList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UndelegatingGatewayList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GatewayAddresses = append(m.GatewayAddresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/event.pb.go b/x/gateway/types/event.pb.go deleted file mode 100644 index 552e0306a..000000000 --- a/x/gateway/types/event.pb.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/event.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GatewayStaked defines the event emitted when a gateway has been unstaked. -type EventGatewayUnstaked struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventGatewayUnstaked) Reset() { *m = EventGatewayUnstaked{} } -func (m *EventGatewayUnstaked) String() string { return proto.CompactTextString(m) } -func (*EventGatewayUnstaked) ProtoMessage() {} -func (*EventGatewayUnstaked) Descriptor() ([]byte, []int) { - return fileDescriptor_34212b93ec812e7c, []int{0} -} -func (m *EventGatewayUnstaked) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventGatewayUnstaked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventGatewayUnstaked) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventGatewayUnstaked.Merge(m, src) -} -func (m *EventGatewayUnstaked) XXX_Size() int { - return m.Size() -} -func (m *EventGatewayUnstaked) XXX_DiscardUnknown() { - xxx_messageInfo_EventGatewayUnstaked.DiscardUnknown(m) -} - -var xxx_messageInfo_EventGatewayUnstaked proto.InternalMessageInfo - -func (m *EventGatewayUnstaked) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func init() { - proto.RegisterType((*EventGatewayUnstaked)(nil), "poktroll.gateway.EventGatewayUnstaked") -} - -func init() { proto.RegisterFile("poktroll/gateway/event.proto", fileDescriptor_34212b93ec812e7c) } - -var fileDescriptor_34212b93ec812e7c = []byte{ - // 215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x4f, 0x2d, 0x4b, - 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xea, 0x41, 0x65, 0xa5, - 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0xf2, 0xfa, 0x10, 0x0e, 0x44, 0xb1, 0x94, - 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x44, 0x1c, 0xc4, 0x82, 0x88, 0x2a, 0x79, 0x71, 0x89, 0xb8, 0x82, - 0x4c, 0x74, 0x87, 0x18, 0x10, 0x9a, 0x57, 0x5c, 0x92, 0x98, 0x9d, 0x9a, 0x22, 0x64, 0xc4, 0xc5, - 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, - 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x40, 0x47, 0x88, 0x4c, 0x70, 0x49, 0x51, 0x66, 0x5e, 0x7a, 0x10, - 0x4c, 0xa1, 0x93, 0xdf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, 0x24, 0xc7, - 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, - 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x72, - 0xb7, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xdc, 0x8b, 0x15, 0x70, 0x4f, 0x96, - 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x8f, - 0xf3, 0xab, 0x98, 0x05, 0x01, 0x00, 0x00, -} - -func (m *EventGatewayUnstaked) 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 *EventGatewayUnstaked) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventGatewayUnstaked) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventGatewayUnstaked) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventGatewayUnstaked) 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 ErrIntOverflowEvent - } - 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: EventGatewayUnstaked: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventGatewayUnstaked: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/genesis.pb.go b/x/gateway/types/genesis.pb.go deleted file mode 100644 index 73c4e72c9..000000000 --- a/x/gateway/types/genesis.pb.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the gateway module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - GatewayList []Gateway `protobuf:"bytes,2,rep,name=gateway_list,json=gatewayList,proto3" json:"gateway_list"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_df7fba938e36955d, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetGatewayList() []Gateway { - if m != nil { - return m.GatewayList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.gateway.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/gateway/genesis.proto", fileDescriptor_df7fba938e36955d) } - -var fileDescriptor_df7fba938e36955d = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x4f, 0x4f, 0xcd, - 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, - 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, - 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, - 0xcc, 0x85, 0x9a, 0x2c, 0x25, 0x83, 0x21, 0x5d, 0x52, 0x59, 0x90, 0x0a, 0x95, 0x55, 0xea, 0x67, - 0xe4, 0xe2, 0x71, 0x87, 0xb8, 0x24, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x9a, 0x8b, 0x0d, 0xa2, - 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x42, 0x0f, 0xdd, 0x65, 0x7a, 0x01, 0x60, 0x79, - 0x27, 0xce, 0x13, 0xf7, 0xe4, 0x19, 0x56, 0x3c, 0xdf, 0xa0, 0xc5, 0x18, 0x04, 0xd5, 0x22, 0xe4, - 0xc4, 0xc5, 0x03, 0x55, 0x14, 0x9f, 0x93, 0x59, 0x5c, 0x22, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x6d, - 0x24, 0x89, 0x69, 0x84, 0x3b, 0x84, 0x76, 0x62, 0x01, 0x99, 0x11, 0xc4, 0x0d, 0x15, 0xf6, 0xc9, - 0x2c, 0x2e, 0x71, 0xf2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, - 0xa6, 0xea, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x7d, 0x59, 0x81, 0xea, 0xcf, - 0x24, 0x36, 0xb0, 0x47, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x2b, 0x21, 0x5c, 0x82, - 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GatewayList) > 0 { - for iNdEx := len(m.GatewayList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GatewayList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.GatewayList) > 0 { - for _, e := range m.GatewayList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GatewayList", 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.GatewayList = append(m.GatewayList, Gateway{}) - if err := m.GatewayList[len(m.GatewayList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/params.pb.go b/x/gateway/types/params.pb.go deleted file mode 100644 index ceb9f5ead..000000000 --- a/x/gateway/types/params.pb.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_23ed52a392489486, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.gateway.Params") -} - -func init() { proto.RegisterFile("poktroll/gateway/params.proto", fileDescriptor_23ed52a392489486) } - -var fileDescriptor_23ed52a392489486 = []byte{ - // 180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x2f, 0x48, 0x2c, - 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, - 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, - 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb8, 0xd8, 0x02, 0xc0, 0x46, 0x59, - 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xb2, 0x0a, 0xb8, 0x75, - 0x10, 0x35, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, - 0x0c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x2c, 0x06, 0x96, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xe9, 0x34, 0xfe, - 0xe0, 0x00, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/query.pb.go b/x/gateway/types/query.pb.go deleted file mode 100644 index 79c6ebb53..000000000 --- a/x/gateway/types/query.pb.go +++ /dev/null @@ -1,1367 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetGatewayRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryGetGatewayRequest) Reset() { *m = QueryGetGatewayRequest{} } -func (m *QueryGetGatewayRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetGatewayRequest) ProtoMessage() {} -func (*QueryGetGatewayRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{2} -} -func (m *QueryGetGatewayRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetGatewayRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetGatewayRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetGatewayRequest.Merge(m, src) -} -func (m *QueryGetGatewayRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetGatewayRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetGatewayRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetGatewayRequest proto.InternalMessageInfo - -func (m *QueryGetGatewayRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type QueryGetGatewayResponse struct { - Gateway Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway"` -} - -func (m *QueryGetGatewayResponse) Reset() { *m = QueryGetGatewayResponse{} } -func (m *QueryGetGatewayResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetGatewayResponse) ProtoMessage() {} -func (*QueryGetGatewayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{3} -} -func (m *QueryGetGatewayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetGatewayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetGatewayResponse.Merge(m, src) -} -func (m *QueryGetGatewayResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetGatewayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetGatewayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetGatewayResponse proto.InternalMessageInfo - -func (m *QueryGetGatewayResponse) GetGateway() Gateway { - if m != nil { - return m.Gateway - } - return Gateway{} -} - -type QueryAllGatewaysRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllGatewaysRequest) Reset() { *m = QueryAllGatewaysRequest{} } -func (m *QueryAllGatewaysRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllGatewaysRequest) ProtoMessage() {} -func (*QueryAllGatewaysRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{4} -} -func (m *QueryAllGatewaysRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllGatewaysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllGatewaysRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllGatewaysRequest.Merge(m, src) -} -func (m *QueryAllGatewaysRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllGatewaysRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllGatewaysRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllGatewaysRequest proto.InternalMessageInfo - -func (m *QueryAllGatewaysRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllGatewaysResponse struct { - Gateways []Gateway `protobuf:"bytes,1,rep,name=gateways,proto3" json:"gateways"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllGatewaysResponse) Reset() { *m = QueryAllGatewaysResponse{} } -func (m *QueryAllGatewaysResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllGatewaysResponse) ProtoMessage() {} -func (*QueryAllGatewaysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60df9a8709a45d29, []int{5} -} -func (m *QueryAllGatewaysResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllGatewaysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllGatewaysResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllGatewaysResponse.Merge(m, src) -} -func (m *QueryAllGatewaysResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllGatewaysResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllGatewaysResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllGatewaysResponse proto.InternalMessageInfo - -func (m *QueryAllGatewaysResponse) GetGateways() []Gateway { - if m != nil { - return m.Gateways - } - return nil -} - -func (m *QueryAllGatewaysResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.gateway.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.gateway.QueryParamsResponse") - proto.RegisterType((*QueryGetGatewayRequest)(nil), "poktroll.gateway.QueryGetGatewayRequest") - proto.RegisterType((*QueryGetGatewayResponse)(nil), "poktroll.gateway.QueryGetGatewayResponse") - proto.RegisterType((*QueryAllGatewaysRequest)(nil), "poktroll.gateway.QueryAllGatewaysRequest") - proto.RegisterType((*QueryAllGatewaysResponse)(nil), "poktroll.gateway.QueryAllGatewaysResponse") -} - -func init() { proto.RegisterFile("poktroll/gateway/query.proto", fileDescriptor_60df9a8709a45d29) } - -var fileDescriptor_60df9a8709a45d29 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x31, 0x6f, 0x13, 0x31, - 0x14, 0xc7, 0xe3, 0x16, 0x12, 0xea, 0x2e, 0x60, 0x2a, 0x48, 0x4f, 0xe5, 0x40, 0x27, 0xda, 0x86, - 0x48, 0xb5, 0xdb, 0xb0, 0x80, 0x98, 0xc8, 0x40, 0x36, 0x54, 0x4e, 0x4c, 0x2c, 0xc8, 0x49, 0xad, - 0xe3, 0xd4, 0xcb, 0xf9, 0x7a, 0xe7, 0x50, 0x22, 0xc4, 0x82, 0xf8, 0x00, 0x48, 0x30, 0x30, 0x32, - 0x32, 0xf2, 0x11, 0x18, 0x3b, 0x56, 0x62, 0xe9, 0x84, 0x50, 0x82, 0xc4, 0xd7, 0x40, 0x67, 0x3f, - 0x97, 0xa4, 0x56, 0x94, 0x2c, 0x6d, 0xec, 0xf7, 0x7f, 0xef, 0xff, 0x7b, 0x7e, 0x4f, 0x87, 0x37, - 0x32, 0x79, 0xa8, 0x72, 0x99, 0x24, 0x2c, 0xe2, 0x4a, 0x1c, 0xf3, 0x21, 0x3b, 0x1a, 0x88, 0x7c, - 0x48, 0xb3, 0x5c, 0x2a, 0x49, 0xae, 0xda, 0x28, 0x85, 0xa8, 0x77, 0x8d, 0xf7, 0xe3, 0x54, 0x32, - 0xfd, 0xd7, 0x88, 0xbc, 0xf5, 0x9e, 0x2c, 0xfa, 0xb2, 0x78, 0xa9, 0x4f, 0xcc, 0x1c, 0x20, 0xb4, - 0x16, 0xc9, 0x48, 0x9a, 0xfb, 0xf2, 0x17, 0xdc, 0x6e, 0x44, 0x52, 0x46, 0x89, 0x60, 0x3c, 0x8b, - 0x19, 0x4f, 0x53, 0xa9, 0xb8, 0x8a, 0x65, 0x6a, 0x73, 0x9a, 0xa6, 0x02, 0xeb, 0xf2, 0x42, 0x18, - 0x18, 0xf6, 0x7a, 0xaf, 0x2b, 0x14, 0xdf, 0x63, 0x19, 0x8f, 0xe2, 0x54, 0x8b, 0x41, 0xeb, 0x4f, - 0x6a, 0xad, 0xaa, 0x27, 0x63, 0x1b, 0xbf, 0xe5, 0x74, 0x97, 0xf1, 0x9c, 0xf7, 0xad, 0x95, 0xdb, - 0xbc, 0x1a, 0x66, 0x02, 0xa2, 0xc1, 0x1a, 0x26, 0xcf, 0x4a, 0xfb, 0x7d, 0x9d, 0x12, 0x8a, 0xa3, - 0x81, 0x28, 0x54, 0x10, 0xe2, 0xeb, 0x53, 0xb7, 0x45, 0x26, 0xd3, 0x42, 0x90, 0x47, 0xb8, 0x6a, - 0x4a, 0xd7, 0xd1, 0x1d, 0xd4, 0x58, 0x6d, 0xd5, 0xe9, 0xc5, 0xa7, 0xa3, 0x26, 0xa3, 0xbd, 0x72, - 0xf2, 0xeb, 0x76, 0xe5, 0xdb, 0xdf, 0xef, 0x4d, 0x14, 0x42, 0x4a, 0xd0, 0xc2, 0x37, 0x74, 0xcd, - 0x8e, 0x50, 0x1d, 0x23, 0x06, 0x37, 0x52, 0xc7, 0x35, 0x7e, 0x70, 0x90, 0x8b, 0xc2, 0xd4, 0x5d, - 0x09, 0xed, 0x31, 0x78, 0x8e, 0x6f, 0x3a, 0x39, 0xc0, 0xf2, 0x10, 0xd7, 0xc0, 0x13, 0x60, 0xd6, - 0x5d, 0x18, 0xc8, 0x69, 0x5f, 0x2a, 0x69, 0x42, 0xab, 0x0f, 0x38, 0x54, 0x7d, 0x9c, 0x24, 0xa0, - 0xb0, 0x8d, 0x93, 0x27, 0x18, 0xff, 0x7f, 0x7f, 0x28, 0xbc, 0x45, 0x61, 0xdc, 0xe5, 0x00, 0xa8, - 0xd9, 0x1c, 0x18, 0x03, 0xdd, 0xe7, 0x91, 0x80, 0xdc, 0x70, 0x22, 0x33, 0xf8, 0x8a, 0x70, 0xdd, - 0xf5, 0x38, 0x7f, 0xc6, 0x2b, 0x80, 0x52, 0x36, 0xbc, 0xbc, 0x08, 0xfb, 0x79, 0x02, 0xe9, 0x4c, - 0x11, 0x2e, 0x69, 0xc2, 0xed, 0xb9, 0x84, 0xc6, 0x79, 0x12, 0xb1, 0xf5, 0x63, 0x19, 0x5f, 0xd6, - 0x88, 0xe4, 0x03, 0xc2, 0x55, 0x33, 0x37, 0x72, 0xd7, 0x05, 0x71, 0xd7, 0xc3, 0xdb, 0x9c, 0xa3, - 0x32, 0x6e, 0xc1, 0xce, 0xfb, 0x9f, 0x7f, 0x3e, 0x2d, 0x6d, 0x93, 0x4d, 0x56, 0xca, 0x77, 0x52, - 0xa1, 0x8e, 0x65, 0x7e, 0xc8, 0x66, 0xac, 0x2b, 0xf9, 0x82, 0x70, 0x0d, 0xba, 0x26, 0x8d, 0x19, - 0x0e, 0xce, 0xf2, 0x78, 0xf7, 0x16, 0x50, 0x02, 0xcf, 0x03, 0xcd, 0xd3, 0x22, 0xbb, 0x73, 0x78, - 0xec, 0xff, 0xb7, 0xb0, 0x86, 0xef, 0xc8, 0x67, 0x84, 0x57, 0x27, 0x26, 0x49, 0x66, 0x99, 0xba, - 0x1b, 0xe5, 0x35, 0x17, 0x91, 0x02, 0x20, 0xd5, 0x80, 0x0d, 0xb2, 0xb5, 0x18, 0x60, 0xfb, 0xe9, - 0xc9, 0xc8, 0x47, 0xa7, 0x23, 0x1f, 0x9d, 0x8d, 0x7c, 0xf4, 0x7b, 0xe4, 0xa3, 0x8f, 0x63, 0xbf, - 0x72, 0x3a, 0xf6, 0x2b, 0x67, 0x63, 0xbf, 0xf2, 0x62, 0x37, 0x8a, 0xd5, 0xab, 0x41, 0x97, 0xf6, - 0x64, 0x7f, 0x46, 0xbd, 0x37, 0xd3, 0x9f, 0x84, 0x6e, 0x55, 0x7f, 0x13, 0xee, 0xff, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0xaa, 0x8d, 0xbf, 0xd7, 0x30, 0x05, 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 Gateway items. - Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) - AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.gateway.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) { - out := new(QueryGetGatewayResponse) - err := c.cc.Invoke(ctx, "/poktroll.gateway.Query/Gateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) { - out := new(QueryAllGatewaysResponse) - err := c.cc.Invoke(ctx, "/poktroll.gateway.Query/AllGateways", in, out, opts...) - 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 Gateway items. - Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) - AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, 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) Gateway(ctx context.Context, req *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Gateway not implemented") -} -func (*UnimplementedQueryServer) AllGateways(ctx context.Context, req *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllGateways not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.gateway.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 _Query_Gateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetGatewayRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Gateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.gateway.Query/Gateway", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Gateway(ctx, req.(*QueryGetGatewayRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllGatewaysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllGateways(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.gateway.Query/AllGateways", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllGateways(ctx, req.(*QueryAllGatewaysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.gateway.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Gateway", - Handler: _Query_Gateway_Handler, - }, - { - MethodName: "AllGateways", - Handler: _Query_AllGateways_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/gateway/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetGatewayRequest) 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 *QueryGetGatewayRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetGatewayRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 len(dAtA) - i, nil -} - -func (m *QueryGetGatewayResponse) 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 *QueryGetGatewayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Gateway.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 *QueryAllGatewaysRequest) 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 *QueryAllGatewaysRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllGatewaysRequest) 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 *QueryAllGatewaysResponse) 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 *QueryAllGatewaysResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllGatewaysResponse) 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.Gateways) > 0 { - for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Gateways[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 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 *QueryGetGatewayRequest) 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)) - } - return n -} - -func (m *QueryGetGatewayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Gateway.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllGatewaysRequest) 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 *QueryAllGatewaysResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Gateways) > 0 { - for _, e := range m.Gateways { - 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 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 *QueryGetGatewayRequest) 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: QueryGetGatewayRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetGatewayRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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 *QueryGetGatewayResponse) 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: QueryGetGatewayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gateway", 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.Gateway.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 *QueryAllGatewaysRequest) 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: QueryAllGatewaysRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllGatewaysRequest: 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllGatewaysResponse) 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: QueryAllGatewaysResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllGatewaysResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gateways", 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.Gateways = append(m.Gateways, Gateway{}) - if err := m.Gateways[len(m.Gateways)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/query.pb.gw.go b/x/gateway/types/query.pb.gw.go deleted file mode 100644 index ddabb8637..000000000 --- a/x/gateway/types/query.pb.gw.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/gateway/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Gateway_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetGatewayRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.Gateway(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Gateway_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetGatewayRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.Gateway(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllGateways_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllGateways_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllGatewaysRequest - 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_AllGateways_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllGateways(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllGateways_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllGatewaysRequest - 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_AllGateways_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllGateways(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Gateway_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_Gateway_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_Gateway_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllGateways_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_AllGateways_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_AllGateways_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Gateway_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_Gateway_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_Gateway_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllGateways_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_AllGateways_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_AllGateways_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "gateway", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Gateway_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "gateway", "address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllGateways_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "gateway"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Gateway_0 = runtime.ForwardResponseMessage - - forward_Query_AllGateways_0 = runtime.ForwardResponseMessage -) diff --git a/x/gateway/types/tx.pb.go b/x/gateway/types/tx.pb.go deleted file mode 100644 index 1ed9ad63d..000000000 --- a/x/gateway/types/tx.pb.go +++ /dev/null @@ -1,1293 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/gateway parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -type MsgStakeGateway struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` -} - -func (m *MsgStakeGateway) Reset() { *m = MsgStakeGateway{} } -func (m *MsgStakeGateway) String() string { return proto.CompactTextString(m) } -func (*MsgStakeGateway) ProtoMessage() {} -func (*MsgStakeGateway) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{2} -} -func (m *MsgStakeGateway) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeGateway) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeGateway.Merge(m, src) -} -func (m *MsgStakeGateway) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeGateway) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeGateway.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeGateway proto.InternalMessageInfo - -func (m *MsgStakeGateway) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *MsgStakeGateway) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -type MsgStakeGatewayResponse struct { -} - -func (m *MsgStakeGatewayResponse) Reset() { *m = MsgStakeGatewayResponse{} } -func (m *MsgStakeGatewayResponse) String() string { return proto.CompactTextString(m) } -func (*MsgStakeGatewayResponse) ProtoMessage() {} -func (*MsgStakeGatewayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{3} -} -func (m *MsgStakeGatewayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeGatewayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeGatewayResponse.Merge(m, src) -} -func (m *MsgStakeGatewayResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeGatewayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeGatewayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeGatewayResponse proto.InternalMessageInfo - -type MsgUnstakeGateway struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *MsgUnstakeGateway) Reset() { *m = MsgUnstakeGateway{} } -func (m *MsgUnstakeGateway) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeGateway) ProtoMessage() {} -func (*MsgUnstakeGateway) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{4} -} -func (m *MsgUnstakeGateway) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeGateway) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeGateway.Merge(m, src) -} -func (m *MsgUnstakeGateway) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeGateway) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeGateway.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeGateway proto.InternalMessageInfo - -func (m *MsgUnstakeGateway) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type MsgUnstakeGatewayResponse struct { -} - -func (m *MsgUnstakeGatewayResponse) Reset() { *m = MsgUnstakeGatewayResponse{} } -func (m *MsgUnstakeGatewayResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeGatewayResponse) ProtoMessage() {} -func (*MsgUnstakeGatewayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7ad4b0c5e3b59f23, []int{5} -} -func (m *MsgUnstakeGatewayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeGatewayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeGatewayResponse.Merge(m, src) -} -func (m *MsgUnstakeGatewayResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeGatewayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeGatewayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeGatewayResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.gateway.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.gateway.MsgUpdateParamsResponse") - proto.RegisterType((*MsgStakeGateway)(nil), "poktroll.gateway.MsgStakeGateway") - proto.RegisterType((*MsgStakeGatewayResponse)(nil), "poktroll.gateway.MsgStakeGatewayResponse") - proto.RegisterType((*MsgUnstakeGateway)(nil), "poktroll.gateway.MsgUnstakeGateway") - proto.RegisterType((*MsgUnstakeGatewayResponse)(nil), "poktroll.gateway.MsgUnstakeGatewayResponse") -} - -func init() { proto.RegisterFile("poktroll/gateway/tx.proto", fileDescriptor_7ad4b0c5e3b59f23) } - -var fileDescriptor_7ad4b0c5e3b59f23 = []byte{ - // 489 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x18, 0xcd, 0x15, 0xb5, 0x28, 0x47, 0x05, 0xd4, 0xaa, 0xd4, 0xd8, 0x88, 0xa3, 0x84, 0xa5, 0x04, - 0xf5, 0x8e, 0x04, 0xc1, 0x50, 0x26, 0xc2, 0xc0, 0x54, 0x84, 0x5c, 0x75, 0x41, 0x48, 0xe8, 0x9c, - 0x9c, 0xae, 0x56, 0x6a, 0x9f, 0xe5, 0xbb, 0xfe, 0xc8, 0x86, 0x10, 0x13, 0x13, 0x7f, 0x06, 0x03, - 0x43, 0x06, 0x56, 0xf6, 0x8e, 0x15, 0x53, 0x27, 0x84, 0x9c, 0x21, 0xff, 0x06, 0x3a, 0xdf, 0x39, - 0x6d, 0x1c, 0xa3, 0x20, 0xb1, 0xd8, 0xbe, 0x7b, 0xef, 0x7b, 0xdf, 0xfb, 0xde, 0x9d, 0xa1, 0x9b, - 0x88, 0x81, 0x4a, 0xc5, 0xe1, 0x21, 0xe1, 0x54, 0xb1, 0x13, 0x3a, 0x24, 0xea, 0x14, 0x27, 0xa9, - 0x50, 0xc2, 0xb9, 0x5d, 0x40, 0xd8, 0x42, 0xde, 0x1a, 0x8d, 0xc2, 0x58, 0x90, 0xfc, 0x69, 0x48, - 0xde, 0x46, 0x4f, 0xc8, 0x48, 0x48, 0x12, 0x49, 0x4e, 0x8e, 0xdb, 0xfa, 0x65, 0x01, 0xd7, 0x00, - 0xef, 0xf3, 0x15, 0x31, 0x0b, 0x0b, 0xad, 0x73, 0xc1, 0x85, 0xd9, 0xd7, 0x5f, 0x76, 0x17, 0x59, - 0xa5, 0x80, 0x4a, 0x46, 0x8e, 0xdb, 0x01, 0x53, 0xb4, 0x4d, 0x7a, 0x22, 0x8c, 0x2d, 0x7e, 0x77, - 0xce, 0x69, 0x42, 0x53, 0x1a, 0x59, 0xd1, 0xe6, 0x0f, 0x00, 0x6f, 0xed, 0x4a, 0xbe, 0x9f, 0xf4, - 0xa9, 0x62, 0x6f, 0x72, 0xc4, 0x79, 0x06, 0xeb, 0xf4, 0x48, 0x1d, 0x88, 0x34, 0x54, 0xc3, 0x06, - 0xd8, 0x04, 0x5b, 0xf5, 0x6e, 0xe3, 0xe7, 0xf7, 0xed, 0x75, 0xeb, 0xe6, 0x45, 0xbf, 0x9f, 0x32, - 0x29, 0xf7, 0x54, 0x1a, 0xc6, 0xdc, 0xbf, 0xa4, 0x3a, 0xcf, 0xe1, 0x8a, 0xd1, 0x6e, 0x2c, 0x6d, - 0x82, 0xad, 0x1b, 0x9d, 0x06, 0x2e, 0x47, 0x81, 0x4d, 0x87, 0x6e, 0xfd, 0xec, 0xd7, 0xbd, 0xda, - 0xd7, 0xc9, 0xa8, 0x05, 0x7c, 0x5b, 0xb2, 0xf3, 0xf4, 0xe3, 0x64, 0xd4, 0xba, 0x14, 0xfb, 0x3c, - 0x19, 0xb5, 0x9a, 0x53, 0xeb, 0xa7, 0x53, 0xf3, 0x25, 0xaf, 0x4d, 0x17, 0x6e, 0x94, 0xb6, 0x7c, - 0x26, 0x13, 0x11, 0x4b, 0xd6, 0xfc, 0x64, 0x46, 0xdb, 0x53, 0x74, 0xc0, 0x5e, 0x99, 0x72, 0xa7, - 0x03, 0xaf, 0x53, 0x63, 0x7f, 0xe1, 0x60, 0x05, 0xd1, 0x21, 0x70, 0x59, 0x6a, 0x0d, 0x3b, 0x95, - 0x8b, 0x2d, 0x5d, 0x27, 0x8e, 0x6d, 0xe2, 0xf8, 0xa5, 0x08, 0x63, 0xdf, 0xf0, 0x76, 0x56, 0xf5, - 0x28, 0x45, 0xb9, 0x75, 0x78, 0xd5, 0xc5, 0xd4, 0xe1, 0x3e, 0x5c, 0xd3, 0xe6, 0x63, 0xf9, 0x9f, - 0x16, 0x4b, 0x1d, 0xef, 0x40, 0x77, 0x4e, 0xb6, 0xe8, 0xd9, 0xf9, 0xb6, 0x04, 0xaf, 0xed, 0x4a, - 0xee, 0xbc, 0x83, 0xab, 0x33, 0x87, 0x7e, 0x7f, 0xfe, 0xb0, 0x4a, 0xc1, 0x7a, 0x0f, 0x17, 0x52, - 0x8a, 0x2e, 0x5a, 0x7d, 0x26, 0xf7, 0x6a, 0xf5, 0xab, 0x94, 0xbf, 0xa8, 0x57, 0xe5, 0xe6, 0x04, - 0xf0, 0x66, 0x29, 0xb4, 0x07, 0xd5, 0xd6, 0x66, 0x48, 0xde, 0xa3, 0x7f, 0x20, 0x15, 0x3d, 0xbc, - 0xe5, 0x0f, 0xfa, 0x7a, 0x76, 0x5f, 0x9f, 0x65, 0x08, 0x9c, 0x67, 0x08, 0x5c, 0x64, 0x08, 0xfc, - 0xce, 0x10, 0xf8, 0x32, 0x46, 0xb5, 0xf3, 0x31, 0xaa, 0x5d, 0x8c, 0x51, 0xed, 0xed, 0x63, 0x1e, - 0xaa, 0x83, 0xa3, 0x00, 0xf7, 0x44, 0x44, 0xb4, 0xf6, 0x76, 0xcc, 0xd4, 0x89, 0x48, 0x07, 0xa4, - 0xe2, 0xe6, 0xaa, 0x61, 0xc2, 0x64, 0xb0, 0x92, 0xff, 0x76, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, - 0xff, 0xe9, 0x90, 0xe7, 0x8f, 0x41, 0x04, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) - UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) { - out := new(MsgStakeGatewayResponse) - err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/StakeGateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) { - out := new(MsgUnstakeGatewayResponse) - err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/UnstakeGateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) - UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) StakeGateway(ctx context.Context, req *MsgStakeGateway) (*MsgStakeGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeGateway not implemented") -} -func (*UnimplementedMsgServer) UnstakeGateway(ctx context.Context, req *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeGateway not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.gateway.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.gateway.Msg/StakeGateway", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeGateway(ctx, req.(*MsgStakeGateway)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeGateway) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeGateway(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.gateway.Msg/UnstakeGateway", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeGateway(ctx, req.(*MsgUnstakeGateway)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.gateway.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeGateway", - Handler: _Msg_StakeGateway_Handler, - }, - { - MethodName: "UnstakeGateway", - Handler: _Msg_UnstakeGateway_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/gateway/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgStakeGateway) 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 *MsgStakeGateway) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgStakeGatewayResponse) 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 *MsgStakeGatewayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeGateway) 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 *MsgUnstakeGateway) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeGatewayResponse) 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 *MsgUnstakeGatewayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgStakeGateway) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgStakeGatewayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUnstakeGateway) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUnstakeGatewayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeGateway) 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 ErrIntOverflowTx - } - 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: MsgStakeGateway: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeGateway: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeGatewayResponse) 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 ErrIntOverflowTx - } - 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: MsgStakeGatewayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeGateway) 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 ErrIntOverflowTx - } - 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: MsgUnstakeGateway: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeGateway: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeGatewayResponse) 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 ErrIntOverflowTx - } - 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: MsgUnstakeGatewayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gateway/types/types.pb.go b/x/gateway/types/types.pb.go deleted file mode 100644 index f91d243f3..000000000 --- a/x/gateway/types/types.pb.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/gateway/types.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -type Gateway struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` -} - -func (m *Gateway) Reset() { *m = Gateway{} } -func (m *Gateway) String() string { return proto.CompactTextString(m) } -func (*Gateway) ProtoMessage() {} -func (*Gateway) Descriptor() ([]byte, []int) { - return fileDescriptor_8e457ba71add809d, []int{0} -} -func (m *Gateway) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Gateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Gateway) XXX_Merge(src proto.Message) { - xxx_messageInfo_Gateway.Merge(m, src) -} -func (m *Gateway) XXX_Size() int { - return m.Size() -} -func (m *Gateway) XXX_DiscardUnknown() { - xxx_messageInfo_Gateway.DiscardUnknown(m) -} - -var xxx_messageInfo_Gateway proto.InternalMessageInfo - -func (m *Gateway) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *Gateway) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -func init() { - proto.RegisterType((*Gateway)(nil), "poktroll.gateway.Gateway") -} - -func init() { proto.RegisterFile("poktroll/gateway/types.proto", fileDescriptor_8e457ba71add809d) } - -var fileDescriptor_8e457ba71add809d = []byte{ - // 256 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x2f, 0xa9, 0x2c, - 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xea, 0x41, 0x65, 0xa5, - 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0xf2, 0xfa, 0x10, 0x0e, 0x44, 0xb1, 0x94, - 0x1c, 0x84, 0xa7, 0x9f, 0x94, 0x58, 0x9c, 0xaa, 0x5f, 0x66, 0x98, 0x94, 0x5a, 0x92, 0x68, 0xa8, - 0x9f, 0x9c, 0x9f, 0x99, 0x07, 0x95, 0x17, 0x49, 0xcf, 0x4f, 0xcf, 0x87, 0xe8, 0x03, 0xb1, 0x20, - 0xa2, 0x4a, 0x79, 0x5c, 0xec, 0xee, 0x10, 0xb3, 0x85, 0x8c, 0xb8, 0xd8, 0x13, 0x53, 0x52, 0x8a, - 0x52, 0x8b, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, - 0xda, 0xe1, 0x08, 0x91, 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x82, 0x29, 0x14, 0xd2, 0xe7, - 0x62, 0x2d, 0x2e, 0x49, 0xcc, 0x4e, 0x95, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd4, 0x83, - 0x2a, 0x07, 0x39, 0x42, 0x0f, 0xea, 0x08, 0x3d, 0xe7, 0xfc, 0xcc, 0xbc, 0x20, 0x88, 0x3a, 0x27, - 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0xbc, 0xf1, 0x48, 0x8e, 0xf1, 0xc1, 0x23, - 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, - 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe4, 0x77, 0xdd, 0xbc, - 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x78, 0x30, 0x55, 0xa0, 0x06, 0x54, 0x12, 0x1b, 0xd8, - 0x1b, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x4f, 0xc7, 0x17, 0x49, 0x01, 0x00, 0x00, -} - -func (m *Gateway) 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 *Gateway) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Gateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Gateway) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Gateway) 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 ErrIntOverflowTypes - } - 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: Gateway: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Gateway: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/event.pb.go b/x/proof/types/event.pb.go deleted file mode 100644 index 2ef856138..000000000 --- a/x/proof/types/event.pb.go +++ /dev/null @@ -1,1259 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/event.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -type EventClaimCreated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` -} - -func (m *EventClaimCreated) Reset() { *m = EventClaimCreated{} } -func (m *EventClaimCreated) String() string { return proto.CompactTextString(m) } -func (*EventClaimCreated) ProtoMessage() {} -func (*EventClaimCreated) Descriptor() ([]byte, []int) { - return fileDescriptor_dd4c19e04487fbec, []int{0} -} -func (m *EventClaimCreated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventClaimCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventClaimCreated) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventClaimCreated.Merge(m, src) -} -func (m *EventClaimCreated) XXX_Size() int { - return m.Size() -} -func (m *EventClaimCreated) XXX_DiscardUnknown() { - xxx_messageInfo_EventClaimCreated.DiscardUnknown(m) -} - -var xxx_messageInfo_EventClaimCreated proto.InternalMessageInfo - -func (m *EventClaimCreated) GetClaim() *Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventClaimCreated) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventClaimCreated) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -// TODO_TEST: Add coverage for claim updates. -type EventClaimUpdated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` -} - -func (m *EventClaimUpdated) Reset() { *m = EventClaimUpdated{} } -func (m *EventClaimUpdated) String() string { return proto.CompactTextString(m) } -func (*EventClaimUpdated) ProtoMessage() {} -func (*EventClaimUpdated) Descriptor() ([]byte, []int) { - return fileDescriptor_dd4c19e04487fbec, []int{1} -} -func (m *EventClaimUpdated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventClaimUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventClaimUpdated) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventClaimUpdated.Merge(m, src) -} -func (m *EventClaimUpdated) XXX_Size() int { - return m.Size() -} -func (m *EventClaimUpdated) XXX_DiscardUnknown() { - xxx_messageInfo_EventClaimUpdated.DiscardUnknown(m) -} - -var xxx_messageInfo_EventClaimUpdated proto.InternalMessageInfo - -func (m *EventClaimUpdated) GetClaim() *Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventClaimUpdated) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventClaimUpdated) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -type EventProofSubmitted struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` -} - -func (m *EventProofSubmitted) Reset() { *m = EventProofSubmitted{} } -func (m *EventProofSubmitted) String() string { return proto.CompactTextString(m) } -func (*EventProofSubmitted) ProtoMessage() {} -func (*EventProofSubmitted) Descriptor() ([]byte, []int) { - return fileDescriptor_dd4c19e04487fbec, []int{2} -} -func (m *EventProofSubmitted) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventProofSubmitted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventProofSubmitted) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventProofSubmitted.Merge(m, src) -} -func (m *EventProofSubmitted) XXX_Size() int { - return m.Size() -} -func (m *EventProofSubmitted) XXX_DiscardUnknown() { - xxx_messageInfo_EventProofSubmitted.DiscardUnknown(m) -} - -var xxx_messageInfo_EventProofSubmitted proto.InternalMessageInfo - -func (m *EventProofSubmitted) GetClaim() *Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventProofSubmitted) GetProof() *Proof { - if m != nil { - return m.Proof - } - return nil -} - -func (m *EventProofSubmitted) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventProofSubmitted) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -// TODO_TEST: Add coverage for proof updates. -type EventProofUpdated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` -} - -func (m *EventProofUpdated) Reset() { *m = EventProofUpdated{} } -func (m *EventProofUpdated) String() string { return proto.CompactTextString(m) } -func (*EventProofUpdated) ProtoMessage() {} -func (*EventProofUpdated) Descriptor() ([]byte, []int) { - return fileDescriptor_dd4c19e04487fbec, []int{3} -} -func (m *EventProofUpdated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventProofUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventProofUpdated) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventProofUpdated.Merge(m, src) -} -func (m *EventProofUpdated) XXX_Size() int { - return m.Size() -} -func (m *EventProofUpdated) XXX_DiscardUnknown() { - xxx_messageInfo_EventProofUpdated.DiscardUnknown(m) -} - -var xxx_messageInfo_EventProofUpdated proto.InternalMessageInfo - -func (m *EventProofUpdated) GetClaim() *Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventProofUpdated) GetProof() *Proof { - if m != nil { - return m.Proof - } - return nil -} - -func (m *EventProofUpdated) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventProofUpdated) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -func init() { - proto.RegisterType((*EventClaimCreated)(nil), "poktroll.proof.EventClaimCreated") - proto.RegisterType((*EventClaimUpdated)(nil), "poktroll.proof.EventClaimUpdated") - proto.RegisterType((*EventProofSubmitted)(nil), "poktroll.proof.EventProofSubmitted") - proto.RegisterType((*EventProofUpdated)(nil), "poktroll.proof.EventProofUpdated") -} - -func init() { proto.RegisterFile("poktroll/proof/event.proto", fileDescriptor_dd4c19e04487fbec) } - -var fileDescriptor_dd4c19e04487fbec = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, - 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xe9, 0x81, 0xe5, 0xa4, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x14, 0xba, 0x09, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0x10, 0x39, 0xa5, 0xbd, 0x8c, 0x5c, 0x82, 0xae, 0x20, 0x13, 0x9d, 0x73, 0x12, 0x33, - 0x73, 0x9d, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x53, 0x84, 0xcc, 0xb8, 0x58, 0x93, 0x41, 0x7c, 0x09, - 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x54, 0x7b, 0xf4, 0xc0, 0x8a, 0x9d, 0x38, 0x5f, - 0xdd, 0x93, 0x87, 0xa8, 0x0b, 0x82, 0x50, 0x42, 0xba, 0x5c, 0x5c, 0x79, 0xa5, 0xb9, 0xf1, 0x45, - 0xa9, 0x39, 0x89, 0x95, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0x7c, 0xaf, 0xee, 0xc9, - 0x23, 0x89, 0x06, 0x71, 0xe6, 0x95, 0xe6, 0x06, 0x81, 0x99, 0x42, 0x8e, 0x5c, 0x82, 0x20, 0x89, - 0xe4, 0xfc, 0xdc, 0x82, 0xd2, 0x92, 0xd4, 0xf8, 0xd2, 0xbc, 0xcc, 0x92, 0x62, 0x09, 0x66, 0xb0, - 0x2e, 0xd1, 0x57, 0xf7, 0xe4, 0x31, 0x25, 0x83, 0xf8, 0xf3, 0x4a, 0x73, 0x9d, 0x21, 0x22, 0xa1, - 0x20, 0x01, 0x34, 0xf7, 0x87, 0x16, 0xa4, 0x0c, 0x31, 0xf7, 0x7f, 0x67, 0xe4, 0x12, 0x06, 0xbb, - 0x3f, 0x00, 0xe4, 0xb0, 0xe0, 0xd2, 0xa4, 0xdc, 0xcc, 0x12, 0x4a, 0x7c, 0x60, 0xc6, 0xc5, 0x0a, - 0x56, 0x00, 0x76, 0x3c, 0x16, 0x7d, 0x60, 0x6b, 0x20, 0xfa, 0xc0, 0x02, 0x41, 0x10, 0x0a, 0xcd, - 0xe7, 0xcc, 0x64, 0xf9, 0x9c, 0x85, 0x24, 0x9f, 0x7f, 0x85, 0xc5, 0x1c, 0xd8, 0x49, 0x94, 0xc6, - 0xdc, 0x90, 0xf1, 0xb7, 0x93, 0xcf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, - 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, - 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0x0f, 0xf2, 0x82, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0x3c, 0x0f, 0x57, 0x20, - 0xe7, 0xe2, 0x24, 0x36, 0x70, 0x36, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x84, 0x01, - 0x75, 0x26, 0x04, 0x00, 0x00, -} - -func (m *EventClaimCreated) 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 *EventClaimCreated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventClaimCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x18 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x10 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventClaimUpdated) 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 *EventClaimUpdated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventClaimUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x18 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x10 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventProofSubmitted) 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 *EventProofSubmitted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventProofSubmitted) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x20 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x18 - } - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventProofUpdated) 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 *EventProofUpdated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventProofUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x20 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x18 - } - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventClaimCreated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - return n -} - -func (m *EventClaimUpdated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - return n -} - -func (m *EventProofSubmitted) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - return n -} - -func (m *EventProofUpdated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventClaimCreated) 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 ErrIntOverflowEvent - } - 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: EventClaimCreated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventClaimCreated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventClaimUpdated) 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 ErrIntOverflowEvent - } - 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: EventClaimUpdated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventClaimUpdated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventProofSubmitted) 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 ErrIntOverflowEvent - } - 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: EventProofSubmitted: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventProofSubmitted: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventProofUpdated) 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 ErrIntOverflowEvent - } - 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: EventProofUpdated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventProofUpdated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/genesis.pb.go b/x/proof/types/genesis.pb.go deleted file mode 100644 index 0b7160a14..000000000 --- a/x/proof/types/genesis.pb.go +++ /dev/null @@ -1,448 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the proof module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ClaimList []Claim `protobuf:"bytes,2,rep,name=claim_list,json=claimList,proto3" json:"claim_list"` - ProofList []Proof `protobuf:"bytes,3,rep,name=proof_list,json=proofList,proto3" json:"proof_list"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_2da3e253d01f195c, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetClaimList() []Claim { - if m != nil { - return m.ClaimList - } - return nil -} - -func (m *GenesisState) GetProofList() []Proof { - if m != nil { - return m.ProofList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.proof.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/proof/genesis.proto", fileDescriptor_2da3e253d01f195c) } - -var fileDescriptor_2da3e253d01f195c = []byte{ - // 278 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, - 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xea, 0x81, 0x65, 0xa5, - 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x48, 0x7a, 0x7e, 0x7a, - 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xa5, 0xd1, 0x8c, 0x2d, 0x48, 0x2c, 0x4a, 0xcc, 0x85, - 0x9a, 0x2a, 0x25, 0x85, 0x26, 0x59, 0x52, 0x59, 0x90, 0x0a, 0x95, 0x53, 0x3a, 0xc8, 0xc8, 0xc5, - 0xe3, 0x0e, 0x71, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x25, 0x17, 0x1b, 0x44, 0xb3, 0x04, - 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x98, 0x1e, 0xaa, 0x9b, 0xf4, 0x02, 0xc0, 0xb2, 0x4e, 0x9c, - 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0x41, 0xc8, 0x8a, 0x8b, - 0x2b, 0x39, 0x27, 0x31, 0x33, 0x37, 0x3e, 0x27, 0xb3, 0xb8, 0x44, 0x82, 0x49, 0x81, 0x59, 0x83, - 0xdb, 0x48, 0x14, 0x5d, 0xbb, 0x33, 0x48, 0x85, 0x13, 0x0b, 0x48, 0x77, 0x10, 0x27, 0x58, 0xb9, - 0x4f, 0x66, 0x71, 0x09, 0x48, 0x2f, 0x58, 0x1e, 0xa2, 0x97, 0x19, 0xbb, 0xde, 0x00, 0x10, 0x09, - 0xd3, 0x0b, 0x16, 0x02, 0xe9, 0x75, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, - 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, - 0x73, 0xf5, 0x41, 0xe6, 0xe9, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x43, 0xa5, - 0x02, 0x39, 0x5c, 0x92, 0xd8, 0xc0, 0x01, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x99, - 0x4c, 0x7b, 0xaa, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProofList) > 0 { - for iNdEx := len(m.ProofList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProofList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ClaimList) > 0 { - for iNdEx := len(m.ClaimList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ClaimList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.ClaimList) > 0 { - for _, e := range m.ClaimList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ProofList) > 0 { - for _, e := range m.ProofList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimList", 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.ClaimList = append(m.ClaimList, Claim{}) - if err := m.ClaimList[len(m.ClaimList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofList", 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.ProofList = append(m.ProofList, Proof{}) - if err := m.ProofList[len(m.ProofList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/params.pb.go b/x/proof/types/params.pb.go deleted file mode 100644 index 6302cfa71..000000000 --- a/x/proof/types/params.pb.go +++ /dev/null @@ -1,599 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/params.proto - -package types - -import ( - bytes "bytes" - encoding_binary "encoding/binary" - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { - // TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" - // relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. - RelayDifficultyTargetHash []byte `protobuf:"bytes,1,opt,name=relay_difficulty_target_hash,json=relayDifficultyTargetHash,proto3" json:"relay_difficulty_target_hash"` - // proof_request_probability is the probability of a session requiring a proof - // if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. - ProofRequestProbability float32 `protobuf:"fixed32,2,opt,name=proof_request_probability,json=proofRequestProbability,proto3" json:"proof_request_probability"` - // proof_requirement_threshold is the session cost (i.e. compute unit consumption) - // threshold which asserts that a session MUST have a corresponding proof when its cost - // is equal to or above the threshold. This is in contrast to the this requirement - // being determined probabilistically via ProofRequestProbability. - // - // TODO_MAINNET: Consider renaming this to `proof_requirement_threshold_upokt`. - ProofRequirementThreshold *types.Coin `protobuf:"bytes,3,opt,name=proof_requirement_threshold,json=proofRequirementThreshold,proto3" json:"proof_requirement_threshold"` - // proof_missing_penalty is the number of tokens (uPOKT) which should be slashed from a supplier - // when a proof is required (either via proof_requirement_threshold or proof_missing_penalty) - // but is not provided. - // TODO_MAINNET: Consider renaming this to `proof_missing_penalty_upokt`. - ProofMissingPenalty *types.Coin `protobuf:"bytes,4,opt,name=proof_missing_penalty,json=proofMissingPenalty,proto3" json:"proof_missing_penalty"` - // proof_submission_fee is the number of tokens (uPOKT) which should be paid by - // the supplier operator when submitting a proof. - // This is needed to account for the cost of storing proofs on-chain and prevent - // spamming (i.e. sybil bloat attacks) the network with non-required proofs. - // TODO_MAINNET: Consider renaming this to `proof_submission_fee_upokt`. - ProofSubmissionFee *types.Coin `protobuf:"bytes,5,opt,name=proof_submission_fee,json=proofSubmissionFee,proto3" json:"proof_submission_fee"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_2ad689ad5bf3a2d7, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetRelayDifficultyTargetHash() []byte { - if m != nil { - return m.RelayDifficultyTargetHash - } - return nil -} - -func (m *Params) GetProofRequestProbability() float32 { - if m != nil { - return m.ProofRequestProbability - } - return 0 -} - -func (m *Params) GetProofRequirementThreshold() *types.Coin { - if m != nil { - return m.ProofRequirementThreshold - } - return nil -} - -func (m *Params) GetProofMissingPenalty() *types.Coin { - if m != nil { - return m.ProofMissingPenalty - } - return nil -} - -func (m *Params) GetProofSubmissionFee() *types.Coin { - if m != nil { - return m.ProofSubmissionFee - } - return nil -} - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.proof.Params") -} - -func init() { proto.RegisterFile("poktroll/proof/params.proto", fileDescriptor_2ad689ad5bf3a2d7) } - -var fileDescriptor_2ad689ad5bf3a2d7 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x6e, 0xd4, 0x40, - 0x14, 0x86, 0x77, 0x42, 0x48, 0x61, 0x10, 0x12, 0x26, 0x28, 0x76, 0x02, 0xb6, 0x45, 0xb5, 0x42, - 0xc2, 0xa3, 0x40, 0x47, 0xb9, 0x20, 0x44, 0x01, 0xd2, 0xca, 0xa4, 0x81, 0x66, 0x34, 0xde, 0xbc, - 0xb5, 0x47, 0xb1, 0xe7, 0x99, 0x99, 0x59, 0xc0, 0x1c, 0x81, 0x8a, 0x23, 0x70, 0x04, 0x1a, 0xee, - 0x40, 0x99, 0x32, 0x95, 0x85, 0x76, 0x0b, 0x90, 0x4f, 0x81, 0x76, 0x66, 0xb3, 0x29, 0x08, 0xd9, - 0xc6, 0x1a, 0xfd, 0xdf, 0xfb, 0xdf, 0x6f, 0x3d, 0xfd, 0xde, 0x41, 0x83, 0x27, 0x46, 0x61, 0x55, - 0xd1, 0x46, 0x21, 0x4e, 0x69, 0xc3, 0x15, 0xaf, 0x75, 0xda, 0x28, 0x34, 0xe8, 0xdf, 0x3a, 0x87, - 0xa9, 0x85, 0xfb, 0xb7, 0x79, 0x2d, 0x24, 0x52, 0xfb, 0x75, 0x23, 0xfb, 0xbb, 0x05, 0x16, 0x68, - 0x9f, 0x74, 0xf9, 0x5a, 0xa9, 0xd1, 0x04, 0x75, 0x8d, 0x9a, 0xe6, 0x5c, 0x03, 0xfd, 0x70, 0x98, - 0x83, 0xe1, 0x87, 0x74, 0x82, 0x42, 0x3a, 0xfe, 0xe0, 0xc7, 0xb6, 0xb7, 0x33, 0xb6, 0x49, 0x3e, - 0xf7, 0xee, 0x29, 0xa8, 0x78, 0xcb, 0x8e, 0xc5, 0x74, 0x2a, 0x26, 0xb3, 0xca, 0xb4, 0xcc, 0x70, - 0x55, 0x80, 0x61, 0x25, 0xd7, 0x65, 0x40, 0x12, 0x32, 0xbc, 0x39, 0x4a, 0xfa, 0x2e, 0xbe, 0x72, - 0x2e, 0x0b, 0x2d, 0x7d, 0xbe, 0x86, 0x47, 0x96, 0xbd, 0xe4, 0xba, 0xf4, 0xdf, 0x7a, 0xa1, 0xfd, - 0x7f, 0xa6, 0xe0, 0xfd, 0x0c, 0xb4, 0x61, 0x8d, 0xc2, 0x9c, 0xe7, 0xa2, 0x12, 0xa6, 0x0d, 0xb6, - 0x12, 0x32, 0xdc, 0x1a, 0xdd, 0xef, 0xbb, 0xf8, 0xff, 0x43, 0xd9, 0x9e, 0x45, 0x99, 0x23, 0xe3, - 0x0b, 0xe0, 0x7f, 0xf6, 0x0e, 0x2e, 0x5c, 0x42, 0x41, 0x0d, 0xd2, 0x30, 0x53, 0x2a, 0xd0, 0x25, - 0x56, 0xc7, 0xc1, 0xb5, 0x84, 0x0c, 0x6f, 0x3c, 0x0e, 0x53, 0x77, 0x8e, 0x74, 0x79, 0x8e, 0x74, - 0x75, 0x8e, 0xf4, 0x19, 0x0a, 0x39, 0x8a, 0xfb, 0x2e, 0xbe, 0x6a, 0x43, 0x16, 0xae, 0x93, 0x57, - 0xec, 0xe8, 0x1c, 0xf9, 0xa5, 0x77, 0xd7, 0x39, 0x6b, 0xa1, 0xb5, 0x90, 0x05, 0x6b, 0x40, 0xf2, - 0xca, 0xb4, 0xc1, 0xf6, 0xa6, 0xd4, 0xb0, 0xef, 0xe2, 0xcb, 0xbd, 0xd9, 0x1d, 0x2b, 0xbf, 0x76, - 0xea, 0xd8, 0x89, 0x3e, 0x78, 0xbb, 0x6e, 0x5a, 0xcf, 0x72, 0x6b, 0x40, 0xc9, 0xa6, 0x00, 0xc1, - 0xf5, 0x4d, 0x41, 0x41, 0xdf, 0xc5, 0x97, 0x5a, 0x33, 0xdf, 0xaa, 0x6f, 0xd6, 0xe2, 0x0b, 0x80, - 0xa7, 0xc9, 0x9f, 0x6f, 0x31, 0xf9, 0xf2, 0xfb, 0xfb, 0xc3, 0xbd, 0x75, 0x29, 0x3f, 0xad, 0x6a, - 0xe9, 0xca, 0x32, 0x7a, 0xf5, 0x73, 0x1e, 0x91, 0xd3, 0x79, 0x44, 0xce, 0xe6, 0x11, 0xf9, 0x35, - 0x8f, 0xc8, 0xd7, 0x45, 0x34, 0x38, 0x5d, 0x44, 0x83, 0xb3, 0x45, 0x34, 0x78, 0x97, 0x16, 0xc2, - 0x94, 0xb3, 0x3c, 0x9d, 0x60, 0x4d, 0x97, 0x1b, 0x1e, 0x49, 0x30, 0x1f, 0x51, 0x9d, 0xd0, 0x7f, - 0xd6, 0x99, 0xb6, 0x01, 0x9d, 0xef, 0xd8, 0x32, 0x3e, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x63, - 0xa4, 0x76, 0xd5, 0x04, 0x03, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.RelayDifficultyTargetHash, that1.RelayDifficultyTargetHash) { - return false - } - if this.ProofRequestProbability != that1.ProofRequestProbability { - return false - } - if !this.ProofRequirementThreshold.Equal(that1.ProofRequirementThreshold) { - return false - } - if !this.ProofMissingPenalty.Equal(that1.ProofMissingPenalty) { - return false - } - if !this.ProofSubmissionFee.Equal(that1.ProofSubmissionFee) { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProofSubmissionFee != nil { - { - size, err := m.ProofSubmissionFee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.ProofMissingPenalty != nil { - { - size, err := m.ProofMissingPenalty.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.ProofRequirementThreshold != nil { - { - size, err := m.ProofRequirementThreshold.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ProofRequestProbability != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.ProofRequestProbability)))) - i-- - dAtA[i] = 0x15 - } - if len(m.RelayDifficultyTargetHash) > 0 { - i -= len(m.RelayDifficultyTargetHash) - copy(dAtA[i:], m.RelayDifficultyTargetHash) - i = encodeVarintParams(dAtA, i, uint64(len(m.RelayDifficultyTargetHash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RelayDifficultyTargetHash) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - if m.ProofRequestProbability != 0 { - n += 5 - } - if m.ProofRequirementThreshold != nil { - l = m.ProofRequirementThreshold.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.ProofMissingPenalty != nil { - l = m.ProofMissingPenalty.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.ProofSubmissionFee != nil { - l = m.ProofSubmissionFee.Size() - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayDifficultyTargetHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RelayDifficultyTargetHash = append(m.RelayDifficultyTargetHash[:0], dAtA[iNdEx:postIndex]...) - if m.RelayDifficultyTargetHash == nil { - m.RelayDifficultyTargetHash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofRequestProbability", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.ProofRequestProbability = float32(math.Float32frombits(v)) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofRequirementThreshold", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProofRequirementThreshold == nil { - m.ProofRequirementThreshold = &types.Coin{} - } - if err := m.ProofRequirementThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofMissingPenalty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProofMissingPenalty == nil { - m.ProofMissingPenalty = &types.Coin{} - } - if err := m.ProofMissingPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofSubmissionFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProofSubmissionFee == nil { - m.ProofSubmissionFee = &types.Coin{} - } - if err := m.ProofSubmissionFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/query.pb.go b/x/proof/types/query.pb.go deleted file mode 100644 index ebe21a473..000000000 --- a/x/proof/types/query.pb.go +++ /dev/null @@ -1,2756 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetClaimRequest struct { - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` -} - -func (m *QueryGetClaimRequest) Reset() { *m = QueryGetClaimRequest{} } -func (m *QueryGetClaimRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetClaimRequest) ProtoMessage() {} -func (*QueryGetClaimRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{2} -} -func (m *QueryGetClaimRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetClaimRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetClaimRequest.Merge(m, src) -} -func (m *QueryGetClaimRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetClaimRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetClaimRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetClaimRequest proto.InternalMessageInfo - -func (m *QueryGetClaimRequest) GetSessionId() string { - if m != nil { - return m.SessionId - } - return "" -} - -func (m *QueryGetClaimRequest) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -type QueryGetClaimResponse struct { - Claim Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` -} - -func (m *QueryGetClaimResponse) Reset() { *m = QueryGetClaimResponse{} } -func (m *QueryGetClaimResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetClaimResponse) ProtoMessage() {} -func (*QueryGetClaimResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{3} -} -func (m *QueryGetClaimResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetClaimResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetClaimResponse.Merge(m, src) -} -func (m *QueryGetClaimResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetClaimResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetClaimResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetClaimResponse proto.InternalMessageInfo - -func (m *QueryGetClaimResponse) GetClaim() Claim { - if m != nil { - return m.Claim - } - return Claim{} -} - -type QueryAllClaimsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - // Types that are valid to be assigned to Filter: - // *QueryAllClaimsRequest_SupplierOperatorAddress - // *QueryAllClaimsRequest_SessionId - // *QueryAllClaimsRequest_SessionEndHeight - Filter isQueryAllClaimsRequest_Filter `protobuf_oneof:"filter"` -} - -func (m *QueryAllClaimsRequest) Reset() { *m = QueryAllClaimsRequest{} } -func (m *QueryAllClaimsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllClaimsRequest) ProtoMessage() {} -func (*QueryAllClaimsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{4} -} -func (m *QueryAllClaimsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllClaimsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllClaimsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllClaimsRequest.Merge(m, src) -} -func (m *QueryAllClaimsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllClaimsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllClaimsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllClaimsRequest proto.InternalMessageInfo - -type isQueryAllClaimsRequest_Filter interface { - isQueryAllClaimsRequest_Filter() - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryAllClaimsRequest_SupplierOperatorAddress struct { - SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` -} -type QueryAllClaimsRequest_SessionId struct { - SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` -} -type QueryAllClaimsRequest_SessionEndHeight struct { - SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` -} - -func (*QueryAllClaimsRequest_SupplierOperatorAddress) isQueryAllClaimsRequest_Filter() {} -func (*QueryAllClaimsRequest_SessionId) isQueryAllClaimsRequest_Filter() {} -func (*QueryAllClaimsRequest_SessionEndHeight) isQueryAllClaimsRequest_Filter() {} - -func (m *QueryAllClaimsRequest) GetFilter() isQueryAllClaimsRequest_Filter { - if m != nil { - return m.Filter - } - return nil -} - -func (m *QueryAllClaimsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *QueryAllClaimsRequest) GetSupplierOperatorAddress() string { - if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { - return x.SupplierOperatorAddress - } - return "" -} - -func (m *QueryAllClaimsRequest) GetSessionId() string { - if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SessionId); ok { - return x.SessionId - } - return "" -} - -func (m *QueryAllClaimsRequest) GetSessionEndHeight() uint64 { - if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SessionEndHeight); ok { - return x.SessionEndHeight - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryAllClaimsRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryAllClaimsRequest_SupplierOperatorAddress)(nil), - (*QueryAllClaimsRequest_SessionId)(nil), - (*QueryAllClaimsRequest_SessionEndHeight)(nil), - } -} - -type QueryAllClaimsResponse struct { - Claims []Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllClaimsResponse) Reset() { *m = QueryAllClaimsResponse{} } -func (m *QueryAllClaimsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllClaimsResponse) ProtoMessage() {} -func (*QueryAllClaimsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{5} -} -func (m *QueryAllClaimsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllClaimsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllClaimsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllClaimsResponse.Merge(m, src) -} -func (m *QueryAllClaimsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllClaimsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllClaimsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllClaimsResponse proto.InternalMessageInfo - -func (m *QueryAllClaimsResponse) GetClaims() []Claim { - if m != nil { - return m.Claims - } - return nil -} - -func (m *QueryAllClaimsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetProofRequest struct { - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` -} - -func (m *QueryGetProofRequest) Reset() { *m = QueryGetProofRequest{} } -func (m *QueryGetProofRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetProofRequest) ProtoMessage() {} -func (*QueryGetProofRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{6} -} -func (m *QueryGetProofRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetProofRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetProofRequest.Merge(m, src) -} -func (m *QueryGetProofRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetProofRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetProofRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetProofRequest proto.InternalMessageInfo - -func (m *QueryGetProofRequest) GetSessionId() string { - if m != nil { - return m.SessionId - } - return "" -} - -func (m *QueryGetProofRequest) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -type QueryGetProofResponse struct { - Proof Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof"` -} - -func (m *QueryGetProofResponse) Reset() { *m = QueryGetProofResponse{} } -func (m *QueryGetProofResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetProofResponse) ProtoMessage() {} -func (*QueryGetProofResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{7} -} -func (m *QueryGetProofResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetProofResponse.Merge(m, src) -} -func (m *QueryGetProofResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetProofResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetProofResponse proto.InternalMessageInfo - -func (m *QueryGetProofResponse) GetProof() Proof { - if m != nil { - return m.Proof - } - return Proof{} -} - -type QueryAllProofsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - // Types that are valid to be assigned to Filter: - // - // *QueryAllProofsRequest_SupplierOperatorAddress - // *QueryAllProofsRequest_SessionId - // *QueryAllProofsRequest_SessionEndHeight - Filter isQueryAllProofsRequest_Filter `protobuf_oneof:"filter"` -} - -func (m *QueryAllProofsRequest) Reset() { *m = QueryAllProofsRequest{} } -func (m *QueryAllProofsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllProofsRequest) ProtoMessage() {} -func (*QueryAllProofsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{8} -} -func (m *QueryAllProofsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllProofsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllProofsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllProofsRequest.Merge(m, src) -} -func (m *QueryAllProofsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllProofsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllProofsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllProofsRequest proto.InternalMessageInfo - -type isQueryAllProofsRequest_Filter interface { - isQueryAllProofsRequest_Filter() - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryAllProofsRequest_SupplierOperatorAddress struct { - SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` -} -type QueryAllProofsRequest_SessionId struct { - SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` -} -type QueryAllProofsRequest_SessionEndHeight struct { - SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` -} - -func (*QueryAllProofsRequest_SupplierOperatorAddress) isQueryAllProofsRequest_Filter() {} -func (*QueryAllProofsRequest_SessionId) isQueryAllProofsRequest_Filter() {} -func (*QueryAllProofsRequest_SessionEndHeight) isQueryAllProofsRequest_Filter() {} - -func (m *QueryAllProofsRequest) GetFilter() isQueryAllProofsRequest_Filter { - if m != nil { - return m.Filter - } - return nil -} - -func (m *QueryAllProofsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *QueryAllProofsRequest) GetSupplierOperatorAddress() string { - if x, ok := m.GetFilter().(*QueryAllProofsRequest_SupplierOperatorAddress); ok { - return x.SupplierOperatorAddress - } - return "" -} - -func (m *QueryAllProofsRequest) GetSessionId() string { - if x, ok := m.GetFilter().(*QueryAllProofsRequest_SessionId); ok { - return x.SessionId - } - return "" -} - -func (m *QueryAllProofsRequest) GetSessionEndHeight() uint64 { - if x, ok := m.GetFilter().(*QueryAllProofsRequest_SessionEndHeight); ok { - return x.SessionEndHeight - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryAllProofsRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryAllProofsRequest_SupplierOperatorAddress)(nil), - (*QueryAllProofsRequest_SessionId)(nil), - (*QueryAllProofsRequest_SessionEndHeight)(nil), - } -} - -type QueryAllProofsResponse struct { - Proofs []Proof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllProofsResponse) Reset() { *m = QueryAllProofsResponse{} } -func (m *QueryAllProofsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllProofsResponse) ProtoMessage() {} -func (*QueryAllProofsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452adc3cc4abc239, []int{9} -} -func (m *QueryAllProofsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllProofsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllProofsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllProofsResponse.Merge(m, src) -} -func (m *QueryAllProofsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllProofsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllProofsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllProofsResponse proto.InternalMessageInfo - -func (m *QueryAllProofsResponse) GetProofs() []Proof { - if m != nil { - return m.Proofs - } - return nil -} - -func (m *QueryAllProofsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.proof.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.proof.QueryParamsResponse") - proto.RegisterType((*QueryGetClaimRequest)(nil), "poktroll.proof.QueryGetClaimRequest") - proto.RegisterType((*QueryGetClaimResponse)(nil), "poktroll.proof.QueryGetClaimResponse") - proto.RegisterType((*QueryAllClaimsRequest)(nil), "poktroll.proof.QueryAllClaimsRequest") - proto.RegisterType((*QueryAllClaimsResponse)(nil), "poktroll.proof.QueryAllClaimsResponse") - proto.RegisterType((*QueryGetProofRequest)(nil), "poktroll.proof.QueryGetProofRequest") - proto.RegisterType((*QueryGetProofResponse)(nil), "poktroll.proof.QueryGetProofResponse") - proto.RegisterType((*QueryAllProofsRequest)(nil), "poktroll.proof.QueryAllProofsRequest") - proto.RegisterType((*QueryAllProofsResponse)(nil), "poktroll.proof.QueryAllProofsResponse") -} - -func init() { proto.RegisterFile("poktroll/proof/query.proto", fileDescriptor_452adc3cc4abc239) } - -var fileDescriptor_452adc3cc4abc239 = []byte{ - // 747 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xbf, 0x6f, 0xd3, 0x4e, - 0x14, 0x8f, 0xdb, 0x26, 0xfa, 0xe6, 0xbe, 0x12, 0x82, 0x23, 0x2d, 0x69, 0x00, 0xb7, 0x72, 0x7f, - 0x50, 0x15, 0xd5, 0x56, 0xdb, 0x09, 0x89, 0xa5, 0x41, 0xd0, 0xf2, 0x4b, 0x04, 0x97, 0x89, 0x25, - 0x72, 0x9a, 0xab, 0x6b, 0xd5, 0xf1, 0xb9, 0xf6, 0x05, 0xa8, 0xaa, 0x32, 0x30, 0xb0, 0xb0, 0x20, - 0x21, 0xf1, 0x37, 0xc0, 0xc6, 0xc0, 0x1f, 0xd1, 0xb1, 0x82, 0xa5, 0x13, 0x42, 0x29, 0x12, 0x33, - 0x1b, 0x23, 0xf2, 0xbb, 0x67, 0x12, 0x9b, 0xba, 0x29, 0x12, 0x03, 0x12, 0x8b, 0x65, 0xdf, 0xfb, - 0xbc, 0x77, 0x9f, 0xf7, 0xb9, 0xcf, 0x3d, 0x99, 0x54, 0x7c, 0xbe, 0x29, 0x02, 0xee, 0xba, 0x86, - 0x1f, 0x70, 0xbe, 0x6e, 0x6c, 0xb5, 0x59, 0xb0, 0xad, 0xfb, 0x01, 0x17, 0x9c, 0x9e, 0x8a, 0x63, - 0x3a, 0xc4, 0x2a, 0x67, 0xac, 0x96, 0xe3, 0x71, 0x03, 0x9e, 0x12, 0x52, 0x29, 0xd9, 0xdc, 0xe6, - 0xf0, 0x6a, 0x44, 0x6f, 0xb8, 0x7a, 0xc1, 0xe6, 0xdc, 0x76, 0x99, 0x61, 0xf9, 0x8e, 0x61, 0x79, - 0x1e, 0x17, 0x96, 0x70, 0xb8, 0x17, 0x62, 0x74, 0x74, 0x8d, 0x87, 0x2d, 0x1e, 0xd6, 0x65, 0x9a, - 0xfc, 0xc0, 0xd0, 0xac, 0xfc, 0x32, 0x1a, 0x56, 0xc8, 0x24, 0x15, 0xe3, 0xd1, 0x7c, 0x83, 0x09, - 0x6b, 0xde, 0xf0, 0x2d, 0xdb, 0xf1, 0xa0, 0x0e, 0x62, 0xcf, 0xa7, 0x98, 0xfb, 0x56, 0x60, 0xb5, - 0xe2, 0x42, 0xe9, 0xb6, 0xc4, 0xb6, 0xcf, 0x30, 0xa6, 0x95, 0x08, 0xbd, 0x1f, 0x95, 0xae, 0x41, - 0x82, 0xc9, 0xb6, 0xda, 0x2c, 0x14, 0x5a, 0x8d, 0x9c, 0x4d, 0xac, 0x86, 0x3e, 0xf7, 0x42, 0x46, - 0xaf, 0x90, 0x82, 0x2c, 0x5c, 0x56, 0xc6, 0x95, 0x99, 0xff, 0x17, 0x46, 0xf4, 0xa4, 0x28, 0xba, - 0xc4, 0x57, 0x8b, 0x7b, 0x9f, 0xc6, 0x72, 0x6f, 0xbe, 0xbe, 0x9b, 0x55, 0x4c, 0x4c, 0xd0, 0x5e, - 0x28, 0xa4, 0x04, 0x25, 0x97, 0x99, 0xb8, 0xe6, 0x5a, 0x4e, 0x0b, 0xb7, 0xa2, 0x17, 0x09, 0x09, - 0x59, 0x18, 0x3a, 0xdc, 0xab, 0x3b, 0x4d, 0xa8, 0x5b, 0x34, 0x8b, 0xb8, 0x72, 0xb3, 0x49, 0x1f, - 0x90, 0xd1, 0xb0, 0xed, 0xfb, 0xae, 0xc3, 0x82, 0x3a, 0xf7, 0x59, 0x60, 0x09, 0x1e, 0xd4, 0xad, - 0x66, 0x33, 0x60, 0x61, 0x58, 0x1e, 0x88, 0xd0, 0xd5, 0xf2, 0x87, 0xf7, 0x73, 0x25, 0x54, 0x6e, - 0x49, 0x46, 0x56, 0x45, 0xe0, 0x78, 0xb6, 0x79, 0x2e, 0x4e, 0xbd, 0x87, 0x99, 0x18, 0xd6, 0x6e, - 0x91, 0xe1, 0x14, 0x19, 0xec, 0x70, 0x9e, 0xe4, 0xd7, 0xa2, 0x05, 0x6c, 0x70, 0x38, 0xdd, 0x20, - 0xa0, 0xab, 0x43, 0x51, 0x7f, 0xa6, 0x44, 0x6a, 0xdf, 0x15, 0x2c, 0xb6, 0xe4, 0xba, 0x10, 0x8e, - 0x55, 0xa4, 0x37, 0x08, 0xe9, 0x1e, 0x14, 0x56, 0x9c, 0xd6, 0x91, 0x69, 0x74, 0xaa, 0xba, 0x34, - 0x18, 0x9e, 0xaa, 0x5e, 0xb3, 0x6c, 0x86, 0xb9, 0x66, 0x4f, 0x26, 0xbd, 0xda, 0x57, 0x83, 0x95, - 0x5c, 0x66, 0xaf, 0x74, 0x2c, 0x21, 0xf0, 0x20, 0xc2, 0x7b, 0x24, 0xd6, 0x09, 0x8d, 0x01, 0xcc, - 0x6b, 0xd6, 0x37, 0x98, 0x63, 0x6f, 0x88, 0xf2, 0xd0, 0xb8, 0x32, 0x33, 0xb4, 0x92, 0x33, 0x4f, - 0x63, 0xec, 0xba, 0xd7, 0x5c, 0x81, 0x48, 0xf5, 0x3f, 0x52, 0x58, 0x77, 0x5c, 0xc1, 0x02, 0xed, - 0xb5, 0x42, 0x46, 0xd2, 0xad, 0xa3, 0x90, 0x8b, 0xa4, 0x00, 0xf2, 0x44, 0x56, 0x19, 0xec, 0xa7, - 0x24, 0x42, 0xe9, 0x72, 0x42, 0xb0, 0x01, 0x10, 0xec, 0x52, 0x5f, 0xc1, 0xe4, 0x8e, 0xbd, 0x8a, - 0x25, 0xdc, 0x56, 0x8b, 0xb6, 0xfb, 0x5b, 0xdc, 0x86, 0x64, 0xba, 0x6e, 0x03, 0x31, 0xb2, 0xdc, - 0x06, 0xe8, 0xd8, 0x6d, 0xb0, 0x94, 0x70, 0x1b, 0x84, 0xff, 0x4d, 0xb7, 0xc5, 0xad, 0x77, 0xdd, - 0x06, 0xf2, 0x64, 0xba, 0xad, 0x57, 0x49, 0x84, 0xfe, 0x31, 0xb7, 0x2d, 0x7c, 0xcb, 0x93, 0x3c, - 0x10, 0xa3, 0x4f, 0x49, 0x41, 0x8e, 0x40, 0xaa, 0xa5, 0x19, 0xfc, 0x3a, 0x65, 0x2b, 0x13, 0xc7, - 0x62, 0xe4, 0x46, 0xda, 0xe5, 0x67, 0x1f, 0xbf, 0xbc, 0x1a, 0x98, 0xa2, 0x13, 0x46, 0x04, 0x9e, - 0xf3, 0x98, 0x78, 0xcc, 0x83, 0x4d, 0xe3, 0xc8, 0x79, 0x4f, 0xdf, 0x2a, 0x24, 0x0f, 0x17, 0x8b, - 0x4e, 0x1e, 0x59, 0x3b, 0x35, 0x7c, 0x2b, 0x53, 0x7d, 0x50, 0xc8, 0x61, 0x15, 0x38, 0xdc, 0xa5, - 0xb7, 0x8f, 0xe5, 0x00, 0x97, 0xd8, 0xd8, 0xe9, 0x1e, 0xff, 0xae, 0xb1, 0x93, 0xe9, 0xa4, 0x5d, - 0xfa, 0x5c, 0x21, 0xc5, 0x9f, 0x73, 0x83, 0x1e, 0xcd, 0x24, 0x3d, 0x52, 0x2b, 0xd3, 0xfd, 0x60, - 0xc8, 0x78, 0x16, 0x18, 0x4f, 0x52, 0xad, 0x3f, 0x63, 0x10, 0x0d, 0xfc, 0x91, 0x2d, 0x5a, 0xef, - 0x0c, 0xc9, 0x16, 0x2d, 0x71, 0xb9, 0x4f, 0x28, 0x9a, 0x7c, 0xfe, 0xae, 0x68, 0xd2, 0xfe, 0xd9, - 0xa2, 0x25, 0x26, 0x43, 0xb6, 0x68, 0xc9, 0x5b, 0x74, 0x42, 0xd1, 0xe0, 0x59, 0xbd, 0xb3, 0xd7, - 0x51, 0x95, 0xfd, 0x8e, 0xaa, 0x1c, 0x74, 0x54, 0xe5, 0x73, 0x47, 0x55, 0x5e, 0x1e, 0xaa, 0xb9, - 0xfd, 0x43, 0x35, 0x77, 0x70, 0xa8, 0xe6, 0x1e, 0xea, 0xb6, 0x23, 0x36, 0xda, 0x0d, 0x7d, 0x8d, - 0xb7, 0x32, 0x6a, 0x3d, 0xe9, 0xfd, 0x17, 0x69, 0x14, 0xe0, 0x67, 0x64, 0xf1, 0x47, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd9, 0x4d, 0xb5, 0x56, 0x81, 0x09, 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 Claim items. - Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) - AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) - // Queries a list of Proof items. - Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) - AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.proof.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) { - out := new(QueryGetClaimResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Query/Claim", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) { - out := new(QueryAllClaimsResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Query/AllClaims", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) { - out := new(QueryGetProofResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Query/Proof", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) { - out := new(QueryAllProofsResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Query/AllProofs", in, out, opts...) - 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 Claim items. - Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) - AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) - // Queries a list of Proof items. - Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) - AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, 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) Claim(ctx context.Context, req *QueryGetClaimRequest) (*QueryGetClaimResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") -} -func (*UnimplementedQueryServer) AllClaims(ctx context.Context, req *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllClaims not implemented") -} -func (*UnimplementedQueryServer) Proof(ctx context.Context, req *QueryGetProofRequest) (*QueryGetProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") -} -func (*UnimplementedQueryServer) AllProofs(ctx context.Context, req *QueryAllProofsRequest) (*QueryAllProofsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllProofs not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.proof.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 _Query_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetClaimRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Claim(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Query/Claim", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Claim(ctx, req.(*QueryGetClaimRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllClaims_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllClaimsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllClaims(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Query/AllClaims", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllClaims(ctx, req.(*QueryAllClaimsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetProofRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Query/Proof", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proof(ctx, req.(*QueryGetProofRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllProofs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllProofsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllProofs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Query/AllProofs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllProofs(ctx, req.(*QueryAllProofsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.proof.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Claim", - Handler: _Query_Claim_Handler, - }, - { - MethodName: "AllClaims", - Handler: _Query_AllClaims_Handler, - }, - { - MethodName: "Proof", - Handler: _Query_Proof_Handler, - }, - { - MethodName: "AllProofs", - Handler: _Query_AllProofs_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/proof/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetClaimRequest) 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 *QueryGetClaimRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.SessionId) > 0 { - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetClaimResponse) 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 *QueryGetClaimResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Claim.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 *QueryAllClaimsRequest) 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 *QueryAllClaimsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllClaimsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filter != nil { - { - size := m.Filter.Size() - i -= size - if _, err := m.Filter.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - 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 *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *QueryAllClaimsRequest_SessionId) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllClaimsRequest_SessionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *QueryAllClaimsRequest_SessionEndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllClaimsRequest_SessionEndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintQuery(dAtA, i, uint64(m.SessionEndHeight)) - i-- - dAtA[i] = 0x20 - return len(dAtA) - i, nil -} -func (m *QueryAllClaimsResponse) 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 *QueryAllClaimsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllClaimsResponse) 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.Claims) > 0 { - for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Claims[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 (m *QueryGetProofRequest) 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 *QueryGetProofRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.SessionId) > 0 { - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetProofResponse) 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 *QueryGetProofResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proof.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 *QueryAllProofsRequest) 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 *QueryAllProofsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllProofsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filter != nil { - { - size := m.Filter.Size() - i -= size - if _, err := m.Filter.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - 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 *QueryAllProofsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllProofsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *QueryAllProofsRequest_SessionId) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllProofsRequest_SessionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *QueryAllProofsRequest_SessionEndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllProofsRequest_SessionEndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintQuery(dAtA, i, uint64(m.SessionEndHeight)) - i-- - dAtA[i] = 0x20 - return len(dAtA) - i, nil -} -func (m *QueryAllProofsResponse) 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 *QueryAllProofsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllProofsResponse) 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.Proofs) > 0 { - for iNdEx := len(m.Proofs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proofs[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 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 *QueryGetClaimRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetClaimResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Claim.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllClaimsRequest) 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)) - } - if m.Filter != nil { - n += m.Filter.Size() - } - return n -} - -func (m *QueryAllClaimsRequest_SupplierOperatorAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllClaimsRequest_SessionId) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionId) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllClaimsRequest_SessionEndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovQuery(uint64(m.SessionEndHeight)) - return n -} -func (m *QueryAllClaimsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Claims) > 0 { - for _, e := range m.Claims { - 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 *QueryGetProofRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetProofResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proof.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllProofsRequest) 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)) - } - if m.Filter != nil { - n += m.Filter.Size() - } - return n -} - -func (m *QueryAllProofsRequest_SupplierOperatorAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllProofsRequest_SessionId) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionId) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllProofsRequest_SessionEndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovQuery(uint64(m.SessionEndHeight)) - return n -} -func (m *QueryAllProofsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Proofs) > 0 { - for _, e := range m.Proofs { - 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 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 *QueryGetClaimRequest) 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: QueryGetClaimRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.SessionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.SupplierOperatorAddress = 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 *QueryGetClaimResponse) 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: QueryGetClaimResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", 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.Claim.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 *QueryAllClaimsRequest) 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: QueryAllClaimsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllClaimsRequest: 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 - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.Filter = &QueryAllClaimsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.Filter = &QueryAllClaimsRequest_SessionId{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Filter = &QueryAllClaimsRequest_SessionEndHeight{v} - 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 *QueryAllClaimsResponse) 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: QueryAllClaimsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllClaimsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claims", 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.Claims = append(m.Claims, Claim{}) - if err := m.Claims[len(m.Claims)-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:]) - 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 *QueryGetProofRequest) 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: QueryGetProofRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.SessionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.SupplierOperatorAddress = 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 *QueryGetProofResponse) 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: QueryGetProofResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", 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.Proof.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 *QueryAllProofsRequest) 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: QueryAllProofsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllProofsRequest: 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 - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.Filter = &QueryAllProofsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.Filter = &QueryAllProofsRequest_SessionId{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Filter = &QueryAllProofsRequest_SessionEndHeight{v} - 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 *QueryAllProofsResponse) 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: QueryAllProofsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllProofsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proofs", 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.Proofs = append(m.Proofs, Proof{}) - if err := m.Proofs[len(m.Proofs)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/query.pb.gw.go b/x/proof/types/query.pb.gw.go deleted file mode 100644 index 28b7efa33..000000000 --- a/x/proof/types/query.pb.gw.go +++ /dev/null @@ -1,565 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/proof/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetClaimRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["session_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") - } - - protoReq.SessionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) - } - - val, ok = pathParams["supplier_operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") - } - - protoReq.SupplierOperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) - } - - msg, err := client.Claim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetClaimRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["session_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") - } - - protoReq.SessionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) - } - - val, ok = pathParams["supplier_operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") - } - - protoReq.SupplierOperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) - } - - msg, err := server.Claim(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllClaims_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllClaims_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllClaimsRequest - 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_AllClaims_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllClaims(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllClaims_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllClaimsRequest - 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_AllClaims_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllClaims(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProofRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["session_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") - } - - protoReq.SessionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) - } - - val, ok = pathParams["supplier_operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") - } - - protoReq.SupplierOperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) - } - - msg, err := client.Proof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProofRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["session_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") - } - - protoReq.SessionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) - } - - val, ok = pathParams["supplier_operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") - } - - protoReq.SupplierOperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) - } - - msg, err := server.Proof(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllProofs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllProofs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllProofsRequest - 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_AllProofs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllProofs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllProofs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllProofsRequest - 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_AllProofs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllProofs(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Claim_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_Claim_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_Claim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllClaims_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_AllClaims_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_AllClaims_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proof_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_Proof_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_Proof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllProofs_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_AllProofs_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_AllProofs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Claim_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_Claim_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_Claim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllClaims_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_AllClaims_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_AllClaims_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proof_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_Proof_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_Proof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllProofs_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_AllProofs_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_AllProofs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Claim_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{"pokt-network", "poktroll", "proof", "claim", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllClaims_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "claim"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Proof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "proof", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllProofs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "proof"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Claim_0 = runtime.ForwardResponseMessage - - forward_Query_AllClaims_0 = runtime.ForwardResponseMessage - - forward_Query_Proof_0 = runtime.ForwardResponseMessage - - forward_Query_AllProofs_0 = runtime.ForwardResponseMessage -) diff --git a/x/proof/types/tx.pb.go b/x/proof/types/tx.pb.go deleted file mode 100644 index a98755961..000000000 --- a/x/proof/types/tx.pb.go +++ /dev/null @@ -1,2396 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/tx.proto - -package types - -import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/pokt-network/poktroll/x/session/types" - _ "github.com/pokt-network/poktroll/x/shared/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type to update all params at once. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/proof parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. -type MsgUpdateParam struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // The (name, as_type) tuple must match the corresponding name and type as - // specified in the `Params`` message in `proof/params.proto.` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to AsType: - // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 - // *MsgUpdateParam_AsBytes - // *MsgUpdateParam_AsFloat - // *MsgUpdateParam_AsCoin - AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` -} - -func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } -func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParam) ProtoMessage() {} -func (*MsgUpdateParam) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{2} -} -func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParam.Merge(m, src) -} -func (m *MsgUpdateParam) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParam) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo - -type isMsgUpdateParam_AsType interface { - isMsgUpdateParam_AsType() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgUpdateParam_AsString struct { - AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` -} -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` -} -type MsgUpdateParam_AsBytes struct { - AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` -} -type MsgUpdateParam_AsFloat struct { - AsFloat float32 `protobuf:"fixed32,8,opt,name=as_float,json=asFloat,proto3,oneof" json:"as_float"` -} -type MsgUpdateParam_AsCoin struct { - AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` -} - -func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} - -func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { - if m != nil { - return m.AsType - } - return nil -} - -func (m *MsgUpdateParam) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpdateParam) GetAsString() string { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { - return x.AsString - } - return "" -} - -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 - } - return 0 -} - -func (m *MsgUpdateParam) GetAsBytes() []byte { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { - return x.AsBytes - } - return nil -} - -func (m *MsgUpdateParam) GetAsFloat() float32 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsFloat); ok { - return x.AsFloat - } - return 0 -} - -func (m *MsgUpdateParam) GetAsCoin() *types.Coin { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsCoin); ok { - return x.AsCoin - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), - (*MsgUpdateParam_AsBytes)(nil), - (*MsgUpdateParam_AsFloat)(nil), - (*MsgUpdateParam_AsCoin)(nil), - } -} - -// MsgUpdateParamResponse defines the response structure for executing a -// MsgUpdateParam message after a single param update. -type MsgUpdateParamResponse struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } -func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamResponse) ProtoMessage() {} -func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{3} -} -func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) -} -func (m *MsgUpdateParamResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo - -func (m *MsgUpdateParamResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -type MsgCreateClaim struct { - SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` - SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - // root returned from smt.SMST#Root() - RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` -} - -func (m *MsgCreateClaim) Reset() { *m = MsgCreateClaim{} } -func (m *MsgCreateClaim) String() string { return proto.CompactTextString(m) } -func (*MsgCreateClaim) ProtoMessage() {} -func (*MsgCreateClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{4} -} -func (m *MsgCreateClaim) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgCreateClaim) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateClaim.Merge(m, src) -} -func (m *MsgCreateClaim) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateClaim) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateClaim.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateClaim proto.InternalMessageInfo - -func (m *MsgCreateClaim) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -func (m *MsgCreateClaim) GetSessionHeader() *types1.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *MsgCreateClaim) GetRootHash() []byte { - if m != nil { - return m.RootHash - } - return nil -} - -type MsgCreateClaimResponse struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` -} - -func (m *MsgCreateClaimResponse) Reset() { *m = MsgCreateClaimResponse{} } -func (m *MsgCreateClaimResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateClaimResponse) ProtoMessage() {} -func (*MsgCreateClaimResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{5} -} -func (m *MsgCreateClaimResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgCreateClaimResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateClaimResponse.Merge(m, src) -} -func (m *MsgCreateClaimResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateClaimResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateClaimResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateClaimResponse proto.InternalMessageInfo - -func (m *MsgCreateClaimResponse) GetClaim() *Claim { - if m != nil { - return m.Claim - } - return nil -} - -type MsgSubmitProof struct { - SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` - SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - // serialized version of *smt.SparseMerkleClosestProof - Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *MsgSubmitProof) Reset() { *m = MsgSubmitProof{} } -func (m *MsgSubmitProof) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProof) ProtoMessage() {} -func (*MsgSubmitProof) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{6} -} -func (m *MsgSubmitProof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgSubmitProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProof.Merge(m, src) -} -func (m *MsgSubmitProof) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProof) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProof.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProof proto.InternalMessageInfo - -func (m *MsgSubmitProof) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -func (m *MsgSubmitProof) GetSessionHeader() *types1.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *MsgSubmitProof) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - -type MsgSubmitProofResponse struct { - Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *MsgSubmitProofResponse) Reset() { *m = MsgSubmitProofResponse{} } -func (m *MsgSubmitProofResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProofResponse) ProtoMessage() {} -func (*MsgSubmitProofResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_345e95e87511f6a6, []int{7} -} -func (m *MsgSubmitProofResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgSubmitProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProofResponse.Merge(m, src) -} -func (m *MsgSubmitProofResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProofResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProofResponse proto.InternalMessageInfo - -func (m *MsgSubmitProofResponse) GetProof() *Proof { - if m != nil { - return m.Proof - } - return nil -} - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.proof.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.proof.MsgUpdateParamsResponse") - proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.proof.MsgUpdateParam") - proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.proof.MsgUpdateParamResponse") - proto.RegisterType((*MsgCreateClaim)(nil), "poktroll.proof.MsgCreateClaim") - proto.RegisterType((*MsgCreateClaimResponse)(nil), "poktroll.proof.MsgCreateClaimResponse") - proto.RegisterType((*MsgSubmitProof)(nil), "poktroll.proof.MsgSubmitProof") - proto.RegisterType((*MsgSubmitProofResponse)(nil), "poktroll.proof.MsgSubmitProofResponse") -} - -func init() { proto.RegisterFile("poktroll/proof/tx.proto", fileDescriptor_345e95e87511f6a6) } - -var fileDescriptor_345e95e87511f6a6 = []byte{ - // 792 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x41, 0x4f, 0xdb, 0x48, - 0x14, 0x8e, 0xc3, 0x12, 0xe2, 0x49, 0xc8, 0x6a, 0x2d, 0x96, 0x38, 0x61, 0xd7, 0x89, 0x72, 0xd8, - 0xcd, 0xb2, 0x8b, 0x2d, 0x60, 0x85, 0xb4, 0xdc, 0x08, 0x5a, 0x94, 0x4a, 0x45, 0x45, 0xa6, 0x48, - 0x55, 0x2f, 0xd6, 0x24, 0x19, 0x12, 0x8b, 0xd8, 0x63, 0xcd, 0x4c, 0x28, 0xdc, 0xaa, 0x1e, 0x7b, - 0xea, 0xcf, 0xe8, 0x91, 0x43, 0x2f, 0xfd, 0x07, 0x1c, 0x51, 0x4f, 0x9c, 0xa2, 0x2a, 0x54, 0x42, - 0x85, 0x3f, 0x51, 0x79, 0x66, 0xe2, 0x38, 0x69, 0x80, 0xaa, 0xa7, 0x5e, 0xe2, 0x99, 0xf7, 0x7d, - 0xf3, 0xe5, 0xbd, 0xef, 0x3d, 0x8f, 0x41, 0x3e, 0xc0, 0x47, 0x8c, 0xe0, 0x6e, 0xd7, 0x0a, 0x08, - 0xc6, 0x87, 0x16, 0x3b, 0x31, 0x03, 0x82, 0x19, 0xd6, 0x72, 0x43, 0xc0, 0xe4, 0x40, 0xf1, 0x17, - 0xe8, 0xb9, 0x3e, 0xb6, 0xf8, 0xaf, 0xa0, 0x14, 0x8d, 0x26, 0xa6, 0x1e, 0xa6, 0x56, 0x03, 0x52, - 0x64, 0x1d, 0xaf, 0x36, 0x10, 0x83, 0xab, 0x56, 0x13, 0xbb, 0xbe, 0xc4, 0xf3, 0x12, 0xf7, 0x68, - 0xdb, 0x3a, 0x5e, 0x0d, 0x1f, 0x12, 0x28, 0x08, 0xc0, 0xe1, 0x3b, 0x4b, 0x6c, 0x24, 0xb4, 0xd0, - 0xc6, 0x6d, 0x2c, 0xe2, 0xe1, 0x4a, 0x46, 0x97, 0x26, 0xb2, 0x0c, 0x20, 0x81, 0xde, 0xf0, 0x48, - 0x71, 0xb2, 0x84, 0xd3, 0x00, 0x0d, 0xb1, 0xdf, 0x22, 0x8c, 0x22, 0x4a, 0x5d, 0xec, 0x8f, 0xa1, - 0xbf, 0x8f, 0xd0, 0x0e, 0x24, 0xa8, 0x65, 0x51, 0x44, 0x8e, 0xdd, 0x26, 0x12, 0x70, 0xe5, 0xbd, - 0x02, 0x7e, 0xde, 0xa5, 0xed, 0x83, 0xa0, 0x05, 0x19, 0xda, 0xe3, 0x7f, 0xa9, 0x6d, 0x00, 0x15, - 0xf6, 0x58, 0x07, 0x13, 0x97, 0x9d, 0xea, 0x4a, 0x59, 0xa9, 0xaa, 0x35, 0xfd, 0xc3, 0xbb, 0x95, - 0x05, 0x59, 0xc4, 0x56, 0xab, 0x45, 0x10, 0xa5, 0xfb, 0x8c, 0xb8, 0x7e, 0xdb, 0x1e, 0x51, 0xb5, - 0xff, 0x40, 0x4a, 0x24, 0xad, 0x27, 0xcb, 0x4a, 0x35, 0xb3, 0xb6, 0x68, 0x8e, 0xfb, 0x6b, 0x0a, - 0xfd, 0x9a, 0x7a, 0xde, 0x2f, 0x25, 0xde, 0x5e, 0x9f, 0x2d, 0x2b, 0xb6, 0x3c, 0xb0, 0xb9, 0xfe, - 0xea, 0xfa, 0x6c, 0x79, 0x24, 0xf5, 0xfa, 0xfa, 0x6c, 0xb9, 0x1c, 0x25, 0x7e, 0x22, 0x8b, 0x9e, - 0xc8, 0xb3, 0x52, 0x00, 0xf9, 0x89, 0x90, 0x8d, 0x68, 0x80, 0x7d, 0x8a, 0x2a, 0x9f, 0x93, 0x20, - 0x37, 0x8e, 0x7d, 0x77, 0x55, 0x1a, 0xf8, 0xc9, 0x87, 0x1e, 0xe2, 0x35, 0xa9, 0x36, 0x5f, 0x6b, - 0xff, 0x00, 0x15, 0x52, 0x87, 0x72, 0xae, 0x3e, 0xc3, 0xb5, 0xe6, 0x6f, 0xfa, 0xa5, 0x51, 0xb0, - 0x9e, 0xb0, 0xd3, 0x50, 0x8a, 0x69, 0x7f, 0x81, 0x34, 0xa4, 0x8e, 0xeb, 0xb3, 0x8d, 0x7f, 0xf5, - 0x54, 0x59, 0xa9, 0xce, 0xd4, 0xb2, 0x37, 0xfd, 0x52, 0x14, 0xab, 0x27, 0xec, 0x39, 0x48, 0x1f, - 0x85, 0x4b, 0x49, 0x6d, 0x9c, 0x32, 0x44, 0xf5, 0xb9, 0xb2, 0x52, 0xcd, 0x46, 0x54, 0x1e, 0x13, - 0xd4, 0x5a, 0xb8, 0x94, 0xd4, 0xc3, 0x2e, 0x86, 0x4c, 0x4f, 0x97, 0x95, 0x6a, 0x32, 0xa2, 0xf2, - 0x98, 0xa0, 0xee, 0x84, 0x4b, 0x6d, 0x0b, 0xcc, 0x41, 0xea, 0x84, 0x53, 0xab, 0xab, 0xbc, 0x33, - 0x05, 0x53, 0x56, 0x1d, 0x8e, 0xb5, 0x29, 0xc7, 0xda, 0xdc, 0xc6, 0xae, 0x5f, 0xcb, 0xdc, 0xf4, - 0x4b, 0x43, 0x76, 0x3d, 0x61, 0xa7, 0x20, 0x0d, 0xc3, 0x9b, 0xb9, 0xf1, 0x06, 0xd5, 0x54, 0x2e, - 0x19, 0x0e, 0x5a, 0xa5, 0x0e, 0x16, 0xc7, 0xad, 0x1e, 0x76, 0x41, 0x33, 0xa3, 0x81, 0x50, 0xee, - 0x1b, 0x88, 0xe1, 0x14, 0x54, 0x6e, 0x15, 0xde, 0xb5, 0x6d, 0x82, 0x20, 0x43, 0xdb, 0x5d, 0xe8, - 0x7a, 0xda, 0x53, 0x50, 0xa0, 0xbd, 0x20, 0xe8, 0xba, 0x88, 0x38, 0x38, 0x40, 0x04, 0x32, 0x4c, - 0x1c, 0x28, 0x7a, 0xf5, 0x60, 0x17, 0xf3, 0xc3, 0xa3, 0x4f, 0xe4, 0x49, 0x09, 0x6b, 0x3b, 0x20, - 0x27, 0xdf, 0x15, 0xa7, 0x83, 0x60, 0x0b, 0x11, 0x39, 0xb1, 0xa5, 0x51, 0x82, 0x12, 0x37, 0xf7, - 0xc5, 0xb3, 0xce, 0x69, 0xf6, 0x3c, 0x8d, 0x6f, 0xb5, 0x25, 0xa0, 0x12, 0x8c, 0x99, 0xd3, 0x81, - 0xb4, 0xc3, 0xe7, 0x20, 0x6b, 0xa7, 0xc3, 0x40, 0x1d, 0xd2, 0xce, 0xa6, 0x11, 0x5a, 0x76, 0x77, - 0xf6, 0x95, 0xff, 0xb9, 0x6f, 0xb1, 0x62, 0x23, 0xdf, 0xfe, 0x06, 0xb3, 0xcd, 0x30, 0x20, 0x6d, - 0xfb, 0x75, 0xd2, 0x36, 0xc1, 0x16, 0x9c, 0xca, 0x27, 0x61, 0xda, 0x7e, 0xaf, 0xe1, 0xb9, 0x6c, - 0x2f, 0xc4, 0x7f, 0x70, 0xd3, 0x16, 0xc0, 0x2c, 0x2f, 0x43, 0x1a, 0x26, 0x36, 0xdf, 0xe8, 0x56, - 0xac, 0xca, 0xb8, 0x5b, 0x42, 0xef, 0x0e, 0xb7, 0x04, 0x5b, 0x70, 0xd6, 0x6e, 0x93, 0x60, 0x66, - 0x97, 0xb6, 0xb5, 0x67, 0x20, 0x3b, 0x76, 0xe7, 0x95, 0x26, 0x4f, 0x4d, 0xdc, 0x2c, 0xc5, 0x3f, - 0x1f, 0x20, 0x44, 0xe9, 0x1c, 0x80, 0x4c, 0x7c, 0x80, 0x8d, 0x29, 0xe7, 0x62, 0x78, 0xf1, 0x8f, - 0xfb, 0xf1, 0xb8, 0x6c, 0xbc, 0xc5, 0xd3, 0x64, 0x63, 0xf8, 0x54, 0xd9, 0x69, 0xe6, 0x1d, 0x80, - 0x4c, 0xfc, 0x92, 0x34, 0xee, 0xaf, 0x72, 0xaa, 0xec, 0x94, 0x37, 0xbf, 0x38, 0xfb, 0x32, 0xbc, - 0xde, 0x6b, 0x8f, 0xcf, 0x07, 0x86, 0x72, 0x31, 0x30, 0x94, 0xcb, 0x81, 0xa1, 0x7c, 0x1c, 0x18, - 0xca, 0x9b, 0x2b, 0x23, 0x71, 0x71, 0x65, 0x24, 0x2e, 0xaf, 0x8c, 0xc4, 0x73, 0xb3, 0xed, 0xb2, - 0x4e, 0xaf, 0x61, 0x36, 0xb1, 0x67, 0x85, 0xb2, 0x2b, 0x3e, 0x62, 0x2f, 0x30, 0x39, 0xb2, 0xbe, - 0xba, 0xf9, 0xf9, 0x07, 0xad, 0x91, 0xe2, 0x9f, 0xac, 0xf5, 0x2f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xea, 0x29, 0x29, 0xa7, 0xd0, 0x07, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) - SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) { - out := new(MsgCreateClaimResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/CreateClaim", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) { - out := new(MsgSubmitProofResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/SubmitProof", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/UpdateParam", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) - SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) CreateClaim(ctx context.Context, req *MsgCreateClaim) (*MsgCreateClaimResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateClaim not implemented") -} -func (*UnimplementedMsgServer) SubmitProof(ctx context.Context, req *MsgSubmitProof) (*MsgSubmitProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitProof not implemented") -} -func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CreateClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateClaim) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateClaim(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Msg/CreateClaim", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateClaim(ctx, req.(*MsgCreateClaim)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitProof) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Msg/SubmitProof", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitProof(ctx, req.(*MsgSubmitProof)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.proof.Msg/UpdateParam", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.proof.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "CreateClaim", - Handler: _Msg_CreateClaim_Handler, - }, - { - MethodName: "SubmitProof", - Handler: _Msg_SubmitProof_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/proof/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AsType != nil { - { - size := m.AsType.Size() - i -= size - if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.AsString) - copy(dAtA[i:], m.AsString) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.AsBytes != nil { - i -= len(m.AsBytes) - copy(dAtA[i:], m.AsBytes) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsFloat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsFloat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.AsFloat)))) - i-- - dAtA[i] = 0x45 - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsCoin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.AsCoin != nil { - { - size, err := m.AsCoin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateClaim) 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 *MsgCreateClaim) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RootHash) > 0 { - i -= len(m.RootHash) - copy(dAtA[i:], m.RootHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.RootHash))) - i-- - dAtA[i] = 0x1a - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateClaimResponse) 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 *MsgCreateClaimResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitProof) 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 *MsgSubmitProof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x1a - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitProofResponse) 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 *MsgSubmitProofResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.AsType != nil { - n += m.AsType.Size() - } - return n -} - -func (m *MsgUpdateParam_AsString) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AsString) - n += 1 + l + sovTx(uint64(l)) - return n -} -func (m *MsgUpdateParam_AsInt64) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.AsInt64)) - return n -} -func (m *MsgUpdateParam_AsBytes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AsBytes != nil { - l = len(m.AsBytes) - n += 1 + l + sovTx(uint64(l)) - } - return n -} -func (m *MsgUpdateParam_AsFloat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 5 - return n -} -func (m *MsgUpdateParam_AsCoin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AsCoin != nil { - l = m.AsCoin.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} -func (m *MsgUpdateParamResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCreateClaim) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.RootHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCreateClaimResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitProof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitProofResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParam) 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 ErrIntOverflowTx - } - 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: MsgUpdateParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AsType = &MsgUpdateParam_AsInt64{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.AsType = &MsgUpdateParam_AsBytes{v} - iNdEx = postIndex - case 8: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field AsFloat", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.AsType = &MsgUpdateParam_AsFloat{float32(math.Float32frombits(v))} - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.Coin{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AsType = &MsgUpdateParam_AsCoin{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateClaim) 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 ErrIntOverflowTx - } - 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: MsgCreateClaim: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateClaim: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types1.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) - if m.RootHash == nil { - m.RootHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateClaimResponse) 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 ErrIntOverflowTx - } - 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: MsgCreateClaimResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitProof) 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 ErrIntOverflowTx - } - 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: MsgSubmitProof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types1.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitProofResponse) 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 ErrIntOverflowTx - } - 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: MsgSubmitProofResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/proof/types/types.pb.go b/x/proof/types/types.pb.go deleted file mode 100644 index 52230cff6..000000000 --- a/x/proof/types/types.pb.go +++ /dev/null @@ -1,791 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/proof/types.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/session/types" - 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 - -type ProofRequirementReason int32 - -const ( - ProofRequirementReason_NOT_REQUIRED ProofRequirementReason = 0 - ProofRequirementReason_PROBABILISTIC ProofRequirementReason = 1 - ProofRequirementReason_THRESHOLD ProofRequirementReason = 2 -) - -var ProofRequirementReason_name = map[int32]string{ - 0: "NOT_REQUIRED", - 1: "PROBABILISTIC", - 2: "THRESHOLD", -} - -var ProofRequirementReason_value = map[string]int32{ - "NOT_REQUIRED": 0, - "PROBABILISTIC": 1, - "THRESHOLD": 2, -} - -func (x ProofRequirementReason) String() string { - return proto.EnumName(ProofRequirementReason_name, int32(x)) -} - -func (ProofRequirementReason) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b75ef15dfd4d6998, []int{0} -} - -type ClaimProofStage int32 - -const ( - ClaimProofStage_CLAIMED ClaimProofStage = 0 - ClaimProofStage_PROVEN ClaimProofStage = 1 - ClaimProofStage_SETTLED ClaimProofStage = 2 - ClaimProofStage_EXPIRED ClaimProofStage = 3 -) - -var ClaimProofStage_name = map[int32]string{ - 0: "CLAIMED", - 1: "PROVEN", - 2: "SETTLED", - 3: "EXPIRED", -} - -var ClaimProofStage_value = map[string]int32{ - "CLAIMED": 0, - "PROVEN": 1, - "SETTLED": 2, - "EXPIRED": 3, -} - -func (x ClaimProofStage) String() string { - return proto.EnumName(ClaimProofStage_name, int32(x)) -} - -func (ClaimProofStage) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b75ef15dfd4d6998, []int{1} -} - -type Proof struct { - // Address of the supplier's operator that submitted this proof. - SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` - // The session header of the session that this claim is for. - SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - // The serialized SMST proof from the `#ClosestProof()` method. - ClosestMerkleProof []byte `protobuf:"bytes,3,opt,name=closest_merkle_proof,json=closestMerkleProof,proto3" json:"closest_merkle_proof,omitempty"` -} - -func (m *Proof) Reset() { *m = Proof{} } -func (m *Proof) String() string { return proto.CompactTextString(m) } -func (*Proof) ProtoMessage() {} -func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_b75ef15dfd4d6998, []int{0} -} -func (m *Proof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Proof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proof.Merge(m, src) -} -func (m *Proof) XXX_Size() int { - return m.Size() -} -func (m *Proof) XXX_DiscardUnknown() { - xxx_messageInfo_Proof.DiscardUnknown(m) -} - -var xxx_messageInfo_Proof proto.InternalMessageInfo - -func (m *Proof) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -func (m *Proof) GetSessionHeader() *types.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *Proof) GetClosestMerkleProof() []byte { - if m != nil { - return m.ClosestMerkleProof - } - return nil -} - -// Claim is the serialized object stored on-chain for claims pending to be proven -type Claim struct { - SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` - // The session header of the session that this claim is for. - SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - // Root hash returned from smt.SMST#Root(). - RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` -} - -func (m *Claim) Reset() { *m = Claim{} } -func (m *Claim) String() string { return proto.CompactTextString(m) } -func (*Claim) ProtoMessage() {} -func (*Claim) Descriptor() ([]byte, []int) { - return fileDescriptor_b75ef15dfd4d6998, []int{1} -} -func (m *Claim) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Claim) XXX_Merge(src proto.Message) { - xxx_messageInfo_Claim.Merge(m, src) -} -func (m *Claim) XXX_Size() int { - return m.Size() -} -func (m *Claim) XXX_DiscardUnknown() { - xxx_messageInfo_Claim.DiscardUnknown(m) -} - -var xxx_messageInfo_Claim proto.InternalMessageInfo - -func (m *Claim) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -func (m *Claim) GetSessionHeader() *types.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *Claim) GetRootHash() []byte { - if m != nil { - return m.RootHash - } - return nil -} - -func init() { - proto.RegisterEnum("poktroll.proof.ProofRequirementReason", ProofRequirementReason_name, ProofRequirementReason_value) - proto.RegisterEnum("poktroll.proof.ClaimProofStage", ClaimProofStage_name, ClaimProofStage_value) - proto.RegisterType((*Proof)(nil), "poktroll.proof.Proof") - proto.RegisterType((*Claim)(nil), "poktroll.proof.Claim") -} - -func init() { proto.RegisterFile("poktroll/proof/types.proto", fileDescriptor_b75ef15dfd4d6998) } - -var fileDescriptor_b75ef15dfd4d6998 = []byte{ - // 452 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xb3, 0xa9, 0x5a, 0xc8, 0xb6, 0x29, 0x66, 0x15, 0x41, 0x1a, 0x90, 0x89, 0x7a, 0x8a, - 0x2a, 0xd5, 0x46, 0xf0, 0x04, 0xf9, 0x63, 0x14, 0x4b, 0x6e, 0x1d, 0xd6, 0x06, 0x21, 0x2e, 0x96, - 0x9b, 0x2c, 0xb6, 0x15, 0xdb, 0x63, 0x76, 0x37, 0x02, 0xde, 0x82, 0x87, 0xe1, 0x09, 0x38, 0x71, - 0xac, 0xb8, 0xd0, 0x23, 0x72, 0x5e, 0x04, 0x79, 0xed, 0x46, 0x79, 0x04, 0x4e, 0xf6, 0xcc, 0x6f, - 0xe6, 0x9b, 0xfd, 0x46, 0x83, 0x07, 0x05, 0xac, 0x25, 0x87, 0x34, 0x35, 0x0b, 0x0e, 0xf0, 0xc9, - 0x94, 0xdf, 0x0a, 0x26, 0x8c, 0x82, 0x83, 0x04, 0x72, 0x7a, 0xcf, 0x0c, 0xc5, 0x06, 0x67, 0x4b, - 0x10, 0x19, 0x88, 0x40, 0x51, 0xb3, 0x0e, 0xea, 0xd2, 0xc1, 0xf3, 0x9d, 0x8c, 0x60, 0x42, 0x24, - 0x90, 0xef, 0x0b, 0x0d, 0x7a, 0x11, 0x44, 0x50, 0x77, 0x55, 0x7f, 0x75, 0xf6, 0xfc, 0x0f, 0xc2, - 0x87, 0x8b, 0x4a, 0x98, 0xf8, 0xf8, 0x4c, 0x6c, 0x8a, 0x22, 0x4d, 0x18, 0x0f, 0xa0, 0x60, 0x3c, - 0x94, 0xc0, 0x83, 0x70, 0xb5, 0xe2, 0x4c, 0x88, 0x3e, 0x1a, 0xa2, 0x51, 0x67, 0xd2, 0xff, 0xfd, - 0xe3, 0xb2, 0xd7, 0x8c, 0x1c, 0xd7, 0xc4, 0x93, 0x3c, 0xc9, 0x23, 0xfa, 0xf4, 0xbe, 0xd5, 0x6d, - 0x3a, 0x1b, 0x4c, 0xde, 0xe0, 0xd3, 0xe6, 0x31, 0x41, 0xcc, 0xc2, 0x15, 0xe3, 0xfd, 0xf6, 0x10, - 0x8d, 0x8e, 0x5f, 0xbd, 0x30, 0x76, 0xbe, 0x1a, 0x6e, 0x78, 0xf5, 0x77, 0xae, 0xca, 0x68, 0x57, - 0xec, 0x87, 0xe4, 0x25, 0xee, 0x2d, 0x53, 0x10, 0x4c, 0xc8, 0x20, 0x63, 0x7c, 0x9d, 0xb2, 0x40, - 0xad, 0xa3, 0x7f, 0x30, 0x44, 0xa3, 0x13, 0x4a, 0x1a, 0x76, 0xa5, 0x90, 0xf2, 0x73, 0xfe, 0x13, - 0xe1, 0xc3, 0x69, 0x1a, 0x26, 0xd9, 0x7f, 0xee, 0xec, 0x19, 0xee, 0x70, 0x00, 0x19, 0xc4, 0xa1, - 0x88, 0x1b, 0x3b, 0x0f, 0xab, 0xc4, 0x3c, 0x14, 0xf1, 0x85, 0x83, 0x9f, 0x28, 0x37, 0x94, 0x7d, - 0xde, 0x24, 0x9c, 0x65, 0x2c, 0x97, 0x94, 0x85, 0x02, 0x72, 0xa2, 0xe1, 0x93, 0x6b, 0xd7, 0x0f, - 0xa8, 0xf5, 0xf6, 0x9d, 0x4d, 0xad, 0x99, 0xd6, 0x22, 0x8f, 0x71, 0x77, 0x41, 0xdd, 0xc9, 0x78, - 0x62, 0x3b, 0xb6, 0xe7, 0xdb, 0x53, 0x0d, 0x91, 0x2e, 0xee, 0xf8, 0x73, 0x6a, 0x79, 0x73, 0xd7, - 0x99, 0x69, 0xed, 0x8b, 0x19, 0x7e, 0xa4, 0x36, 0xa2, 0x24, 0x3d, 0x19, 0x46, 0x8c, 0x1c, 0xe3, - 0x07, 0x53, 0x67, 0x6c, 0x5f, 0x29, 0x05, 0x8c, 0x8f, 0x16, 0xd4, 0x7d, 0x6f, 0x5d, 0x6b, 0xa8, - 0x02, 0x9e, 0xe5, 0xfb, 0x8e, 0x35, 0xd3, 0xda, 0x55, 0x60, 0x7d, 0x58, 0xa8, 0x39, 0x07, 0x13, - 0xe7, 0x57, 0xa9, 0xa3, 0xdb, 0x52, 0x47, 0x77, 0xa5, 0x8e, 0xfe, 0x96, 0x3a, 0xfa, 0xbe, 0xd5, - 0x5b, 0xb7, 0x5b, 0xbd, 0x75, 0xb7, 0xd5, 0x5b, 0x1f, 0x8d, 0x28, 0x91, 0xf1, 0xe6, 0xc6, 0x58, - 0x42, 0x66, 0x56, 0x8b, 0xb8, 0xcc, 0x99, 0xfc, 0x02, 0x7c, 0x6d, 0xee, 0x8e, 0xf3, 0xeb, 0xfe, - 0x95, 0xdf, 0x1c, 0xa9, 0x3b, 0x7c, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x74, 0x9b, 0x7a, 0x80, - 0x04, 0x03, 0x00, 0x00, -} - -func (m *Proof) 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 *Proof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ClosestMerkleProof) > 0 { - i -= len(m.ClosestMerkleProof) - copy(dAtA[i:], m.ClosestMerkleProof) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ClosestMerkleProof))) - i-- - dAtA[i] = 0x1a - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Claim) 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 *Claim) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RootHash) > 0 { - i -= len(m.RootHash) - copy(dAtA[i:], m.RootHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RootHash))) - i-- - dAtA[i] = 0x1a - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Proof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ClosestMerkleProof) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Claim) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.RootHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Proof) 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 ErrIntOverflowTypes - } - 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: Proof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClosestMerkleProof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClosestMerkleProof = append(m.ClosestMerkleProof[:0], dAtA[iNdEx:postIndex]...) - if m.ClosestMerkleProof == nil { - m.ClosestMerkleProof = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Claim) 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 ErrIntOverflowTypes - } - 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: Claim: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) - if m.RootHash == nil { - m.RootHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/service/types/genesis.pb.go b/x/service/types/genesis.pb.go deleted file mode 100644 index 1385a8f50..000000000 --- a/x/service/types/genesis.pb.go +++ /dev/null @@ -1,386 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/service/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/shared/types" - 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 - -// GenesisState defines the service module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ServiceList []types.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_b6c2ff81e712a1a4, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetServiceList() []types.Service { - if m != nil { - return m.ServiceList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.service.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/service/genesis.proto", fileDescriptor_b6c2ff81e712a1a4) } - -var fileDescriptor_b6c2ff81e712a1a4 = []byte{ - // 263 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x4f, 0x4f, 0xcd, - 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, - 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, - 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, - 0xcc, 0x2d, 0xc6, 0x94, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0xa9, 0x82, 0x48, 0x2b, 0xf5, 0x31, - 0x72, 0xf1, 0xb8, 0x43, 0x9c, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcd, 0xc5, 0x06, 0xd1, - 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0xee, 0x34, 0xbd, 0x00, 0xb0, 0xbc, - 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0x6a, 0x11, 0x72, - 0xe4, 0xe2, 0x81, 0x2a, 0x8a, 0xcf, 0xc9, 0x2c, 0x2e, 0x91, 0x60, 0x52, 0x60, 0x46, 0x33, 0x02, - 0xec, 0x06, 0xbd, 0x60, 0x88, 0x22, 0x27, 0x16, 0x90, 0x11, 0x41, 0xdc, 0x50, 0x3d, 0x3e, 0x99, - 0xc5, 0x25, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, - 0x50, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0xb8, 0x2f, 0x2b, 0xe0, 0xc1, 0x50, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xa7, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xcb, - 0x1e, 0x0f, 0xf5, 0x82, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServiceList) > 0 { - for iNdEx := len(m.ServiceList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ServiceList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.ServiceList) > 0 { - for _, e := range m.ServiceList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceList", 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.ServiceList = append(m.ServiceList, types.Service{}) - if err := m.ServiceList[len(m.ServiceList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/service/types/params.pb.go b/x/service/types/params.pb.go deleted file mode 100644 index 8a12bc9f0..000000000 --- a/x/service/types/params.pb.go +++ /dev/null @@ -1,358 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/service/params.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { - // The amount of uPOKT required to add a new service. - // This will be deducted from the signer's account balance, - // and transferred to the pocket network foundation. - AddServiceFee *types.Coin `protobuf:"bytes,1,opt,name=add_service_fee,json=addServiceFee,proto3" json:"add_service_fee" yaml:"add_service_fee"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_69b5d0104478b383, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetAddServiceFee() *types.Coin { - if m != nil { - return m.AddServiceFee - } - return nil -} - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.service.Params") -} - -func init() { proto.RegisterFile("poktroll/service/params.proto", fileDescriptor_69b5d0104478b383) } - -var fileDescriptor_69b5d0104478b383 = []byte{ - // 277 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x48, 0x2c, - 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, - 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, - 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, - 0x93, 0x12, 0x8b, 0x53, 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, 0x12, 0x0d, 0xf5, 0x93, 0xf3, 0x33, - 0xf3, 0x20, 0xf2, 0x4a, 0xf3, 0x18, 0xb9, 0xd8, 0x02, 0xc0, 0x76, 0x09, 0x15, 0x70, 0xf1, 0x27, - 0xa6, 0xa4, 0xc4, 0x43, 0xad, 0x88, 0x4f, 0x4b, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, - 0x92, 0xd4, 0x83, 0x18, 0xa2, 0x07, 0x32, 0x44, 0x0f, 0x6a, 0x88, 0x9e, 0x73, 0x7e, 0x66, 0x9e, - 0x93, 0xee, 0xab, 0x7b, 0xf2, 0xe8, 0xba, 0x3e, 0xdd, 0x93, 0x17, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, - 0x52, 0x42, 0x93, 0x50, 0x0a, 0xe2, 0x4d, 0x4c, 0x49, 0x09, 0x86, 0x08, 0xb8, 0xa5, 0xa6, 0x5a, - 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xff, 0x15, 0xf0, 0x10, - 0x80, 0xb8, 0xca, 0xc9, 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, - 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, - 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, - 0x99, 0xa1, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0xc5, 0xc0, 0x92, 0xca, 0x82, - 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xbf, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x60, 0xd1, - 0x42, 0x73, 0x01, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.AddServiceFee.Equal(that1.AddServiceFee) { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AddServiceFee != nil { - { - size, err := m.AddServiceFee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AddServiceFee != nil { - l = m.AddServiceFee.Size() - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddServiceFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AddServiceFee == nil { - m.AddServiceFee = &types.Coin{} - } - if err := m.AddServiceFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/service/types/query.pb.go b/x/service/types/query.pb.go deleted file mode 100644 index 15c598d4e..000000000 --- a/x/service/types/query.pb.go +++ /dev/null @@ -1,1366 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/service/query.proto - -package types - -import ( - context "context" - fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/shared/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetServiceRequest struct { - // TODO_IMPROVE: We could support getting services by name. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryGetServiceRequest) Reset() { *m = QueryGetServiceRequest{} } -func (m *QueryGetServiceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetServiceRequest) ProtoMessage() {} -func (*QueryGetServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{2} -} -func (m *QueryGetServiceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetServiceRequest.Merge(m, src) -} -func (m *QueryGetServiceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetServiceRequest proto.InternalMessageInfo - -func (m *QueryGetServiceRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -type QueryGetServiceResponse struct { - Service types.Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service"` -} - -func (m *QueryGetServiceResponse) Reset() { *m = QueryGetServiceResponse{} } -func (m *QueryGetServiceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetServiceResponse) ProtoMessage() {} -func (*QueryGetServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{3} -} -func (m *QueryGetServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetServiceResponse.Merge(m, src) -} -func (m *QueryGetServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetServiceResponse proto.InternalMessageInfo - -func (m *QueryGetServiceResponse) GetService() types.Service { - if m != nil { - return m.Service - } - return types.Service{} -} - -type QueryAllServicesRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllServicesRequest) Reset() { *m = QueryAllServicesRequest{} } -func (m *QueryAllServicesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllServicesRequest) ProtoMessage() {} -func (*QueryAllServicesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{4} -} -func (m *QueryAllServicesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllServicesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllServicesRequest.Merge(m, src) -} -func (m *QueryAllServicesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllServicesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllServicesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllServicesRequest proto.InternalMessageInfo - -func (m *QueryAllServicesRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllServicesResponse struct { - Service []types.Service `protobuf:"bytes,1,rep,name=service,proto3" json:"service"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllServicesResponse) Reset() { *m = QueryAllServicesResponse{} } -func (m *QueryAllServicesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllServicesResponse) ProtoMessage() {} -func (*QueryAllServicesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cc8a7bc9eee3e426, []int{5} -} -func (m *QueryAllServicesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllServicesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllServicesResponse.Merge(m, src) -} -func (m *QueryAllServicesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllServicesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllServicesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllServicesResponse proto.InternalMessageInfo - -func (m *QueryAllServicesResponse) GetService() []types.Service { - if m != nil { - return m.Service - } - return nil -} - -func (m *QueryAllServicesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.service.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.service.QueryParamsResponse") - proto.RegisterType((*QueryGetServiceRequest)(nil), "poktroll.service.QueryGetServiceRequest") - proto.RegisterType((*QueryGetServiceResponse)(nil), "poktroll.service.QueryGetServiceResponse") - proto.RegisterType((*QueryAllServicesRequest)(nil), "poktroll.service.QueryAllServicesRequest") - proto.RegisterType((*QueryAllServicesResponse)(nil), "poktroll.service.QueryAllServicesResponse") -} - -func init() { proto.RegisterFile("poktroll/service/query.proto", fileDescriptor_cc8a7bc9eee3e426) } - -var fileDescriptor_cc8a7bc9eee3e426 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x29, 0xa4, 0xea, 0x55, 0x42, 0x70, 0x54, 0x10, 0x59, 0xc5, 0x20, 0x8b, 0xb6, - 0x21, 0x28, 0x77, 0xb4, 0x5d, 0x90, 0x98, 0xc8, 0x40, 0x37, 0x54, 0xdc, 0x8d, 0xed, 0x92, 0x9c, - 0xdc, 0x53, 0x1d, 0x9f, 0xeb, 0xbb, 0x14, 0x2a, 0xc4, 0x82, 0xf8, 0x00, 0x48, 0x65, 0x65, 0x67, - 0x64, 0xe7, 0x0b, 0x74, 0xac, 0xc4, 0xd2, 0x09, 0xa1, 0x04, 0x89, 0xaf, 0x81, 0x7c, 0xf7, 0x0c, - 0x29, 0xae, 0x95, 0xb0, 0x24, 0x96, 0xdf, 0xff, 0xfd, 0xff, 0xbf, 0xbb, 0xf7, 0x64, 0xbc, 0x9a, - 0xaa, 0x03, 0x93, 0xa9, 0x38, 0x66, 0x5a, 0x64, 0x47, 0xb2, 0x2f, 0xd8, 0xe1, 0x48, 0x64, 0xc7, - 0x34, 0xcd, 0x94, 0x51, 0xe4, 0x7a, 0x51, 0xa5, 0x50, 0xf5, 0x6e, 0xf0, 0xa1, 0x4c, 0x14, 0xb3, - 0xbf, 0x4e, 0xe4, 0xad, 0x44, 0x2a, 0x52, 0xf6, 0x91, 0xe5, 0x4f, 0xf0, 0x76, 0x35, 0x52, 0x2a, - 0x8a, 0x05, 0xe3, 0xa9, 0x64, 0x3c, 0x49, 0x94, 0xe1, 0x46, 0xaa, 0x44, 0x43, 0xb5, 0xdd, 0x57, - 0x7a, 0xa8, 0x34, 0xeb, 0x71, 0x0d, 0x89, 0xec, 0x68, 0xb3, 0x27, 0x0c, 0xdf, 0x64, 0x29, 0x8f, - 0x64, 0x62, 0xc5, 0xa0, 0xbd, 0x53, 0x42, 0x4c, 0x79, 0xc6, 0x87, 0xba, 0x5c, 0xde, 0xe7, 0x99, - 0x18, 0x14, 0x2a, 0x57, 0x0e, 0x56, 0x30, 0x79, 0x91, 0xfb, 0xef, 0xda, 0x9e, 0x50, 0x1c, 0x8e, - 0x84, 0x36, 0x41, 0x88, 0x6f, 0x5e, 0x78, 0xab, 0x53, 0x95, 0x68, 0x41, 0x9e, 0xe0, 0x86, 0xf3, - 0x6e, 0xa2, 0x7b, 0xa8, 0xb5, 0xbc, 0xd5, 0xa4, 0xff, 0x5e, 0x00, 0x75, 0x1d, 0xdd, 0xa5, 0xd3, - 0xef, 0x77, 0x6b, 0x9f, 0x7f, 0x7d, 0x69, 0xa3, 0x10, 0x5a, 0x82, 0x16, 0xbe, 0x65, 0x3d, 0x77, - 0x84, 0xd9, 0x73, 0x62, 0x48, 0x23, 0xd7, 0x70, 0x5d, 0x0e, 0xac, 0xe5, 0x52, 0x58, 0x97, 0x83, - 0x60, 0x0f, 0xdf, 0x2e, 0x29, 0x81, 0xe0, 0x31, 0x5e, 0x84, 0xa4, 0x4b, 0x10, 0xec, 0xf9, 0x28, - 0xb4, 0x74, 0xaf, 0xe4, 0x08, 0x61, 0x21, 0x0f, 0x38, 0x98, 0x3e, 0x8d, 0x63, 0x50, 0x14, 0xa7, - 0x25, 0xcf, 0x30, 0xfe, 0x7b, 0xab, 0xe0, 0xbb, 0x4e, 0xdd, 0x08, 0x68, 0x3e, 0x02, 0xea, 0x86, - 0x0e, 0x23, 0xa0, 0xbb, 0x3c, 0x2a, 0xd8, 0xc3, 0xa9, 0xce, 0xe0, 0x13, 0xc2, 0xcd, 0x72, 0xc6, - 0x65, 0xe4, 0x0b, 0xff, 0x41, 0x4e, 0x76, 0x2e, 0xe0, 0xd5, 0x2d, 0xde, 0xc6, 0x4c, 0x3c, 0x17, - 0x3b, 0xcd, 0xb7, 0xf5, 0x75, 0x01, 0x5f, 0xb5, 0x7c, 0xe4, 0x3d, 0xc2, 0x0d, 0x37, 0x29, 0x72, - 0xbf, 0x3c, 0xc3, 0xf2, 0x42, 0x78, 0x6b, 0x33, 0x54, 0x2e, 0x2d, 0xe8, 0xbc, 0xfb, 0xf6, 0xf3, - 0xa4, 0xbe, 0x41, 0xd6, 0x58, 0x2e, 0xef, 0x24, 0xc2, 0xbc, 0x52, 0xd9, 0x01, 0xab, 0xd8, 0x50, - 0x72, 0x82, 0xf0, 0x22, 0x1c, 0x9a, 0xb4, 0x2a, 0x12, 0x4a, 0xeb, 0xe2, 0x3d, 0x98, 0x43, 0x09, - 0x3c, 0xdb, 0x96, 0xa7, 0x43, 0x1e, 0xce, 0xe0, 0x29, 0xfe, 0xdf, 0xc8, 0xc1, 0x5b, 0xf2, 0x11, - 0xe1, 0xe5, 0xa9, 0x09, 0x92, 0xaa, 0xbc, 0xf2, 0x26, 0x79, 0xed, 0x79, 0xa4, 0xc0, 0x46, 0x2d, - 0x5b, 0x8b, 0xac, 0xcf, 0xc7, 0xd6, 0x7d, 0x7e, 0x3a, 0xf6, 0xd1, 0xd9, 0xd8, 0x47, 0xe7, 0x63, - 0x1f, 0xfd, 0x18, 0xfb, 0xe8, 0xc3, 0xc4, 0xaf, 0x9d, 0x4d, 0xfc, 0xda, 0xf9, 0xc4, 0xaf, 0xbd, - 0x7c, 0x14, 0x49, 0xb3, 0x3f, 0xea, 0xd1, 0xbe, 0x1a, 0x56, 0xf8, 0xbd, 0xfe, 0xe3, 0x68, 0x8e, - 0x53, 0xa1, 0x7b, 0x0d, 0xfb, 0x01, 0xd8, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x22, 0x58, 0x15, - 0xda, 0xe3, 0x04, 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 Service items. - Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) - AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.service.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) { - out := new(QueryGetServiceResponse) - err := c.cc.Invoke(ctx, "/poktroll.service.Query/Service", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) { - out := new(QueryAllServicesResponse) - err := c.cc.Invoke(ctx, "/poktroll.service.Query/AllServices", in, out, opts...) - 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 Service items. - Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) - AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, 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) Service(ctx context.Context, req *QueryGetServiceRequest) (*QueryGetServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") -} -func (*UnimplementedQueryServer) AllServices(ctx context.Context, req *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.service.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 _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Service(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.service.Query/Service", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Service(ctx, req.(*QueryGetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.service.Query/AllServices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllServices(ctx, req.(*QueryAllServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.service.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Service", - Handler: _Query_Service_Handler, - }, - { - MethodName: "AllServices", - Handler: _Query_AllServices_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/service/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetServiceRequest) 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 *QueryGetServiceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetServiceResponse) 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 *QueryGetServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Service.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 *QueryAllServicesRequest) 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 *QueryAllServicesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllServicesRequest) 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 *QueryAllServicesResponse) 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 *QueryAllServicesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllServicesResponse) 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.Service) > 0 { - for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Service[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 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 *QueryGetServiceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Service.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllServicesRequest) 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 *QueryAllServicesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Service) > 0 { - for _, e := range m.Service { - 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 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 *QueryGetServiceRequest) 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: QueryGetServiceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", 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.Id = 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 *QueryGetServiceResponse) 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: QueryGetServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service.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 *QueryAllServicesRequest) 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: QueryAllServicesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllServicesRequest: 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllServicesResponse) 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: QueryAllServicesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service = append(m.Service, types.Service{}) - if err := m.Service[len(m.Service)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/service/types/query.pb.gw.go b/x/service/types/query.pb.gw.go deleted file mode 100644 index 621e80775..000000000 --- a/x/service/types/query.pb.gw.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/service/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetServiceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetServiceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.Service(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllServices_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllServices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllServicesRequest - 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_AllServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllServices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllServicesRequest - 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_AllServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllServices(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Service_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_Service_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_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllServices_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_AllServices_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_AllServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Service_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_Service_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_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllServices_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_AllServices_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_AllServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "service", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "service", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "service"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Service_0 = runtime.ForwardResponseMessage - - forward_Query_AllServices_0 = runtime.ForwardResponseMessage -) diff --git a/x/service/types/relay.pb.go b/x/service/types/relay.pb.go deleted file mode 100644 index 305ff1de7..000000000 --- a/x/service/types/relay.pb.go +++ /dev/null @@ -1,1370 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/service/relay.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/session/types" - 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 - -// Relay contains both the RelayRequest (signed by the Application) and the RelayResponse (signed by the Supplier). -// The serialized tuple is inserted into the SMST leaves as values in the Claim/Proof lifecycle. -type Relay struct { - Req *RelayRequest `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` - Res *RelayResponse `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` -} - -func (m *Relay) Reset() { *m = Relay{} } -func (m *Relay) String() string { return proto.CompactTextString(m) } -func (*Relay) ProtoMessage() {} -func (*Relay) Descriptor() ([]byte, []int) { - return fileDescriptor_38cf3e40553b40a1, []int{0} -} -func (m *Relay) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Relay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Relay) XXX_Merge(src proto.Message) { - xxx_messageInfo_Relay.Merge(m, src) -} -func (m *Relay) XXX_Size() int { - return m.Size() -} -func (m *Relay) XXX_DiscardUnknown() { - xxx_messageInfo_Relay.DiscardUnknown(m) -} - -var xxx_messageInfo_Relay proto.InternalMessageInfo - -func (m *Relay) GetReq() *RelayRequest { - if m != nil { - return m.Req - } - return nil -} - -func (m *Relay) GetRes() *RelayResponse { - if m != nil { - return m.Res - } - return nil -} - -// RelayRequestMetadata contains the metadata for a RelayRequest. -type RelayRequestMetadata struct { - SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - // The request signature is a serialized ring signature that may have been - // by either the application itself or one of the gateways that the - // application has delegated to. The signature is made using the ring of the - // application in both cases. - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). - // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 - // - // The supplier operator address the relay is sent to. It is being used on the - // RelayMiner to route to the correct supplier. - SupplierOperatorAddress string `protobuf:"bytes,3,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` -} - -func (m *RelayRequestMetadata) Reset() { *m = RelayRequestMetadata{} } -func (m *RelayRequestMetadata) String() string { return proto.CompactTextString(m) } -func (*RelayRequestMetadata) ProtoMessage() {} -func (*RelayRequestMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_38cf3e40553b40a1, []int{1} -} -func (m *RelayRequestMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RelayRequestMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *RelayRequestMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_RelayRequestMetadata.Merge(m, src) -} -func (m *RelayRequestMetadata) XXX_Size() int { - return m.Size() -} -func (m *RelayRequestMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_RelayRequestMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_RelayRequestMetadata proto.InternalMessageInfo - -func (m *RelayRequestMetadata) GetSessionHeader() *types.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *RelayRequestMetadata) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *RelayRequestMetadata) GetSupplierOperatorAddress() string { - if m != nil { - return m.SupplierOperatorAddress - } - return "" -} - -// RelayRequest holds the request details for a relay. -type RelayRequest struct { - Meta RelayRequestMetadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` - // payload is the serialized payload for the request. - // The payload is passed directly to the service and as such can be any - // format that the service supports: JSON-RPC, REST, gRPC, etc. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *RelayRequest) Reset() { *m = RelayRequest{} } -func (m *RelayRequest) String() string { return proto.CompactTextString(m) } -func (*RelayRequest) ProtoMessage() {} -func (*RelayRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_38cf3e40553b40a1, []int{2} -} -func (m *RelayRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RelayRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *RelayRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RelayRequest.Merge(m, src) -} -func (m *RelayRequest) XXX_Size() int { - return m.Size() -} -func (m *RelayRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RelayRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RelayRequest proto.InternalMessageInfo - -func (m *RelayRequest) GetMeta() RelayRequestMetadata { - if m != nil { - return m.Meta - } - return RelayRequestMetadata{} -} - -func (m *RelayRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// RelayResponse contains the response details for a RelayRequest. -type RelayResponse struct { - Meta RelayResponseMetadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` - // payload is the serialized payload for the response. - // The payload is passed directly from the service and as such can be any - // format the service responds with: JSON-RPC, REST, gRPC, etc. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *RelayResponse) Reset() { *m = RelayResponse{} } -func (m *RelayResponse) String() string { return proto.CompactTextString(m) } -func (*RelayResponse) ProtoMessage() {} -func (*RelayResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_38cf3e40553b40a1, []int{3} -} -func (m *RelayResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RelayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *RelayResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RelayResponse.Merge(m, src) -} -func (m *RelayResponse) XXX_Size() int { - return m.Size() -} -func (m *RelayResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RelayResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RelayResponse proto.InternalMessageInfo - -func (m *RelayResponse) GetMeta() RelayResponseMetadata { - if m != nil { - return m.Meta - } - return RelayResponseMetadata{} -} - -func (m *RelayResponse) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// RelayResponseMetadata contains the metadata for a RelayResponse. -type RelayResponseMetadata struct { - SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - SupplierOperatorSignature []byte `protobuf:"bytes,2,opt,name=supplier_operator_signature,json=supplierOperatorSignature,proto3" json:"supplier_operator_signature,omitempty"` -} - -func (m *RelayResponseMetadata) Reset() { *m = RelayResponseMetadata{} } -func (m *RelayResponseMetadata) String() string { return proto.CompactTextString(m) } -func (*RelayResponseMetadata) ProtoMessage() {} -func (*RelayResponseMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_38cf3e40553b40a1, []int{4} -} -func (m *RelayResponseMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RelayResponseMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *RelayResponseMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_RelayResponseMetadata.Merge(m, src) -} -func (m *RelayResponseMetadata) XXX_Size() int { - return m.Size() -} -func (m *RelayResponseMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_RelayResponseMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_RelayResponseMetadata proto.InternalMessageInfo - -func (m *RelayResponseMetadata) GetSessionHeader() *types.SessionHeader { - if m != nil { - return m.SessionHeader - } - return nil -} - -func (m *RelayResponseMetadata) GetSupplierOperatorSignature() []byte { - if m != nil { - return m.SupplierOperatorSignature - } - return nil -} - -func init() { - proto.RegisterType((*Relay)(nil), "poktroll.service.Relay") - proto.RegisterType((*RelayRequestMetadata)(nil), "poktroll.service.RelayRequestMetadata") - proto.RegisterType((*RelayRequest)(nil), "poktroll.service.RelayRequest") - proto.RegisterType((*RelayResponse)(nil), "poktroll.service.RelayResponse") - proto.RegisterType((*RelayResponseMetadata)(nil), "poktroll.service.RelayResponseMetadata") -} - -func init() { proto.RegisterFile("poktroll/service/relay.proto", fileDescriptor_38cf3e40553b40a1) } - -var fileDescriptor_38cf3e40553b40a1 = []byte{ - // 435 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xf6, 0xd2, 0x02, 0xea, 0xd2, 0x22, 0xb4, 0x0a, 0xc2, 0x29, 0xd5, 0xb6, 0xf2, 0x01, 0x7a, - 0xa9, 0x5d, 0xe0, 0x8e, 0x68, 0x0e, 0x88, 0x0b, 0x20, 0x39, 0x9c, 0xb8, 0x58, 0x9b, 0x78, 0xe4, - 0x98, 0x38, 0xde, 0xcd, 0xee, 0x1a, 0xc8, 0x5b, 0xf0, 0x06, 0xbc, 0x04, 0x0f, 0x91, 0x63, 0x94, - 0x53, 0x4e, 0x08, 0x39, 0x2f, 0x82, 0xbc, 0x5e, 0x07, 0x27, 0xfc, 0x09, 0x89, 0x93, 0x3d, 0xf3, - 0xcd, 0xb7, 0xdf, 0xcc, 0x37, 0x1a, 0x7c, 0x22, 0xf8, 0x58, 0x4b, 0x9e, 0x65, 0x81, 0x02, 0xf9, - 0x3e, 0x1d, 0x42, 0x20, 0x21, 0x63, 0x33, 0x5f, 0x48, 0xae, 0x39, 0xb9, 0xd3, 0xa0, 0xbe, 0x45, - 0x8f, 0xbb, 0x43, 0xae, 0x26, 0x5c, 0x45, 0x06, 0x0f, 0xea, 0xa0, 0x2e, 0x3e, 0xee, 0x24, 0x3c, - 0xe1, 0x75, 0xbe, 0xfa, 0xb3, 0xd9, 0xb6, 0x80, 0x52, 0x29, 0xcf, 0x03, 0x3d, 0x13, 0x60, 0x39, - 0x5e, 0x86, 0xaf, 0x87, 0x95, 0x1e, 0xb9, 0xc4, 0x7b, 0x12, 0xa6, 0x2e, 0x3a, 0x43, 0xe7, 0xb7, - 0x1e, 0x53, 0x7f, 0x57, 0xd7, 0x37, 0x55, 0x21, 0x4c, 0x0b, 0x50, 0x3a, 0xac, 0x4a, 0xc9, 0xa3, - 0x8a, 0xa1, 0xdc, 0x6b, 0x86, 0x71, 0xfa, 0x5b, 0x86, 0x12, 0x3c, 0x57, 0x50, 0x51, 0x94, 0xb7, - 0x44, 0xb8, 0xd3, 0x7e, 0xe8, 0x25, 0x68, 0x16, 0x33, 0xcd, 0xc8, 0x73, 0x7c, 0xdb, 0x76, 0x17, - 0x8d, 0x80, 0xc5, 0x20, 0x6d, 0x23, 0x5b, 0xcf, 0x1a, 0xdc, 0xef, 0xd7, 0xdf, 0x17, 0xa6, 0x2c, - 0x3c, 0x52, 0xed, 0x90, 0x9c, 0xe0, 0x03, 0x95, 0x26, 0x39, 0xd3, 0x85, 0x04, 0xd3, 0xd9, 0x61, - 0xf8, 0x23, 0x41, 0xde, 0xe0, 0xae, 0x2a, 0x84, 0xc8, 0x52, 0x90, 0x11, 0x17, 0x20, 0x99, 0xe6, - 0x32, 0x62, 0x71, 0x2c, 0x41, 0x29, 0x77, 0xef, 0x0c, 0x9d, 0x1f, 0xf4, 0xdc, 0xe5, 0x97, 0x8b, - 0x8e, 0x75, 0xf5, 0xaa, 0x46, 0xfa, 0x5a, 0xa6, 0x79, 0x12, 0xde, 0x6b, 0xa8, 0xaf, 0x2d, 0xd3, - 0xc2, 0xde, 0x3b, 0x7c, 0xd8, 0x9e, 0x89, 0x3c, 0xc3, 0xfb, 0x13, 0xd0, 0xcc, 0x4e, 0xf0, 0xe0, - 0xcf, 0x56, 0x36, 0x0e, 0xf4, 0xf6, 0xe7, 0x5f, 0x4f, 0x9d, 0xd0, 0x30, 0x89, 0x8b, 0x6f, 0x0a, - 0x36, 0xcb, 0x38, 0x8b, 0xed, 0x0c, 0x4d, 0xe8, 0x65, 0xf8, 0x68, 0xcb, 0x56, 0x72, 0xb5, 0x25, - 0xf6, 0xf0, 0x2f, 0x5b, 0xf8, 0x47, 0xb5, 0xcf, 0x08, 0xdf, 0xfd, 0x25, 0xff, 0xbf, 0xed, 0xeb, - 0x29, 0xbe, 0xff, 0xf3, 0x46, 0x76, 0x37, 0xd8, 0xdd, 0x75, 0xbe, 0xdf, 0x14, 0xf4, 0x5e, 0xcd, - 0x4b, 0x8a, 0x16, 0x25, 0x45, 0xab, 0x92, 0xa2, 0x6f, 0x25, 0x45, 0x9f, 0xd6, 0xd4, 0x59, 0xac, - 0xa9, 0xb3, 0x5a, 0x53, 0xe7, 0xed, 0x65, 0x92, 0xea, 0x51, 0x31, 0xf0, 0x87, 0x7c, 0x12, 0x54, - 0x7d, 0x5d, 0xe4, 0xa0, 0x3f, 0x70, 0x39, 0x0e, 0x36, 0x27, 0xf1, 0x71, 0x73, 0x75, 0xe6, 0x28, - 0x06, 0x37, 0xcc, 0x55, 0x3c, 0xf9, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x43, 0xeb, 0x94, 0x5b, 0x96, - 0x03, 0x00, 0x00, -} - -func (m *Relay) 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 *Relay) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Relay) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Res != nil { - { - size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Req != nil { - { - size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RelayRequestMetadata) 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 *RelayRequestMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RelayRequestMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SupplierOperatorAddress) > 0 { - i -= len(m.SupplierOperatorAddress) - copy(dAtA[i:], m.SupplierOperatorAddress) - i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintRelay(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x12 - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RelayRequest) 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 *RelayRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RelayRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintRelay(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *RelayResponse) 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 *RelayResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RelayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintRelay(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *RelayResponseMetadata) 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 *RelayResponseMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RelayResponseMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SupplierOperatorSignature) > 0 { - i -= len(m.SupplierOperatorSignature) - copy(dAtA[i:], m.SupplierOperatorSignature) - i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorSignature))) - i-- - dAtA[i] = 0x12 - } - if m.SessionHeader != nil { - { - size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRelay(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRelay(dAtA []byte, offset int, v uint64) int { - offset -= sovRelay(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Relay) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Req != nil { - l = m.Req.Size() - n += 1 + l + sovRelay(uint64(l)) - } - if m.Res != nil { - l = m.Res.Size() - n += 1 + l + sovRelay(uint64(l)) - } - return n -} - -func (m *RelayRequestMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovRelay(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovRelay(uint64(l)) - } - l = len(m.SupplierOperatorAddress) - if l > 0 { - n += 1 + l + sovRelay(uint64(l)) - } - return n -} - -func (m *RelayRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Meta.Size() - n += 1 + l + sovRelay(uint64(l)) - l = len(m.Payload) - if l > 0 { - n += 1 + l + sovRelay(uint64(l)) - } - return n -} - -func (m *RelayResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Meta.Size() - n += 1 + l + sovRelay(uint64(l)) - l = len(m.Payload) - if l > 0 { - n += 1 + l + sovRelay(uint64(l)) - } - return n -} - -func (m *RelayResponseMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SessionHeader != nil { - l = m.SessionHeader.Size() - n += 1 + l + sovRelay(uint64(l)) - } - l = len(m.SupplierOperatorSignature) - if l > 0 { - n += 1 + l + sovRelay(uint64(l)) - } - return n -} - -func sovRelay(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRelay(x uint64) (n int) { - return sovRelay(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Relay) 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 ErrIntOverflowRelay - } - 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: Relay: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Relay: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Req == nil { - m.Req = &RelayRequest{} - } - if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Res == nil { - m.Res = &RelayResponse{} - } - if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelay(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelay - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RelayRequestMetadata) 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 ErrIntOverflowRelay - } - 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: RelayRequestMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RelayRequestMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - 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 ErrInvalidLengthRelay - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelay(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelay - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RelayRequest) 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 ErrIntOverflowRelay - } - 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: RelayRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RelayRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelay(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelay - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RelayResponse) 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 ErrIntOverflowRelay - } - 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: RelayResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RelayResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelay(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelay - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RelayResponseMetadata) 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 ErrIntOverflowRelay - } - 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: RelayResponseMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RelayResponseMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SessionHeader == nil { - m.SessionHeader = &types.SessionHeader{} - } - if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorSignature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelay - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRelay - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRelay - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorSignature = append(m.SupplierOperatorSignature[:0], dAtA[iNdEx:postIndex]...) - if m.SupplierOperatorSignature == nil { - m.SupplierOperatorSignature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelay(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelay - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRelay(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, ErrIntOverflowRelay - } - 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, ErrIntOverflowRelay - } - 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, ErrIntOverflowRelay - } - 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, ErrInvalidLengthRelay - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRelay - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRelay - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRelay = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRelay = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRelay = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/service/types/tx.pb.go b/x/service/types/tx.pb.go deleted file mode 100644 index cbfd2f131..000000000 --- a/x/service/types/tx.pb.go +++ /dev/null @@ -1,1529 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/service/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/pokt-network/poktroll/x/shared/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/service parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. -type MsgUpdateParam struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // The (name, as_type) tuple must match the corresponding name and type as - // specified in the `Params` message in `proof/params.proto.` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to AsType: - // *MsgUpdateParam_AsCoin - AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` -} - -func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } -func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParam) ProtoMessage() {} -func (*MsgUpdateParam) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{2} -} -func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParam.Merge(m, src) -} -func (m *MsgUpdateParam) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParam) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo - -type isMsgUpdateParam_AsType interface { - isMsgUpdateParam_AsType() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgUpdateParam_AsCoin struct { - AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` -} - -func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} - -func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { - if m != nil { - return m.AsType - } - return nil -} - -func (m *MsgUpdateParam) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpdateParam) GetAsCoin() *types.Coin { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsCoin); ok { - return x.AsCoin - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgUpdateParam_AsCoin)(nil), - } -} - -// MsgUpdateParamResponse defines the response structure for executing a -// MsgUpdateParam message after a single param update. -type MsgUpdateParamResponse struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } -func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamResponse) ProtoMessage() {} -func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{3} -} -func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) -} -func (m *MsgUpdateParamResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo - -func (m *MsgUpdateParamResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -// MsgAddService defines a message for adding a new message to the network. -// Services can be added by any actor in the network making them truly -// permissionless. -// TODO_BETA: Add Champions / Sources once its fully defined. -type MsgAddService struct { - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - Service types1.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service"` -} - -func (m *MsgAddService) Reset() { *m = MsgAddService{} } -func (m *MsgAddService) String() string { return proto.CompactTextString(m) } -func (*MsgAddService) ProtoMessage() {} -func (*MsgAddService) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{4} -} -func (m *MsgAddService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAddService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgAddService) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddService.Merge(m, src) -} -func (m *MsgAddService) XXX_Size() int { - return m.Size() -} -func (m *MsgAddService) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddService.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddService proto.InternalMessageInfo - -func (m *MsgAddService) GetOwnerAddress() string { - if m != nil { - return m.OwnerAddress - } - return "" -} - -func (m *MsgAddService) GetService() types1.Service { - if m != nil { - return m.Service - } - return types1.Service{} -} - -type MsgAddServiceResponse struct { -} - -func (m *MsgAddServiceResponse) Reset() { *m = MsgAddServiceResponse{} } -func (m *MsgAddServiceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAddServiceResponse) ProtoMessage() {} -func (*MsgAddServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_31ba9559706e649e, []int{5} -} -func (m *MsgAddServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAddServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgAddServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddServiceResponse.Merge(m, src) -} -func (m *MsgAddServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAddServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddServiceResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.service.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.service.MsgUpdateParamsResponse") - proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.service.MsgUpdateParam") - proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.service.MsgUpdateParamResponse") - proto.RegisterType((*MsgAddService)(nil), "poktroll.service.MsgAddService") - proto.RegisterType((*MsgAddServiceResponse)(nil), "poktroll.service.MsgAddServiceResponse") -} - -func init() { proto.RegisterFile("poktroll/service/tx.proto", fileDescriptor_31ba9559706e649e) } - -var fileDescriptor_31ba9559706e649e = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xce, 0x95, 0x92, 0xca, 0x97, 0xb6, 0x80, 0x55, 0x48, 0x62, 0x09, 0x27, 0x78, 0x21, 0x44, - 0xaa, 0xdd, 0x14, 0x81, 0x50, 0x10, 0x43, 0xcc, 0x82, 0x90, 0x82, 0x90, 0x2b, 0x90, 0x40, 0x48, - 0xd1, 0x25, 0x3e, 0x39, 0x56, 0x6b, 0x9f, 0xe5, 0xbb, 0xa6, 0xed, 0x86, 0x18, 0x99, 0xf8, 0x03, - 0x60, 0x67, 0xcc, 0xc0, 0x84, 0xc4, 0xde, 0xb1, 0x62, 0xea, 0x54, 0xa1, 0x64, 0x88, 0xc4, 0x5f, - 0x81, 0x7c, 0x3e, 0x27, 0x75, 0x12, 0x61, 0xa9, 0x4b, 0x72, 0xf7, 0xbe, 0xef, 0xfd, 0xf8, 0xde, - 0x7b, 0x67, 0x58, 0x0e, 0xc8, 0x3e, 0x0b, 0xc9, 0xc1, 0x81, 0x41, 0x71, 0x38, 0x70, 0x7b, 0xd8, - 0x60, 0xc7, 0x7a, 0x10, 0x12, 0x46, 0xe4, 0x9b, 0x09, 0xa4, 0x0b, 0x48, 0xb9, 0x85, 0x3c, 0xd7, - 0x27, 0x06, 0xff, 0x8d, 0x49, 0x8a, 0xda, 0x23, 0xd4, 0x23, 0xd4, 0xe8, 0x22, 0x8a, 0x8d, 0x41, - 0xa3, 0x8b, 0x19, 0x6a, 0x18, 0x3d, 0xe2, 0xfa, 0x02, 0x2f, 0x0a, 0xdc, 0xa3, 0x8e, 0x31, 0x68, - 0x44, 0x7f, 0x02, 0x28, 0xc7, 0x40, 0x87, 0xdf, 0x8c, 0xf8, 0x22, 0xa0, 0x2d, 0x87, 0x38, 0x24, - 0xb6, 0x47, 0x27, 0x61, 0xbd, 0xbb, 0x50, 0x69, 0x80, 0x42, 0xe4, 0xd1, 0x45, 0xb8, 0x8f, 0x42, - 0x6c, 0x27, 0xac, 0x18, 0xd6, 0x7e, 0x01, 0x78, 0xa3, 0x4d, 0x9d, 0x37, 0x81, 0x8d, 0x18, 0x7e, - 0xcd, 0x1d, 0xe5, 0xc7, 0x50, 0x42, 0x87, 0xac, 0x4f, 0x42, 0x97, 0x9d, 0x94, 0x40, 0x15, 0xd4, - 0x24, 0xb3, 0xf4, 0xfb, 0xc7, 0xf6, 0x96, 0x28, 0xa6, 0x65, 0xdb, 0x21, 0xa6, 0x74, 0x8f, 0x85, - 0xae, 0xef, 0x58, 0x33, 0xaa, 0xfc, 0x14, 0xe6, 0xe3, 0xd4, 0xa5, 0x95, 0x2a, 0xa8, 0x15, 0x76, - 0x4b, 0xfa, 0x7c, 0xa7, 0xf4, 0x38, 0x83, 0x29, 0x9d, 0x5e, 0x54, 0x72, 0xdf, 0x27, 0xc3, 0x3a, - 0xb0, 0x84, 0x4b, 0xf3, 0xd1, 0xa7, 0xc9, 0xb0, 0x3e, 0x0b, 0xf6, 0x79, 0x32, 0xac, 0x6b, 0xd3, - 0xd2, 0x8f, 0xa7, 0xda, 0xe6, 0x6a, 0xd5, 0xca, 0xb0, 0x38, 0x67, 0xb2, 0x30, 0x0d, 0x88, 0x4f, - 0xb1, 0xf6, 0x13, 0xc0, 0xcd, 0x34, 0x76, 0x65, 0x65, 0x32, 0x5c, 0xf5, 0x91, 0x87, 0xb9, 0x2e, - 0xc9, 0xe2, 0x67, 0xb9, 0x05, 0xd7, 0x10, 0xed, 0x44, 0x23, 0x2d, 0x49, 0x5c, 0x6e, 0x59, 0x17, - 0x61, 0xa2, 0x99, 0xeb, 0x62, 0xe6, 0xfa, 0x73, 0xe2, 0xfa, 0x66, 0xe1, 0xef, 0x45, 0x25, 0x61, - 0xbf, 0xc8, 0x59, 0x79, 0x44, 0x23, 0x73, 0x73, 0x33, 0xad, 0xd9, 0x94, 0x78, 0x48, 0x76, 0x12, - 0x60, 0xed, 0x25, 0xbc, 0x93, 0xae, 0x3d, 0x91, 0x25, 0xef, 0x4c, 0xbb, 0x0c, 0xfe, 0xdf, 0xe5, - 0xa4, 0xb5, 0xda, 0x57, 0x00, 0x37, 0xda, 0xd4, 0x69, 0xd9, 0xf6, 0x5e, 0x4c, 0x90, 0x9f, 0xc1, - 0x0d, 0x72, 0xe4, 0xe3, 0xb0, 0x83, 0x62, 0xc5, 0x99, 0xbd, 0x58, 0xe7, 0x74, 0x61, 0x93, 0x9f, - 0xc0, 0x35, 0x91, 0x6a, 0xc9, 0xa4, 0xf9, 0x96, 0xe9, 0x22, 0x93, 0xb9, 0x1a, 0x4d, 0xda, 0x4a, - 0xe8, 0x4d, 0x39, 0x52, 0x9c, 0xce, 0xad, 0x15, 0xe1, 0xed, 0x54, 0x75, 0x89, 0xd2, 0xdd, 0x6f, - 0x2b, 0xf0, 0x5a, 0x9b, 0x3a, 0xf2, 0x07, 0xb8, 0x9e, 0xda, 0xcf, 0x7b, 0x8b, 0x8a, 0xe7, 0x76, - 0x40, 0x79, 0x90, 0x49, 0x99, 0xf6, 0xf3, 0x1d, 0x2c, 0x5c, 0x5e, 0x91, 0x6a, 0x96, 0xa7, 0x52, - 0xcb, 0x62, 0x4c, 0x43, 0xbf, 0x85, 0xf0, 0x52, 0xd3, 0x2b, 0x4b, 0xfd, 0x66, 0x04, 0xe5, 0x7e, - 0x06, 0x21, 0x89, 0xab, 0x5c, 0xff, 0x18, 0x3d, 0x1d, 0xf3, 0xd5, 0xe9, 0x48, 0x05, 0x67, 0x23, - 0x15, 0x9c, 0x8f, 0x54, 0xf0, 0x67, 0xa4, 0x82, 0x2f, 0x63, 0x35, 0x77, 0x36, 0x56, 0x73, 0xe7, - 0x63, 0x35, 0xf7, 0x7e, 0xc7, 0x71, 0x59, 0xff, 0xb0, 0xab, 0xf7, 0x88, 0x67, 0x44, 0x71, 0xb7, - 0x7d, 0xcc, 0x8e, 0x48, 0xb8, 0x6f, 0x2c, 0x79, 0x55, 0xd1, 0xca, 0xd1, 0x6e, 0x9e, 0x7f, 0x12, - 0x1e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xce, 0x8f, 0xce, 0xfc, 0x04, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) - AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.service.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, "/poktroll.service.Msg/UpdateParam", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) { - out := new(MsgAddServiceResponse) - err := c.cc.Invoke(ctx, "/poktroll.service.Msg/AddService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) - AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} -func (*UnimplementedMsgServer) AddService(ctx context.Context, req *MsgAddService) (*MsgAddServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.service.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.service.Msg/UpdateParam", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddService) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AddService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.service.Msg/AddService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddService(ctx, req.(*MsgAddService)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.service.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - { - MethodName: "AddService", - Handler: _Msg_AddService_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/service/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AsType != nil { - { - size := m.AsType.Size() - i -= size - if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam_AsCoin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.AsCoin != nil { - { - size, err := m.AsCoin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgAddService) 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 *MsgAddService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAddService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgAddServiceResponse) 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 *MsgAddServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAddServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.AsType != nil { - n += m.AsType.Size() - } - return n -} - -func (m *MsgUpdateParam_AsCoin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AsCoin != nil { - l = m.AsCoin.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} -func (m *MsgUpdateParamResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgAddService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Service.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgAddServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParam) 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 ErrIntOverflowTx - } - 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: MsgUpdateParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.Coin{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AsType = &MsgUpdateParam_AsCoin{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAddService) 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 ErrIntOverflowTx - } - 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: MsgAddService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAddServiceResponse) 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 ErrIntOverflowTx - } - 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: MsgAddServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/session/types/genesis.pb.go b/x/session/types/genesis.pb.go deleted file mode 100644 index f874492b5..000000000 --- a/x/session/types/genesis.pb.go +++ /dev/null @@ -1,320 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/session/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the session module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_eb011c8651a70d0e, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.session.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/session/genesis.proto", fileDescriptor_eb011c8651a70d0e) } - -var fileDescriptor_eb011c8651a70d0e = []byte{ - // 217 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x4f, 0x4f, 0xcd, - 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, - 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, - 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, - 0xcc, 0x85, 0x9a, 0xac, 0xe4, 0xcd, 0xc5, 0xe3, 0x0e, 0xb1, 0x2a, 0xb8, 0x24, 0xb1, 0x24, 0x55, - 0xc8, 0x9a, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0x6e, - 0xb5, 0x5e, 0x00, 0x58, 0xde, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, - 0x06, 0x41, 0xb5, 0x38, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, - 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, - 0xc7, 0x72, 0x0c, 0x51, 0x06, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, - 0x20, 0x43, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xe1, 0x2e, 0xac, 0x80, 0xbb, - 0xb1, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x46, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x5b, 0x35, 0xaa, 0xf9, 0x1f, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.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 *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 - 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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/session/types/params.pb.go b/x/session/types/params.pb.go deleted file mode 100644 index ac12d5cc9..000000000 --- a/x/session/types/params.pb.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/session/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_b9edf07916909b5b, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.session.Params") -} - -func init() { proto.RegisterFile("poktroll/session/params.proto", fileDescriptor_b9edf07916909b5b) } - -var fileDescriptor_b9edf07916909b5b = []byte{ - // 180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x48, 0x2c, - 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, - 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, - 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb8, 0xd8, 0x02, 0xc0, 0x46, 0x59, - 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xb2, 0x0a, 0xb8, 0x75, - 0x10, 0x35, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, - 0x0c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x2c, 0x06, 0x96, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x5e, 0xc7, 0xb4, - 0xe0, 0x00, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/session/types/query.pb.go b/x/session/types/query.pb.go deleted file mode 100644 index ca446e8de..000000000 --- a/x/session/types/query.pb.go +++ /dev/null @@ -1,1008 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/session/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/pokt-network/poktroll/x/shared/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d59d2e9c0a875c89, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d59d2e9c0a875c89, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetSessionRequest struct { - ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - BlockHeight int64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` -} - -func (m *QueryGetSessionRequest) Reset() { *m = QueryGetSessionRequest{} } -func (m *QueryGetSessionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetSessionRequest) ProtoMessage() {} -func (*QueryGetSessionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d59d2e9c0a875c89, []int{2} -} -func (m *QueryGetSessionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetSessionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetSessionRequest.Merge(m, src) -} -func (m *QueryGetSessionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetSessionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetSessionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetSessionRequest proto.InternalMessageInfo - -func (m *QueryGetSessionRequest) GetApplicationAddress() string { - if m != nil { - return m.ApplicationAddress - } - return "" -} - -func (m *QueryGetSessionRequest) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *QueryGetSessionRequest) GetBlockHeight() int64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -type QueryGetSessionResponse struct { - Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` -} - -func (m *QueryGetSessionResponse) Reset() { *m = QueryGetSessionResponse{} } -func (m *QueryGetSessionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetSessionResponse) ProtoMessage() {} -func (*QueryGetSessionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d59d2e9c0a875c89, []int{3} -} -func (m *QueryGetSessionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetSessionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetSessionResponse.Merge(m, src) -} -func (m *QueryGetSessionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetSessionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetSessionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetSessionResponse proto.InternalMessageInfo - -func (m *QueryGetSessionResponse) GetSession() *Session { - if m != nil { - return m.Session - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.session.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.session.QueryParamsResponse") - proto.RegisterType((*QueryGetSessionRequest)(nil), "poktroll.session.QueryGetSessionRequest") - proto.RegisterType((*QueryGetSessionResponse)(nil), "poktroll.session.QueryGetSessionResponse") -} - -func init() { proto.RegisterFile("poktroll/session/query.proto", fileDescriptor_d59d2e9c0a875c89) } - -var fileDescriptor_d59d2e9c0a875c89 = []byte{ - // 485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xae, 0x3b, 0x51, 0x54, 0x8f, 0x03, 0x78, 0x15, 0x64, 0xd5, 0x16, 0x46, 0xc4, 0x44, 0x99, - 0x68, 0x8c, 0xba, 0x23, 0x27, 0x7a, 0x81, 0x5d, 0x26, 0xc8, 0x6e, 0x5c, 0x22, 0x37, 0xb1, 0x52, - 0xab, 0x69, 0x5e, 0x66, 0xbb, 0xc0, 0xae, 0x88, 0x1f, 0x80, 0x84, 0xf8, 0x09, 0x20, 0x8e, 0x1c, - 0xf8, 0x11, 0x3b, 0x4e, 0x70, 0xd9, 0x09, 0xa1, 0x16, 0x89, 0xbf, 0x81, 0x6a, 0xbb, 0x82, 0x11, - 0xaa, 0x72, 0x89, 0x9c, 0xf7, 0x7d, 0xdf, 0x7b, 0xdf, 0xfb, 0x6c, 0xbc, 0x55, 0xc2, 0x48, 0x4b, - 0xc8, 0x73, 0xaa, 0xb8, 0x52, 0x02, 0x0a, 0x7a, 0x3c, 0xe1, 0xf2, 0x24, 0x2c, 0x25, 0x68, 0x20, - 0x57, 0x17, 0x68, 0xe8, 0xd0, 0xf6, 0x35, 0x36, 0x16, 0x05, 0x50, 0xf3, 0xb5, 0xa4, 0x76, 0x2b, - 0x83, 0x0c, 0xcc, 0x91, 0xce, 0x4f, 0xae, 0xba, 0x95, 0x01, 0x64, 0x39, 0xa7, 0xac, 0x14, 0x94, - 0x15, 0x05, 0x68, 0xa6, 0x05, 0x14, 0xca, 0xa1, 0x9b, 0x09, 0xa8, 0x31, 0xa8, 0xd8, 0xca, 0xec, - 0x8f, 0x83, 0xb6, 0x2b, 0x8e, 0x4a, 0x26, 0xd9, 0x78, 0x01, 0x57, 0x0d, 0xeb, 0x93, 0x92, 0xff, - 0x43, 0x3c, 0x64, 0x92, 0xa7, 0x54, 0x71, 0xf9, 0x5c, 0x24, 0xdc, 0xc2, 0x41, 0x0b, 0x93, 0xa7, - 0xf3, 0xf5, 0x9e, 0x98, 0x8e, 0x11, 0x3f, 0x9e, 0x70, 0xa5, 0x83, 0x08, 0x6f, 0x5c, 0xa8, 0xaa, - 0x12, 0x0a, 0xc5, 0xc9, 0x03, 0xdc, 0xb0, 0x93, 0x3d, 0xb4, 0x83, 0x3a, 0xeb, 0x3d, 0x2f, 0xfc, - 0x3b, 0x8d, 0xd0, 0x2a, 0xfa, 0xcd, 0xd3, 0x6f, 0x37, 0x6b, 0x1f, 0x7f, 0x7e, 0xda, 0x43, 0x91, - 0x93, 0x04, 0xef, 0x11, 0xbe, 0x6e, 0x9a, 0x3e, 0xe2, 0xfa, 0xc8, 0xb2, 0xdd, 0x38, 0x72, 0x80, - 0x37, 0x58, 0x59, 0xe6, 0x22, 0x31, 0x89, 0xc4, 0x2c, 0x4d, 0x25, 0x57, 0x76, 0x48, 0xb3, 0xef, - 0x7d, 0xf9, 0xdc, 0x6d, 0xb9, 0x3c, 0x1e, 0x5a, 0xe4, 0x48, 0x4b, 0x51, 0x64, 0x11, 0xf9, 0x43, - 0xe4, 0x10, 0xb2, 0x8d, 0xb1, 0x5b, 0x30, 0x16, 0xa9, 0x57, 0x9f, 0x77, 0x88, 0x9a, 0xae, 0x72, - 0x90, 0x92, 0x5b, 0xf8, 0xca, 0x20, 0x87, 0x64, 0x14, 0x0f, 0xb9, 0xc8, 0x86, 0xda, 0x5b, 0xdb, - 0x41, 0x9d, 0xb5, 0x68, 0xdd, 0xd4, 0x1e, 0x9b, 0x52, 0x70, 0x88, 0x6f, 0x54, 0x6c, 0xba, 0xfd, - 0xf7, 0xf1, 0x65, 0xb7, 0xa7, 0x0b, 0x60, 0xb3, 0x1a, 0xc0, 0x42, 0xb3, 0x60, 0xf6, 0x3e, 0xd4, - 0xf1, 0x25, 0xd3, 0x90, 0xbc, 0x46, 0xb8, 0x61, 0xf3, 0x21, 0xb7, 0xab, 0xc2, 0xea, 0x35, 0xb4, - 0x77, 0x57, 0xb0, 0xac, 0xad, 0xa0, 0xfb, 0xea, 0xeb, 0x8f, 0xb7, 0xf5, 0x3b, 0x64, 0x97, 0xce, - 0xe9, 0xdd, 0x82, 0xeb, 0x17, 0x20, 0x47, 0x74, 0xc9, 0xab, 0x21, 0xef, 0x10, 0xc6, 0xbf, 0x97, - 0x23, 0x9d, 0x25, 0x43, 0x2a, 0xd7, 0xd4, 0xbe, 0xfb, 0x1f, 0x4c, 0x67, 0xa9, 0x67, 0x2c, 0xdd, - 0x23, 0x7b, 0x2b, 0x2c, 0x65, 0x5c, 0xc7, 0xee, 0xdc, 0x3f, 0x3c, 0x9d, 0xfa, 0xe8, 0x6c, 0xea, - 0xa3, 0xf3, 0xa9, 0x8f, 0xbe, 0x4f, 0x7d, 0xf4, 0x66, 0xe6, 0xd7, 0xce, 0x66, 0x7e, 0xed, 0x7c, - 0xe6, 0xd7, 0x9e, 0xdd, 0xcf, 0x84, 0x1e, 0x4e, 0x06, 0x61, 0x02, 0xe3, 0x25, 0x3d, 0x5f, 0x5e, - 0x7c, 0xff, 0x83, 0x86, 0x79, 0xe1, 0xfb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x71, 0x8a, 0x02, - 0x58, 0xd1, 0x03, 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 the session given app_address, service and block_height. - GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.session.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) { - out := new(QueryGetSessionResponse) - err := c.cc.Invoke(ctx, "/poktroll.session.Query/GetSession", in, out, opts...) - 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 the session given app_address, service and block_height. - GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, 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) GetSession(ctx context.Context, req *QueryGetSessionRequest) (*QueryGetSessionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.session.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 _Query_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetSessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetSession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.session.Query/GetSession", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetSession(ctx, req.(*QueryGetSessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.session.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "GetSession", - Handler: _Query_GetSession_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/session/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetSessionRequest) 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 *QueryGetSessionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetSessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x18 - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ApplicationAddress) > 0 { - i -= len(m.ApplicationAddress) - copy(dAtA[i:], m.ApplicationAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ApplicationAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetSessionResponse) 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 *QueryGetSessionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Session != nil { - { - size, err := m.Session.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 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 *QueryGetSessionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ApplicationAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovQuery(uint64(m.BlockHeight)) - } - return n -} - -func (m *QueryGetSessionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Session != nil { - l = m.Session.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 *QueryGetSessionRequest) 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: QueryGetSessionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSessionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddress", 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.ApplicationAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(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 *QueryGetSessionResponse) 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: QueryGetSessionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSessionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Session", 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.Session == nil { - m.Session = &Session{} - } - if err := m.Session.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 skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/session/types/query.pb.gw.go b/x/session/types/query.pb.gw.go deleted file mode 100644 index 235d1d10a..000000000 --- a/x/session/types/query.pb.gw.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/session/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_GetSession_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_GetSession_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSessionRequest - 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_GetSession_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSession(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetSession_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSessionRequest - 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_GetSession_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetSession(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetSession_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_GetSession_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_GetSession_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetSession_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_GetSession_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_GetSession_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "session", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GetSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "session", "get_session"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_GetSession_0 = runtime.ForwardResponseMessage -) diff --git a/x/session/types/tx.pb.go b/x/session/types/tx.pb.go deleted file mode 100644 index e60329741..000000000 --- a/x/session/types/tx.pb.go +++ /dev/null @@ -1,590 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/session/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/session parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_0b53e8fbf6b46fb6, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0b53e8fbf6b46fb6, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.session.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.session.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("poktroll/session/tx.proto", fileDescriptor_0b53e8fbf6b46fb6) } - -var fileDescriptor_0b53e8fbf6b46fb6 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xe9, 0x41, 0xa5, 0xa4, 0x04, 0x13, 0x73, - 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0xb1, - 0x7e, 0x6e, 0x71, 0xba, 0x7e, 0x99, 0x21, 0x88, 0x82, 0x4a, 0x48, 0x42, 0x24, 0xe2, 0xc1, 0x3c, - 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, 0xa2, 0xb2, - 0x18, 0x2e, 0x29, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0x6a, 0x52, 0x3a, 0xce, 0xc8, 0xc5, 0xef, 0x5b, - 0x9c, 0x1e, 0x5a, 0x90, 0x92, 0x58, 0x92, 0x1a, 0x00, 0x96, 0x11, 0x32, 0xe3, 0xe2, 0x4c, 0x2c, - 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, 0xa9, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xb8, - 0xb4, 0x45, 0x57, 0x04, 0x6a, 0x9b, 0x63, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x70, 0x49, 0x51, - 0x66, 0x5e, 0x7a, 0x10, 0x42, 0xa9, 0x90, 0x2b, 0x17, 0x1b, 0xc4, 0x6c, 0x09, 0x26, 0x05, 0x46, - 0x0d, 0x6e, 0x23, 0x09, 0x3d, 0x74, 0xaf, 0xea, 0x41, 0x6c, 0x70, 0x12, 0x3e, 0x71, 0x4f, 0x9e, - 0xe1, 0xd5, 0x3d, 0x79, 0xa8, 0xfa, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0x39, 0x56, 0xa6, - 0x4d, 0xcf, 0x37, 0x68, 0x21, 0x8c, 0xed, 0x7a, 0xbe, 0x41, 0x4b, 0x09, 0xee, 0x89, 0x0a, 0xb8, - 0x37, 0xd0, 0x5c, 0xad, 0x24, 0xc9, 0x25, 0x8e, 0x26, 0x14, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, - 0x9c, 0x6a, 0x94, 0xc5, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x14, 0xc3, 0xc5, 0x83, 0xe2, 0x4f, 0x45, - 0x4c, 0xf7, 0xa1, 0x99, 0x20, 0xa5, 0x49, 0x50, 0x09, 0xcc, 0x12, 0x29, 0xd6, 0x06, 0x90, 0x2f, - 0x9c, 0xfc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc6, 0x23, 0x39, 0xc6, 0x07, - 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, - 0x28, 0x83, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0xc9, 0xba, - 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x58, 0x3c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, - 0xc4, 0x06, 0x8e, 0x27, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xc2, 0x98, 0xb6, 0x52, - 0x02, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.session.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.session.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.session.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/session/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/session/types/types.pb.go b/x/session/types/types.pb.go deleted file mode 100644 index 2d12d8f47..000000000 --- a/x/session/types/types.pb.go +++ /dev/null @@ -1,933 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/session/types.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/application/types" - types1 "github.com/pokt-network/poktroll/x/shared/types" - 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 - -// SessionHeader is a lightweight header for a session that can be passed around. -// It is the minimal amount of data required to hydrate & retrieve all data relevant to the session. -type SessionHeader struct { - ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience - SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SessionStartBlockHeight int64 `protobuf:"varint,4,opt,name=session_start_block_height,json=sessionStartBlockHeight,proto3" json:"session_start_block_height,omitempty"` - // Note that`session_end_block_height` is a derivative of (`start` + `num_blocks_per_session`) - // as goverened by on-chain params at the time of the session start. - // It is stored as an additional field to simplofy business logic in case - // the number of blocks_per_session changes during the session. - SessionEndBlockHeight int64 `protobuf:"varint,5,opt,name=session_end_block_height,json=sessionEndBlockHeight,proto3" json:"session_end_block_height,omitempty"` -} - -func (m *SessionHeader) Reset() { *m = SessionHeader{} } -func (m *SessionHeader) String() string { return proto.CompactTextString(m) } -func (*SessionHeader) ProtoMessage() {} -func (*SessionHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2d9db41a667008, []int{0} -} -func (m *SessionHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SessionHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *SessionHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_SessionHeader.Merge(m, src) -} -func (m *SessionHeader) XXX_Size() int { - return m.Size() -} -func (m *SessionHeader) XXX_DiscardUnknown() { - xxx_messageInfo_SessionHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_SessionHeader proto.InternalMessageInfo - -func (m *SessionHeader) GetApplicationAddress() string { - if m != nil { - return m.ApplicationAddress - } - return "" -} - -func (m *SessionHeader) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *SessionHeader) GetSessionId() string { - if m != nil { - return m.SessionId - } - return "" -} - -func (m *SessionHeader) GetSessionStartBlockHeight() int64 { - if m != nil { - return m.SessionStartBlockHeight - } - return 0 -} - -func (m *SessionHeader) GetSessionEndBlockHeight() int64 { - if m != nil { - return m.SessionEndBlockHeight - } - return 0 -} - -// Session is a fully hydrated session object that contains all the information for the Session -// and its parcipants. -type Session struct { - Header *SessionHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SessionNumber int64 `protobuf:"varint,3,opt,name=session_number,json=sessionNumber,proto3" json:"session_number,omitempty"` - NumBlocksPerSession int64 `protobuf:"varint,4,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` - Application *types.Application `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"` - Suppliers []*types1.Supplier `protobuf:"bytes,6,rep,name=suppliers,proto3" json:"suppliers,omitempty"` -} - -func (m *Session) Reset() { *m = Session{} } -func (m *Session) String() string { return proto.CompactTextString(m) } -func (*Session) ProtoMessage() {} -func (*Session) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2d9db41a667008, []int{1} -} -func (m *Session) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Session) XXX_Merge(src proto.Message) { - xxx_messageInfo_Session.Merge(m, src) -} -func (m *Session) XXX_Size() int { - return m.Size() -} -func (m *Session) XXX_DiscardUnknown() { - xxx_messageInfo_Session.DiscardUnknown(m) -} - -var xxx_messageInfo_Session proto.InternalMessageInfo - -func (m *Session) GetHeader() *SessionHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *Session) GetSessionId() string { - if m != nil { - return m.SessionId - } - return "" -} - -func (m *Session) GetSessionNumber() int64 { - if m != nil { - return m.SessionNumber - } - return 0 -} - -func (m *Session) GetNumBlocksPerSession() int64 { - if m != nil { - return m.NumBlocksPerSession - } - return 0 -} - -func (m *Session) GetApplication() *types.Application { - if m != nil { - return m.Application - } - return nil -} - -func (m *Session) GetSuppliers() []*types1.Supplier { - if m != nil { - return m.Suppliers - } - return nil -} - -func init() { - proto.RegisterType((*SessionHeader)(nil), "poktroll.session.SessionHeader") - proto.RegisterType((*Session)(nil), "poktroll.session.Session") -} - -func init() { proto.RegisterFile("poktroll/session/types.proto", fileDescriptor_4b2d9db41a667008) } - -var fileDescriptor_4b2d9db41a667008 = []byte{ - // 468 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0xc7, 0x9b, 0x16, 0x8a, 0xea, 0x6a, 0x08, 0x79, 0x03, 0xb2, 0x8a, 0x99, 0x32, 0x09, 0xa9, - 0x97, 0x25, 0xa8, 0x3b, 0xf4, 0xc0, 0x69, 0x45, 0x48, 0xeb, 0x65, 0x42, 0xe9, 0x8d, 0x4b, 0x94, - 0xc4, 0x56, 0x12, 0x35, 0xb1, 0x23, 0xdb, 0xe1, 0xe5, 0x4b, 0x20, 0x3e, 0x0c, 0x37, 0xbe, 0x00, - 0xc7, 0x89, 0xd3, 0x8e, 0x28, 0xfd, 0x22, 0x28, 0xb6, 0xb3, 0xa4, 0xd9, 0xcd, 0x79, 0x7e, 0xff, - 0xe7, 0xe5, 0x6f, 0x3f, 0x01, 0xaf, 0x0a, 0xb6, 0x93, 0x9c, 0x65, 0x99, 0x2b, 0x88, 0x10, 0x29, - 0xa3, 0xae, 0xfc, 0x5e, 0x10, 0xe1, 0x14, 0x9c, 0x49, 0x06, 0x9f, 0x35, 0xd4, 0x31, 0x74, 0x76, - 0x1a, 0x31, 0x91, 0x33, 0xe1, 0x2b, 0xee, 0xea, 0x0f, 0x2d, 0x9e, 0x9d, 0xb5, 0xa5, 0x92, 0x80, - 0x13, 0xec, 0x0a, 0xc2, 0xbf, 0xa4, 0x11, 0x31, 0x78, 0x7e, 0x8f, 0x83, 0xa2, 0xc8, 0xd2, 0x28, - 0x90, 0xbd, 0x6e, 0x33, 0xf4, 0xa0, 0x40, 0x59, 0x2b, 0x09, 0x37, 0xfc, 0x24, 0x66, 0x31, 0xd3, - 0x8d, 0xeb, 0x93, 0x8e, 0x9e, 0xff, 0x18, 0x82, 0xa3, 0xad, 0x9e, 0xee, 0x9a, 0x04, 0x98, 0x70, - 0xb8, 0x01, 0xc7, 0x9d, 0x16, 0x7e, 0x80, 0x31, 0x27, 0x42, 0xd8, 0xd6, 0xdc, 0x5a, 0x4c, 0xd6, - 0xf6, 0xdf, 0x5f, 0x17, 0x27, 0x66, 0xee, 0x2b, 0x4d, 0xb6, 0x92, 0xa7, 0x34, 0xf6, 0x60, 0x27, - 0xc9, 0x10, 0x78, 0x06, 0x80, 0x71, 0xe1, 0xa7, 0xd8, 0x1e, 0xd6, 0x15, 0xbc, 0x89, 0x89, 0x6c, - 0xb0, 0xc6, 0xaa, 0x75, 0x8d, 0x47, 0x0d, 0x56, 0x91, 0x0d, 0x86, 0xef, 0xc1, 0xac, 0xc1, 0x42, - 0x06, 0x5c, 0xfa, 0x61, 0xc6, 0xa2, 0x9d, 0x9f, 0x90, 0x34, 0x4e, 0xa4, 0xfd, 0x68, 0x6e, 0x2d, - 0x46, 0xde, 0x4b, 0xa3, 0xd8, 0xd6, 0x82, 0x75, 0xcd, 0xaf, 0x15, 0x86, 0x2b, 0x60, 0x37, 0xc9, - 0x84, 0xe2, 0xc3, 0xd4, 0xc7, 0x2a, 0xf5, 0xb9, 0xe1, 0x1f, 0x29, 0xee, 0x24, 0x9e, 0xff, 0x1e, - 0x82, 0x27, 0xe6, 0x42, 0xe0, 0x0a, 0x8c, 0x13, 0x75, 0x29, 0xca, 0xfd, 0x74, 0xf9, 0xda, 0xe9, - 0xbf, 0xa8, 0x73, 0x70, 0x77, 0x9e, 0x91, 0xf7, 0x9c, 0x0d, 0xfb, 0xce, 0xde, 0x82, 0xa7, 0x0d, - 0xa6, 0x65, 0x1e, 0x12, 0xae, 0xcc, 0x8f, 0xbc, 0x23, 0x13, 0xbd, 0x51, 0x41, 0x78, 0x09, 0x5e, - 0xd0, 0x32, 0xd7, 0xb3, 0x0b, 0xbf, 0x20, 0xdc, 0x37, 0xdc, 0x98, 0x3f, 0xa6, 0x65, 0xae, 0x46, - 0x17, 0x9f, 0x08, 0x6f, 0x66, 0xfe, 0x00, 0xa6, 0x9d, 0x97, 0x50, 0x5e, 0xa7, 0xcb, 0x37, 0xed, - 0xe0, 0x1d, 0xe8, 0x5c, 0xb5, 0x67, 0xaf, 0x9b, 0x05, 0x57, 0x60, 0xd2, 0x6c, 0x8f, 0xb0, 0xc7, - 0xf3, 0xd1, 0x62, 0xba, 0x3c, 0xed, 0x78, 0x57, 0xfb, 0xe5, 0x6c, 0x8d, 0xc2, 0x6b, 0xb5, 0xeb, - 0x9b, 0x3f, 0x15, 0xb2, 0x6e, 0x2b, 0x64, 0xdd, 0x55, 0xc8, 0xfa, 0x57, 0x21, 0xeb, 0xe7, 0x1e, - 0x0d, 0x6e, 0xf7, 0x68, 0x70, 0xb7, 0x47, 0x83, 0xcf, 0xef, 0xe2, 0x54, 0x26, 0x65, 0xe8, 0x44, - 0x2c, 0x77, 0xeb, 0x6a, 0x17, 0x94, 0xc8, 0xaf, 0x8c, 0xef, 0xdc, 0xfb, 0xd5, 0xfd, 0x76, 0xf8, - 0x23, 0x85, 0x63, 0xb5, 0xa5, 0x97, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x3f, 0x27, 0x80, - 0x69, 0x03, 0x00, 0x00, -} - -func (m *SessionHeader) 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 *SessionHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SessionHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SessionEndBlockHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SessionEndBlockHeight)) - i-- - dAtA[i] = 0x28 - } - if m.SessionStartBlockHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SessionStartBlockHeight)) - i-- - dAtA[i] = 0x20 - } - if len(m.SessionId) > 0 { - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0x1a - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ApplicationAddress) > 0 { - i -= len(m.ApplicationAddress) - copy(dAtA[i:], m.ApplicationAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ApplicationAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Session) 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 *Session) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Suppliers) > 0 { - for iNdEx := len(m.Suppliers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Suppliers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.Application != nil { - { - size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.NumBlocksPerSession != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.NumBlocksPerSession)) - i-- - dAtA[i] = 0x20 - } - if m.SessionNumber != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SessionNumber)) - i-- - dAtA[i] = 0x18 - } - if len(m.SessionId) > 0 { - i -= len(m.SessionId) - copy(dAtA[i:], m.SessionId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SessionId))) - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SessionHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ApplicationAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.SessionId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.SessionStartBlockHeight != 0 { - n += 1 + sovTypes(uint64(m.SessionStartBlockHeight)) - } - if m.SessionEndBlockHeight != 0 { - n += 1 + sovTypes(uint64(m.SessionEndBlockHeight)) - } - return n -} - -func (m *Session) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.SessionId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.SessionNumber != 0 { - n += 1 + sovTypes(uint64(m.SessionNumber)) - } - if m.NumBlocksPerSession != 0 { - n += 1 + sovTypes(uint64(m.NumBlocksPerSession)) - } - if m.Application != nil { - l = m.Application.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Suppliers) > 0 { - for _, e := range m.Suppliers { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SessionHeader) 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 ErrIntOverflowTypes - } - 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: SessionHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SessionHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApplicationAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionStartBlockHeight", wireType) - } - m.SessionStartBlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SessionStartBlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionEndBlockHeight", wireType) - } - m.SessionEndBlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SessionEndBlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Session) 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 ErrIntOverflowTypes - } - 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: Session: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Session: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &SessionHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionNumber", wireType) - } - m.SessionNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SessionNumber |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumBlocksPerSession", wireType) - } - m.NumBlocksPerSession = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumBlocksPerSession |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Application == nil { - m.Application = &types.Application{} - } - if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Suppliers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Suppliers = append(m.Suppliers, &types1.Supplier{}) - if err := m.Suppliers[len(m.Suppliers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/genesis.pb.go b/x/shared/types/genesis.pb.go deleted file mode 100644 index 7fdfa5ca8..000000000 --- a/x/shared/types/genesis.pb.go +++ /dev/null @@ -1,320 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the shared module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_7a0004d2eefa4b15, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.shared.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/shared/genesis.proto", fileDescriptor_7a0004d2eefa4b15) } - -var fileDescriptor_7a0004d2eefa4b15 = []byte{ - // 216 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, - 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0x49, 0xeb, 0x41, 0xa4, - 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x48, 0x7a, 0x7e, - 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0xd0, 0x0d, 0x2e, 0x48, 0x2c, 0x4a, 0xcc, - 0x85, 0x9a, 0xab, 0xe4, 0xc5, 0xc5, 0xe3, 0x0e, 0xb1, 0x28, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, - 0x8a, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0x66, 0xb1, - 0x5e, 0x00, 0x58, 0xda, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, - 0x41, 0x75, 0x38, 0xf9, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, - 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, - 0x72, 0x0c, 0x51, 0xfa, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, - 0x33, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xe1, 0xee, 0xab, 0x80, 0xb9, 0xb0, - 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xb7, 0x4b, 0x51, 0xdd, 0x1a, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.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 *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 - 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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/params.pb.go b/x/shared/types/params.pb.go deleted file mode 100644 index 7b5863516..000000000 --- a/x/shared/types/params.pb.go +++ /dev/null @@ -1,671 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { - // num_blocks_per_session is the number of blocks between the session start & end heights. - NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` - // grace_period_end_offset_blocks is the number of blocks, after the session end height, - // during which the supplier can still service payable relays. - // Suppliers will need to recreate a claim for the previous session (if already created) to - // get paid for the additional relays. - GracePeriodEndOffsetBlocks uint64 `protobuf:"varint,2,opt,name=grace_period_end_offset_blocks,json=gracePeriodEndOffsetBlocks,proto3" json:"grace_period_end_offset_blocks"` - // claim_window_open_offset_blocks is the number of blocks after the session grace - // period height, at which the claim window opens. - ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,3,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks"` - // claim_window_close_offset_blocks is the number of blocks after the claim window - // open height, at which the claim window closes. - ClaimWindowCloseOffsetBlocks uint64 `protobuf:"varint,4,opt,name=claim_window_close_offset_blocks,json=claimWindowCloseOffsetBlocks,proto3" json:"claim_window_close_offset_blocks"` - // proof_window_open_offset_blocks is the number of blocks after the claim window - // close height, at which the proof window opens. - ProofWindowOpenOffsetBlocks uint64 `protobuf:"varint,5,opt,name=proof_window_open_offset_blocks,json=proofWindowOpenOffsetBlocks,proto3" json:"proof_window_open_offset_blocks"` - // proof_window_close_offset_blocks is the number of blocks after the proof window - // open height, at which the proof window closes. - ProofWindowCloseOffsetBlocks uint64 `protobuf:"varint,6,opt,name=proof_window_close_offset_blocks,json=proofWindowCloseOffsetBlocks,proto3" json:"proof_window_close_offset_blocks"` - // supplier_unbonding_period_sessions is the number of sessions that a supplier must wait after - // unstaking before their staked assets are moved to their account balance. - // On-chain business logic requires, and ensures, that the corresponding block count of the unbonding - // period will exceed the end of any active claim & proof lifecycles. - SupplierUnbondingPeriodSessions uint64 `protobuf:"varint,7,opt,name=supplier_unbonding_period_sessions,json=supplierUnbondingPeriodSessions,proto3" json:"supplier_unbonding_period_sessions"` - // application_unbonding_period_sessions is the number of sessions that an application must wait after - // unstaking before their staked assets are moved to their account balance. - // On-chain business logic requires, and ensures, that the corresponding block count of the - // application unbonding period will exceed the end of its corresponding proof window close height. - ApplicationUnbondingPeriodSessions uint64 `protobuf:"varint,8,opt,name=application_unbonding_period_sessions,json=applicationUnbondingPeriodSessions,proto3" json:"application_unbonding_period_sessions"` - // The amount of upokt that a compute unit should translate to when settling a session. - // DEV_NOTE: This used to be under x/tokenomics but has been moved here to avoid cyclic dependencies. - ComputeUnitsToTokensMultiplier uint64 `protobuf:"varint,9,opt,name=compute_units_to_tokens_multiplier,json=computeUnitsToTokensMultiplier,proto3" json:"compute_units_to_tokens_multiplier" yaml:"compute_units_to_tokens_multiplier"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_ee6189c7aa51bbf5, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetNumBlocksPerSession() uint64 { - if m != nil { - return m.NumBlocksPerSession - } - return 0 -} - -func (m *Params) GetGracePeriodEndOffsetBlocks() uint64 { - if m != nil { - return m.GracePeriodEndOffsetBlocks - } - return 0 -} - -func (m *Params) GetClaimWindowOpenOffsetBlocks() uint64 { - if m != nil { - return m.ClaimWindowOpenOffsetBlocks - } - return 0 -} - -func (m *Params) GetClaimWindowCloseOffsetBlocks() uint64 { - if m != nil { - return m.ClaimWindowCloseOffsetBlocks - } - return 0 -} - -func (m *Params) GetProofWindowOpenOffsetBlocks() uint64 { - if m != nil { - return m.ProofWindowOpenOffsetBlocks - } - return 0 -} - -func (m *Params) GetProofWindowCloseOffsetBlocks() uint64 { - if m != nil { - return m.ProofWindowCloseOffsetBlocks - } - return 0 -} - -func (m *Params) GetSupplierUnbondingPeriodSessions() uint64 { - if m != nil { - return m.SupplierUnbondingPeriodSessions - } - return 0 -} - -func (m *Params) GetApplicationUnbondingPeriodSessions() uint64 { - if m != nil { - return m.ApplicationUnbondingPeriodSessions - } - return 0 -} - -func (m *Params) GetComputeUnitsToTokensMultiplier() uint64 { - if m != nil { - return m.ComputeUnitsToTokensMultiplier - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.shared.Params") -} - -func init() { proto.RegisterFile("poktroll/shared/params.proto", fileDescriptor_ee6189c7aa51bbf5) } - -var fileDescriptor_ee6189c7aa51bbf5 = []byte{ - // 524 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xbf, 0x6e, 0xd3, 0x40, - 0x1c, 0xc7, 0x6b, 0x28, 0xa1, 0x78, 0x41, 0x18, 0x84, 0xac, 0x34, 0xf2, 0x15, 0xf3, 0x47, 0x14, - 0x89, 0x78, 0x60, 0xeb, 0x18, 0xc4, 0x58, 0x25, 0x72, 0x5b, 0x21, 0xb1, 0x9c, 0x1c, 0xfb, 0xe2, - 0x9e, 0x62, 0xdf, 0xef, 0x74, 0x77, 0x56, 0xa8, 0xc4, 0x13, 0x30, 0xf1, 0x06, 0xb0, 0xb3, 0xf0, - 0x18, 0x8c, 0x1d, 0x3b, 0x59, 0x28, 0x19, 0x40, 0x1e, 0x79, 0x02, 0xe4, 0x73, 0xdc, 0x26, 0x29, - 0xa9, 0xb3, 0x44, 0xa7, 0xfb, 0x7e, 0xee, 0xf7, 0xc9, 0x57, 0x3e, 0x9d, 0xd9, 0xe1, 0x30, 0x56, - 0x02, 0x92, 0xc4, 0x93, 0xa7, 0x81, 0x20, 0x91, 0xc7, 0x03, 0x11, 0xa4, 0xb2, 0xcb, 0x05, 0x28, - 0xb0, 0xee, 0xd7, 0x69, 0xb7, 0x4a, 0xdb, 0x0f, 0x82, 0x94, 0x32, 0xf0, 0xf4, 0x6f, 0xc5, 0xb4, - 0x1f, 0xc5, 0x10, 0x83, 0x5e, 0x7a, 0xe5, 0xaa, 0xda, 0x75, 0xbf, 0xef, 0x98, 0xad, 0x81, 0x1e, - 0x65, 0xf5, 0xcd, 0xc7, 0x2c, 0x4b, 0xf1, 0x30, 0x81, 0x70, 0x2c, 0x31, 0x27, 0x02, 0x4b, 0x22, - 0x25, 0x05, 0x66, 0x1b, 0x7b, 0xc6, 0xcb, 0xed, 0x5e, 0xbb, 0xc8, 0xd1, 0x1a, 0xc2, 0x7f, 0xc8, - 0xb2, 0xb4, 0xa7, 0xb7, 0x07, 0x44, 0x1c, 0x55, 0x9b, 0xd6, 0xc8, 0x74, 0x62, 0x11, 0x84, 0xa4, - 0x24, 0x29, 0x44, 0x98, 0xb0, 0x08, 0xc3, 0x68, 0x24, 0x89, 0x9a, 0x8f, 0xb0, 0x6f, 0xe9, 0xc1, - 0x6e, 0x91, 0xa3, 0x06, 0xd2, 0x6f, 0xeb, 0x7c, 0xa0, 0xe3, 0x77, 0x2c, 0xea, 0xeb, 0xb0, 0x32, - 0x5a, 0xd4, 0x44, 0x61, 0x12, 0xd0, 0x14, 0x4f, 0x28, 0x8b, 0x60, 0x82, 0x81, 0x13, 0xb6, 0x22, - 0xba, 0xad, 0x45, 0x4f, 0x8b, 0x1c, 0x35, 0xa1, 0xfe, 0xae, 0x06, 0xde, 0xeb, 0xbc, 0xcf, 0x09, - 0x5b, 0x52, 0x25, 0xe6, 0xde, 0xd2, 0xf9, 0x30, 0x01, 0x49, 0x56, 0x5c, 0xdb, 0xda, 0xf5, 0xac, - 0xc8, 0x51, 0x23, 0xeb, 0x77, 0x16, 0x64, 0x6f, 0xcb, 0x7c, 0xb5, 0x18, 0x17, 0x00, 0xa3, 0x1b, - 0x8a, 0xdd, 0xb9, 0x2a, 0xd6, 0x80, 0xfa, 0xbb, 0x1a, 0x58, 0x5f, 0x6c, 0xe9, 0xfc, 0xff, 0x8a, - 0xb5, 0xae, 0x8a, 0x35, 0xb1, 0x7e, 0x67, 0x41, 0x76, 0xbd, 0x98, 0x34, 0x5d, 0x99, 0x71, 0x9e, - 0x50, 0x22, 0x70, 0xc6, 0x86, 0xc0, 0x22, 0xca, 0xe2, 0xfa, 0xe3, 0xcf, 0xef, 0x94, 0xb4, 0xef, - 0x6a, 0xdf, 0x8b, 0x22, 0x47, 0x1b, 0xd0, 0x3e, 0xaa, 0x99, 0x93, 0x1a, 0xa9, 0x6e, 0xcb, 0xfc, - 0x36, 0x4a, 0xeb, 0x93, 0xf9, 0x3c, 0x28, 0x89, 0x30, 0x50, 0x14, 0xd8, 0x0d, 0xde, 0x1d, 0xed, - 0xdd, 0x2f, 0x72, 0xb4, 0xd9, 0x01, 0xdf, 0x5d, 0xc0, 0xd6, 0xd9, 0xbf, 0x1a, 0xa6, 0x1b, 0x42, - 0xca, 0x33, 0x45, 0x70, 0xc6, 0xa8, 0x92, 0x58, 0x01, 0x56, 0x30, 0x26, 0x4c, 0xe2, 0x34, 0x4b, - 0x14, 0xd5, 0xff, 0xdd, 0xbe, 0xa7, 0xdd, 0x47, 0x65, 0xe7, 0x66, 0xfa, 0x6f, 0x8e, 0xf6, 0xcf, - 0x82, 0x34, 0x39, 0xd8, 0x80, 0x75, 0x7d, 0x67, 0x0e, 0x9d, 0x94, 0xcc, 0x31, 0x1c, 0x6b, 0xe2, - 0xf0, 0x12, 0x38, 0x78, 0xf2, 0xe7, 0x1b, 0x32, 0x3e, 0xff, 0xfe, 0xf1, 0xca, 0xbe, 0x7c, 0x6b, - 0x3e, 0xd6, 0xaf, 0x4d, 0xf5, 0x44, 0xf4, 0x0e, 0x7f, 0x4e, 0x1d, 0xe3, 0x7c, 0xea, 0x18, 0x17, - 0x53, 0xc7, 0xf8, 0x35, 0x75, 0x8c, 0x2f, 0x33, 0x67, 0xeb, 0x7c, 0xe6, 0x6c, 0x5d, 0xcc, 0x9c, - 0xad, 0x0f, 0x5e, 0x4c, 0xd5, 0x69, 0x36, 0xec, 0x86, 0x90, 0x7a, 0xe5, 0x88, 0xd7, 0x8c, 0xa8, - 0x09, 0x88, 0xb1, 0x77, 0x7d, 0x9e, 0x3a, 0xe3, 0x44, 0x0e, 0x5b, 0xfa, 0x0d, 0x7a, 0xf3, 0x2f, - 0x00, 0x00, 0xff, 0xff, 0x80, 0xd1, 0x33, 0x73, 0xdd, 0x04, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.NumBlocksPerSession != that1.NumBlocksPerSession { - return false - } - if this.GracePeriodEndOffsetBlocks != that1.GracePeriodEndOffsetBlocks { - return false - } - if this.ClaimWindowOpenOffsetBlocks != that1.ClaimWindowOpenOffsetBlocks { - return false - } - if this.ClaimWindowCloseOffsetBlocks != that1.ClaimWindowCloseOffsetBlocks { - return false - } - if this.ProofWindowOpenOffsetBlocks != that1.ProofWindowOpenOffsetBlocks { - return false - } - if this.ProofWindowCloseOffsetBlocks != that1.ProofWindowCloseOffsetBlocks { - return false - } - if this.SupplierUnbondingPeriodSessions != that1.SupplierUnbondingPeriodSessions { - return false - } - if this.ApplicationUnbondingPeriodSessions != that1.ApplicationUnbondingPeriodSessions { - return false - } - if this.ComputeUnitsToTokensMultiplier != that1.ComputeUnitsToTokensMultiplier { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ComputeUnitsToTokensMultiplier != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ComputeUnitsToTokensMultiplier)) - i-- - dAtA[i] = 0x48 - } - if m.ApplicationUnbondingPeriodSessions != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ApplicationUnbondingPeriodSessions)) - i-- - dAtA[i] = 0x40 - } - if m.SupplierUnbondingPeriodSessions != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.SupplierUnbondingPeriodSessions)) - i-- - dAtA[i] = 0x38 - } - if m.ProofWindowCloseOffsetBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ProofWindowCloseOffsetBlocks)) - i-- - dAtA[i] = 0x30 - } - if m.ProofWindowOpenOffsetBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ProofWindowOpenOffsetBlocks)) - i-- - dAtA[i] = 0x28 - } - if m.ClaimWindowCloseOffsetBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowCloseOffsetBlocks)) - i-- - dAtA[i] = 0x20 - } - if m.ClaimWindowOpenOffsetBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowOpenOffsetBlocks)) - i-- - dAtA[i] = 0x18 - } - if m.GracePeriodEndOffsetBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.GracePeriodEndOffsetBlocks)) - i-- - dAtA[i] = 0x10 - } - if m.NumBlocksPerSession != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.NumBlocksPerSession)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NumBlocksPerSession != 0 { - n += 1 + sovParams(uint64(m.NumBlocksPerSession)) - } - if m.GracePeriodEndOffsetBlocks != 0 { - n += 1 + sovParams(uint64(m.GracePeriodEndOffsetBlocks)) - } - if m.ClaimWindowOpenOffsetBlocks != 0 { - n += 1 + sovParams(uint64(m.ClaimWindowOpenOffsetBlocks)) - } - if m.ClaimWindowCloseOffsetBlocks != 0 { - n += 1 + sovParams(uint64(m.ClaimWindowCloseOffsetBlocks)) - } - if m.ProofWindowOpenOffsetBlocks != 0 { - n += 1 + sovParams(uint64(m.ProofWindowOpenOffsetBlocks)) - } - if m.ProofWindowCloseOffsetBlocks != 0 { - n += 1 + sovParams(uint64(m.ProofWindowCloseOffsetBlocks)) - } - if m.SupplierUnbondingPeriodSessions != 0 { - n += 1 + sovParams(uint64(m.SupplierUnbondingPeriodSessions)) - } - if m.ApplicationUnbondingPeriodSessions != 0 { - n += 1 + sovParams(uint64(m.ApplicationUnbondingPeriodSessions)) - } - if m.ComputeUnitsToTokensMultiplier != 0 { - n += 1 + sovParams(uint64(m.ComputeUnitsToTokensMultiplier)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumBlocksPerSession", wireType) - } - m.NumBlocksPerSession = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumBlocksPerSession |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodEndOffsetBlocks", wireType) - } - m.GracePeriodEndOffsetBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GracePeriodEndOffsetBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowOpenOffsetBlocks", wireType) - } - m.ClaimWindowOpenOffsetBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClaimWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowCloseOffsetBlocks", wireType) - } - m.ClaimWindowCloseOffsetBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClaimWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofWindowOpenOffsetBlocks", wireType) - } - m.ProofWindowOpenOffsetBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProofWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofWindowCloseOffsetBlocks", wireType) - } - m.ProofWindowCloseOffsetBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProofWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierUnbondingPeriodSessions", wireType) - } - m.SupplierUnbondingPeriodSessions = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SupplierUnbondingPeriodSessions |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationUnbondingPeriodSessions", wireType) - } - m.ApplicationUnbondingPeriodSessions = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ApplicationUnbondingPeriodSessions |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnitsToTokensMultiplier", wireType) - } - m.ComputeUnitsToTokensMultiplier = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ComputeUnitsToTokensMultiplier |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/query.pb.go b/x/shared/types/query.pb.go deleted file mode 100644 index d2df1f2c8..000000000 --- a/x/shared/types/query.pb.go +++ /dev/null @@ -1,532 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6adee1148228eb7c, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6adee1148228eb7c, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.shared.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.shared.QueryParamsResponse") -} - -func init() { proto.RegisterFile("poktroll/shared/query.proto", fileDescriptor_6adee1148228eb7c) } - -var fileDescriptor_6adee1148228eb7c = []byte{ - // 324 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x31, 0x4b, 0x03, 0x41, - 0x10, 0x85, 0x6f, 0x05, 0x03, 0x9e, 0x85, 0x78, 0x06, 0x94, 0x28, 0xab, 0xc4, 0x20, 0x12, 0xf4, - 0x86, 0xc4, 0xce, 0x32, 0xbd, 0x60, 0x52, 0xda, 0xed, 0xc5, 0xe5, 0x72, 0x24, 0xb7, 0xb3, 0xd9, - 0xdd, 0xa8, 0x29, 0xb5, 0xb5, 0x11, 0xfc, 0x13, 0x96, 0xfe, 0x8c, 0x94, 0x01, 0x9b, 0x54, 0x22, - 0x17, 0xc1, 0xbf, 0x21, 0xd9, 0xbd, 0x14, 0x26, 0x6a, 0x73, 0x0c, 0xf3, 0xde, 0xfb, 0xee, 0xcd, - 0xfa, 0xbb, 0x12, 0xbb, 0x46, 0x61, 0xaf, 0x07, 0xba, 0xc3, 0x14, 0xbf, 0x86, 0xfe, 0x80, 0xab, - 0x61, 0x28, 0x15, 0x1a, 0x0c, 0x36, 0xe6, 0x62, 0xe8, 0xc4, 0xd2, 0x26, 0x4b, 0x13, 0x81, 0x60, - 0xbf, 0xce, 0x53, 0x2a, 0xc6, 0x18, 0xa3, 0x1d, 0x61, 0x36, 0xe5, 0xdb, 0xbd, 0x18, 0x31, 0xee, - 0x71, 0x60, 0x32, 0x01, 0x26, 0x04, 0x1a, 0x66, 0x12, 0x14, 0x3a, 0x57, 0xab, 0x6d, 0xd4, 0x29, - 0x6a, 0x88, 0x98, 0xe6, 0xee, 0x87, 0x70, 0x53, 0x8b, 0xb8, 0x61, 0x35, 0x90, 0x2c, 0x4e, 0x84, - 0x35, 0xcf, 0x49, 0x8b, 0x05, 0x25, 0x53, 0x2c, 0xcd, 0x49, 0xe5, 0xa2, 0x1f, 0x34, 0x67, 0xf9, - 0x4b, 0xbb, 0x6c, 0xf1, 0xfe, 0x80, 0x6b, 0x53, 0x6e, 0xfa, 0x5b, 0x3f, 0xb6, 0x5a, 0xa2, 0xd0, - 0x3c, 0x38, 0xf7, 0x0b, 0x2e, 0xbc, 0x43, 0x0e, 0xc8, 0xf1, 0x7a, 0x7d, 0x3b, 0x5c, 0xb8, 0x2f, - 0x74, 0x81, 0xc6, 0xda, 0xe8, 0x7d, 0xdf, 0x7b, 0xf9, 0x7a, 0xad, 0x92, 0x56, 0x9e, 0xa8, 0x3f, - 0x12, 0x7f, 0xd5, 0x32, 0x83, 0x7b, 0xe2, 0x17, 0x9c, 0x2f, 0x38, 0x5c, 0x02, 0x2c, 0x97, 0x29, - 0x55, 0xfe, 0x37, 0xb9, 0x6e, 0xe5, 0x93, 0x87, 0xb7, 0xcf, 0xe7, 0x95, 0xa3, 0xa0, 0x02, 0x33, - 0xf7, 0xa9, 0xe0, 0xe6, 0x16, 0x55, 0x17, 0x7e, 0x3f, 0xbe, 0x71, 0x31, 0xca, 0x28, 0x19, 0x67, - 0x94, 0x4c, 0x32, 0x4a, 0x3e, 0x32, 0x4a, 0x9e, 0xa6, 0xd4, 0x1b, 0x4f, 0xa9, 0x37, 0x99, 0x52, - 0xef, 0x0a, 0xe2, 0xc4, 0x74, 0x06, 0x51, 0xd8, 0xc6, 0xf4, 0x0f, 0xda, 0xdd, 0x9c, 0x67, 0x86, - 0x92, 0xeb, 0xa8, 0x60, 0x1f, 0xf3, 0xec, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x24, 0xe8, 0x83, 0xee, - 0x0d, 0x02, 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) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.shared.Query/Params", in, out, opts...) - 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) -} - -// 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 RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.shared.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.shared.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/shared/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 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 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 skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/query.pb.gw.go b/x/shared/types/query.pb.gw.go deleted file mode 100644 index 8fdaf9bed..000000000 --- a/x/shared/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/shared/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "shared", "params"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/x/shared/types/service.pb.go b/x/shared/types/service.pb.go deleted file mode 100644 index 1a2538f90..000000000 --- a/x/shared/types/service.pb.go +++ /dev/null @@ -1,1675 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/service.proto - -// NOTE that the `shared` package is not a Cosmos module, -// but rather a manually created package to resolve circular type dependencies. - -package types - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Enum to define RPC types -type RPCType int32 - -const ( - RPCType_UNKNOWN_RPC RPCType = 0 - RPCType_GRPC RPCType = 1 - RPCType_WEBSOCKET RPCType = 2 - RPCType_JSON_RPC RPCType = 3 - RPCType_REST RPCType = 4 -) - -var RPCType_name = map[int32]string{ - 0: "UNKNOWN_RPC", - 1: "GRPC", - 2: "WEBSOCKET", - 3: "JSON_RPC", - 4: "REST", -} - -var RPCType_value = map[string]int32{ - "UNKNOWN_RPC": 0, - "GRPC": 1, - "WEBSOCKET": 2, - "JSON_RPC": 3, - "REST": 4, -} - -func (x RPCType) String() string { - return proto.EnumName(RPCType_name, int32(x)) -} - -func (RPCType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{0} -} - -// Enum to define configuration options -// TODO_RESEARCH: Should these be configs, SLAs or something else? There will be more discussion once we get closer to implementing on-chain QoS. -type ConfigOptions int32 - -const ( - ConfigOptions_UNKNOWN_CONFIG ConfigOptions = 0 - ConfigOptions_TIMEOUT ConfigOptions = 1 -) - -var ConfigOptions_name = map[int32]string{ - 0: "UNKNOWN_CONFIG", - 1: "TIMEOUT", -} - -var ConfigOptions_value = map[string]int32{ - "UNKNOWN_CONFIG": 0, - "TIMEOUT": 1, -} - -func (x ConfigOptions) String() string { - return proto.EnumName(ConfigOptions_name, int32(x)) -} - -func (ConfigOptions) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{1} -} - -// Service message to encapsulate unique and semantic identifiers for a service on the network -type Service struct { - // For example, what if we want to request a session for a certain service but with some additional configs that identify it? - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // TODO_BETA: Either remove this or rename it to alias. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The cost of a single relay for this service in terms of compute units. - // Must be used alongside the global 'compute_units_to_tokens_multipler' to calculate the cost of a relay for this service. - // cost_per_relay_for_specific_service = compute_units_per_relay_for_specific_service * compute_units_to_tokens_multipler_global_value - ComputeUnitsPerRelay uint64 `protobuf:"varint,3,opt,name=compute_units_per_relay,json=computeUnitsPerRelay,proto3" json:"compute_units_per_relay,omitempty"` - // The owner address that created the service. - // It is the address that receives rewards based on the Service's on-chain usage - // It is the only address that can update the service configuration (e.g. compute_units_per_relay), - // or make other updates to it. - OwnerAddress string `protobuf:"bytes,4,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` -} - -func (m *Service) Reset() { *m = Service{} } -func (m *Service) String() string { return proto.CompactTextString(m) } -func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{0} -} -func (m *Service) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Service) XXX_Merge(src proto.Message) { - xxx_messageInfo_Service.Merge(m, src) -} -func (m *Service) XXX_Size() int { - return m.Size() -} -func (m *Service) XXX_DiscardUnknown() { - xxx_messageInfo_Service.DiscardUnknown(m) -} - -var xxx_messageInfo_Service proto.InternalMessageInfo - -func (m *Service) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Service) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Service) GetComputeUnitsPerRelay() uint64 { - if m != nil { - return m.ComputeUnitsPerRelay - } - return 0 -} - -func (m *Service) GetOwnerAddress() string { - if m != nil { - return m.OwnerAddress - } - return "" -} - -// ApplicationServiceConfig holds the service configuration the application stakes for -type ApplicationServiceConfig struct { - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` -} - -func (m *ApplicationServiceConfig) Reset() { *m = ApplicationServiceConfig{} } -func (m *ApplicationServiceConfig) String() string { return proto.CompactTextString(m) } -func (*ApplicationServiceConfig) ProtoMessage() {} -func (*ApplicationServiceConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{1} -} -func (m *ApplicationServiceConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ApplicationServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ApplicationServiceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplicationServiceConfig.Merge(m, src) -} -func (m *ApplicationServiceConfig) XXX_Size() int { - return m.Size() -} -func (m *ApplicationServiceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_ApplicationServiceConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_ApplicationServiceConfig proto.InternalMessageInfo - -func (m *ApplicationServiceConfig) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -// SupplierServiceConfig holds the service configuration the supplier stakes for -type SupplierServiceConfig struct { - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - Endpoints []*SupplierEndpoint `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints,omitempty"` - RevShare []*ServiceRevenueShare `protobuf:"bytes,3,rep,name=rev_share,json=revShare,proto3" json:"rev_share,omitempty"` -} - -func (m *SupplierServiceConfig) Reset() { *m = SupplierServiceConfig{} } -func (m *SupplierServiceConfig) String() string { return proto.CompactTextString(m) } -func (*SupplierServiceConfig) ProtoMessage() {} -func (*SupplierServiceConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{2} -} -func (m *SupplierServiceConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SupplierServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *SupplierServiceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_SupplierServiceConfig.Merge(m, src) -} -func (m *SupplierServiceConfig) XXX_Size() int { - return m.Size() -} -func (m *SupplierServiceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_SupplierServiceConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_SupplierServiceConfig proto.InternalMessageInfo - -func (m *SupplierServiceConfig) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *SupplierServiceConfig) GetEndpoints() []*SupplierEndpoint { - if m != nil { - return m.Endpoints - } - return nil -} - -func (m *SupplierServiceConfig) GetRevShare() []*ServiceRevenueShare { - if m != nil { - return m.RevShare - } - return nil -} - -// SupplierEndpoint message to hold service configuration details -type SupplierEndpoint struct { - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - RpcType RPCType `protobuf:"varint,2,opt,name=rpc_type,json=rpcType,proto3,enum=poktroll.shared.RPCType" json:"rpc_type,omitempty"` - Configs []*ConfigOption `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"` -} - -func (m *SupplierEndpoint) Reset() { *m = SupplierEndpoint{} } -func (m *SupplierEndpoint) String() string { return proto.CompactTextString(m) } -func (*SupplierEndpoint) ProtoMessage() {} -func (*SupplierEndpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{3} -} -func (m *SupplierEndpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SupplierEndpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *SupplierEndpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_SupplierEndpoint.Merge(m, src) -} -func (m *SupplierEndpoint) XXX_Size() int { - return m.Size() -} -func (m *SupplierEndpoint) XXX_DiscardUnknown() { - xxx_messageInfo_SupplierEndpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_SupplierEndpoint proto.InternalMessageInfo - -func (m *SupplierEndpoint) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -func (m *SupplierEndpoint) GetRpcType() RPCType { - if m != nil { - return m.RpcType - } - return RPCType_UNKNOWN_RPC -} - -func (m *SupplierEndpoint) GetConfigs() []*ConfigOption { - if m != nil { - return m.Configs - } - return nil -} - -// ServiceRevenueShare message to hold revenue share configuration details -type ServiceRevenueShare struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - RevSharePercentage float32 `protobuf:"fixed32,2,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` -} - -func (m *ServiceRevenueShare) Reset() { *m = ServiceRevenueShare{} } -func (m *ServiceRevenueShare) String() string { return proto.CompactTextString(m) } -func (*ServiceRevenueShare) ProtoMessage() {} -func (*ServiceRevenueShare) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{4} -} -func (m *ServiceRevenueShare) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceRevenueShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ServiceRevenueShare) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceRevenueShare.Merge(m, src) -} -func (m *ServiceRevenueShare) XXX_Size() int { - return m.Size() -} -func (m *ServiceRevenueShare) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceRevenueShare.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceRevenueShare proto.InternalMessageInfo - -func (m *ServiceRevenueShare) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *ServiceRevenueShare) GetRevSharePercentage() float32 { - if m != nil { - return m.RevSharePercentage - } - return 0 -} - -// Key-value wrapper for config options, as proto maps can't be keyed by enums -type ConfigOption struct { - Key ConfigOptions `protobuf:"varint,1,opt,name=key,proto3,enum=poktroll.shared.ConfigOptions" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *ConfigOption) Reset() { *m = ConfigOption{} } -func (m *ConfigOption) String() string { return proto.CompactTextString(m) } -func (*ConfigOption) ProtoMessage() {} -func (*ConfigOption) Descriptor() ([]byte, []int) { - return fileDescriptor_302c2f793a11ae1e, []int{5} -} -func (m *ConfigOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ConfigOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigOption.Merge(m, src) -} -func (m *ConfigOption) XXX_Size() int { - return m.Size() -} -func (m *ConfigOption) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigOption.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigOption proto.InternalMessageInfo - -func (m *ConfigOption) GetKey() ConfigOptions { - if m != nil { - return m.Key - } - return ConfigOptions_UNKNOWN_CONFIG -} - -func (m *ConfigOption) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -func init() { - proto.RegisterEnum("poktroll.shared.RPCType", RPCType_name, RPCType_value) - proto.RegisterEnum("poktroll.shared.ConfigOptions", ConfigOptions_name, ConfigOptions_value) - proto.RegisterType((*Service)(nil), "poktroll.shared.Service") - proto.RegisterType((*ApplicationServiceConfig)(nil), "poktroll.shared.ApplicationServiceConfig") - proto.RegisterType((*SupplierServiceConfig)(nil), "poktroll.shared.SupplierServiceConfig") - proto.RegisterType((*SupplierEndpoint)(nil), "poktroll.shared.SupplierEndpoint") - proto.RegisterType((*ServiceRevenueShare)(nil), "poktroll.shared.ServiceRevenueShare") - proto.RegisterType((*ConfigOption)(nil), "poktroll.shared.ConfigOption") -} - -func init() { proto.RegisterFile("poktroll/shared/service.proto", fileDescriptor_302c2f793a11ae1e) } - -var fileDescriptor_302c2f793a11ae1e = []byte{ - // 621 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0x26, 0x81, 0x24, 0xd3, 0x36, 0xb5, 0x86, 0x20, 0x4c, 0xa5, 0x5a, 0x25, 0xe2, 0x50, - 0x55, 0x6a, 0x52, 0xa5, 0x42, 0x88, 0x03, 0x42, 0x6d, 0x14, 0xaa, 0x52, 0x35, 0x89, 0xd6, 0x29, - 0x95, 0xb8, 0x58, 0xae, 0xbd, 0xa4, 0x56, 0x13, 0xaf, 0xb5, 0xb6, 0x53, 0x22, 0x7e, 0x02, 0xf1, - 0x0b, 0xfc, 0x02, 0x27, 0xbe, 0x80, 0x63, 0xc5, 0xa9, 0x47, 0x94, 0xfe, 0x08, 0x5a, 0xaf, 0x1d, - 0xa0, 0x41, 0x20, 0x6e, 0xe3, 0x79, 0x6f, 0x66, 0xde, 0xbe, 0x1d, 0x2f, 0xac, 0x07, 0xfc, 0x22, - 0x12, 0x7c, 0x34, 0x6a, 0x86, 0xe7, 0xb6, 0x60, 0x6e, 0x33, 0x64, 0x62, 0xe2, 0x39, 0xac, 0x11, - 0x08, 0x1e, 0x71, 0x5c, 0xcd, 0xe0, 0x86, 0x82, 0xd7, 0x1e, 0x3a, 0x3c, 0x1c, 0xf3, 0xd0, 0x4a, - 0xe0, 0xa6, 0xfa, 0x50, 0xdc, 0xb5, 0xda, 0x90, 0x0f, 0xb9, 0xca, 0xcb, 0x48, 0x65, 0xeb, 0x9f, - 0x08, 0x94, 0x4c, 0xd5, 0x13, 0xab, 0x90, 0xf7, 0x5c, 0x9d, 0x6c, 0x90, 0xcd, 0x0a, 0xcd, 0x7b, - 0x2e, 0x22, 0x14, 0x7d, 0x7b, 0xcc, 0xf4, 0x7c, 0x92, 0x49, 0x62, 0x7c, 0x02, 0x0f, 0x1c, 0x3e, - 0x0e, 0xe2, 0x88, 0x59, 0xb1, 0xef, 0x45, 0xa1, 0x15, 0x30, 0x61, 0x09, 0x36, 0xb2, 0xa7, 0x7a, - 0x61, 0x83, 0x6c, 0x16, 0x69, 0x2d, 0x85, 0x4f, 0x24, 0xda, 0x67, 0x82, 0x4a, 0x0c, 0x9f, 0xc3, - 0x0a, 0xbf, 0xf4, 0x99, 0xb0, 0x6c, 0xd7, 0x15, 0x2c, 0x0c, 0xf5, 0xa2, 0xec, 0xb9, 0xaf, 0x7f, - 0xfb, 0xbc, 0x5d, 0x4b, 0x55, 0xee, 0x29, 0xc4, 0x8c, 0x84, 0xe7, 0x0f, 0xe9, 0x72, 0x42, 0x4f, - 0x73, 0xf5, 0x67, 0xa0, 0xef, 0x05, 0xc1, 0xc8, 0x73, 0xec, 0xc8, 0xe3, 0x7e, 0xaa, 0xb7, 0xcd, - 0xfd, 0xb7, 0xde, 0x10, 0xd7, 0x01, 0x52, 0x53, 0xac, 0xb9, 0xfa, 0x4a, 0x9a, 0x39, 0x74, 0xeb, - 0x5f, 0x08, 0xdc, 0x37, 0x63, 0x59, 0xcc, 0xc4, 0xff, 0x14, 0xe2, 0x0b, 0xa8, 0x30, 0xdf, 0x0d, - 0xb8, 0xe7, 0x47, 0xa1, 0x9e, 0xdf, 0x28, 0x6c, 0x2e, 0xb5, 0x1e, 0x35, 0x6e, 0xf9, 0xdd, 0xc8, - 0x3a, 0x77, 0x52, 0x26, 0xfd, 0x59, 0x83, 0x7b, 0x50, 0x11, 0x6c, 0x62, 0x25, 0x4c, 0xbd, 0x90, - 0x34, 0x78, 0xbc, 0xd8, 0x40, 0xcd, 0xa3, 0x6c, 0xc2, 0xfc, 0x98, 0x99, 0x32, 0x49, 0xcb, 0x82, - 0x4d, 0x92, 0xa8, 0xfe, 0x91, 0x80, 0x76, 0x7b, 0x04, 0x6a, 0x50, 0x88, 0xc5, 0x28, 0x15, 0x2c, - 0x43, 0xdc, 0x85, 0xb2, 0x08, 0x1c, 0x2b, 0x9a, 0x06, 0xea, 0xb2, 0xaa, 0x2d, 0x7d, 0x61, 0x10, - 0xed, 0xb7, 0x07, 0xd3, 0x80, 0xd1, 0x92, 0x08, 0x1c, 0x19, 0xe0, 0x53, 0x28, 0x39, 0x89, 0x11, - 0x61, 0x2a, 0x6e, 0x7d, 0xa1, 0x46, 0x19, 0xd5, 0x0b, 0xa4, 0xe9, 0x34, 0x63, 0xd7, 0xdf, 0xc3, - 0xbd, 0x3f, 0xa8, 0xc6, 0x16, 0x94, 0xb2, 0xcb, 0x25, 0xff, 0xb8, 0xdc, 0x8c, 0x88, 0x3b, 0x50, - 0x9b, 0x5b, 0x24, 0x37, 0xc9, 0x61, 0x7e, 0x64, 0x0f, 0xd5, 0x21, 0xf2, 0x14, 0x33, 0x1f, 0xfa, - 0x73, 0xa4, 0xfe, 0x1a, 0x96, 0x7f, 0x55, 0x85, 0x3b, 0x50, 0xb8, 0x60, 0xd3, 0x64, 0x62, 0xb5, - 0x65, 0xfc, 0xf5, 0x04, 0x21, 0x95, 0x54, 0xac, 0xc1, 0x9d, 0x89, 0x3d, 0x8a, 0xb3, 0xb5, 0x56, - 0x1f, 0x5b, 0x47, 0x50, 0x4a, 0x1d, 0xc2, 0x55, 0x58, 0x3a, 0xe9, 0x1e, 0x75, 0x7b, 0xa7, 0x5d, - 0x8b, 0xf6, 0xdb, 0x5a, 0x0e, 0xcb, 0x50, 0x3c, 0x90, 0x11, 0xc1, 0x15, 0xa8, 0x9c, 0x76, 0xf6, - 0xcd, 0x5e, 0xfb, 0xa8, 0x33, 0xd0, 0xf2, 0xb8, 0x0c, 0xe5, 0x57, 0x66, 0x4f, 0xd1, 0x0a, 0x92, - 0x46, 0x3b, 0xe6, 0x40, 0x2b, 0x6e, 0xed, 0xc0, 0xca, 0x6f, 0x83, 0x11, 0xa1, 0x9a, 0xb5, 0x6c, - 0xf7, 0xba, 0x2f, 0x0f, 0x0f, 0xb4, 0x1c, 0x2e, 0x41, 0x69, 0x70, 0x78, 0xdc, 0xe9, 0x9d, 0x0c, - 0x34, 0xb2, 0x7f, 0xfc, 0x75, 0x66, 0x90, 0xab, 0x99, 0x41, 0xae, 0x67, 0x06, 0xf9, 0x3e, 0x33, - 0xc8, 0x87, 0x1b, 0x23, 0x77, 0x75, 0x63, 0xe4, 0xae, 0x6f, 0x8c, 0xdc, 0x9b, 0xe6, 0xd0, 0x8b, - 0xce, 0xe3, 0xb3, 0x86, 0xc3, 0xc7, 0x4d, 0x79, 0xc2, 0x6d, 0x9f, 0x45, 0x97, 0x5c, 0x5c, 0x34, - 0xe7, 0xaf, 0xc3, 0xbb, 0xec, 0x7d, 0x90, 0x3b, 0x10, 0x9e, 0xdd, 0x4d, 0x7e, 0xee, 0xdd, 0x1f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x19, 0xf1, 0x60, 0x3f, 0x04, 0x00, 0x00, -} - -func (m *Service) 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 *Service) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintService(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0x22 - } - if m.ComputeUnitsPerRelay != 0 { - i = encodeVarintService(dAtA, i, uint64(m.ComputeUnitsPerRelay)) - i-- - dAtA[i] = 0x18 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintService(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintService(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ApplicationServiceConfig) 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 *ApplicationServiceConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ApplicationServiceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintService(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SupplierServiceConfig) 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 *SupplierServiceConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SupplierServiceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RevShare) > 0 { - for iNdEx := len(m.RevShare) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RevShare[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Endpoints) > 0 { - for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintService(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SupplierEndpoint) 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 *SupplierEndpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SupplierEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Configs) > 0 { - for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.RpcType != 0 { - i = encodeVarintService(dAtA, i, uint64(m.RpcType)) - i-- - dAtA[i] = 0x10 - } - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintService(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceRevenueShare) 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 *ServiceRevenueShare) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceRevenueShare) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RevSharePercentage != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.RevSharePercentage)))) - i-- - dAtA[i] = 0x15 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintService(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConfigOption) 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 *ConfigOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintService(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if m.Key != 0 { - i = encodeVarintService(dAtA, i, uint64(m.Key)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintService(dAtA []byte, offset int, v uint64) int { - offset -= sovService(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Service) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - if m.ComputeUnitsPerRelay != 0 { - n += 1 + sovService(uint64(m.ComputeUnitsPerRelay)) - } - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - return n -} - -func (m *ApplicationServiceConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - return n -} - -func (m *SupplierServiceConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - if len(m.Endpoints) > 0 { - for _, e := range m.Endpoints { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - if len(m.RevShare) > 0 { - for _, e := range m.RevShare { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n -} - -func (m *SupplierEndpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Url) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - if m.RpcType != 0 { - n += 1 + sovService(uint64(m.RpcType)) - } - if len(m.Configs) > 0 { - for _, e := range m.Configs { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n -} - -func (m *ServiceRevenueShare) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - if m.RevSharePercentage != 0 { - n += 5 - } - return n -} - -func (m *ConfigOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Key != 0 { - n += 1 + sovService(uint64(m.Key)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - return n -} - -func sovService(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozService(x uint64) (n int) { - return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Service) 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 ErrIntOverflowService - } - 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: Service: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnitsPerRelay", wireType) - } - m.ComputeUnitsPerRelay = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ComputeUnitsPerRelay |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ApplicationServiceConfig) 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 ErrIntOverflowService - } - 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: ApplicationServiceConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ApplicationServiceConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SupplierServiceConfig) 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 ErrIntOverflowService - } - 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: SupplierServiceConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SupplierServiceConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthService - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Endpoints = append(m.Endpoints, &SupplierEndpoint{}) - if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RevShare", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthService - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RevShare = append(m.RevShare, &ServiceRevenueShare{}) - if err := m.RevShare[len(m.RevShare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SupplierEndpoint) 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 ErrIntOverflowService - } - 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: SupplierEndpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SupplierEndpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Url = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RpcType", wireType) - } - m.RpcType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RpcType |= RPCType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthService - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Configs = append(m.Configs, &ConfigOption{}) - if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceRevenueShare) 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 ErrIntOverflowService - } - 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: ServiceRevenueShare: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceRevenueShare: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field RevSharePercentage", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.RevSharePercentage = float32(math.Float32frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfigOption) 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 ErrIntOverflowService - } - 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: ConfigOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - m.Key = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Key |= ConfigOptions(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - 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 ErrInvalidLengthService - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipService(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, ErrIntOverflowService - } - 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, ErrIntOverflowService - } - 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, ErrIntOverflowService - } - 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, ErrInvalidLengthService - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupService - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthService - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowService = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/supplier.pb.go b/x/shared/types/supplier.pb.go deleted file mode 100644 index 2a062c371..000000000 --- a/x/shared/types/supplier.pb.go +++ /dev/null @@ -1,706 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/supplier.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" - 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 - -// Supplier is the type defining the actor in Pocket Network that provides RPC services. -type Supplier struct { - // The address of the owner (i.e. staker, custodial) that owns the funds for staking. - // By default, this address is the one that receives all the rewards unless owtherwise specified. - // This property cannot be updated by the operator. - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - // The operator address of the supplier operator (i.e. the one managing the off-chain server). - // The operator address can update the supplier's configurations excluding the owner address. - // This property does not change over the supplier's lifespan, the supplier must be unstaked - // and re-staked to effectively update this value. - OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - Stake *types.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` - // The session end height at which an actively unbonding supplier unbonds its stake. - // If the supplier did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` - // services_activation_heights_map is a map of serviceIds to the height at - // which the staked supplier will become active for that service. - // Activation heights are session start heights. - ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,6,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (m *Supplier) Reset() { *m = Supplier{} } -func (m *Supplier) String() string { return proto.CompactTextString(m) } -func (*Supplier) ProtoMessage() {} -func (*Supplier) Descriptor() ([]byte, []int) { - return fileDescriptor_4a189b52ba503cf2, []int{0} -} -func (m *Supplier) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Supplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Supplier) XXX_Merge(src proto.Message) { - xxx_messageInfo_Supplier.Merge(m, src) -} -func (m *Supplier) XXX_Size() int { - return m.Size() -} -func (m *Supplier) XXX_DiscardUnknown() { - xxx_messageInfo_Supplier.DiscardUnknown(m) -} - -var xxx_messageInfo_Supplier proto.InternalMessageInfo - -func (m *Supplier) GetOwnerAddress() string { - if m != nil { - return m.OwnerAddress - } - return "" -} - -func (m *Supplier) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -func (m *Supplier) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -func (m *Supplier) GetServices() []*SupplierServiceConfig { - if m != nil { - return m.Services - } - return nil -} - -func (m *Supplier) GetUnstakeSessionEndHeight() uint64 { - if m != nil { - return m.UnstakeSessionEndHeight - } - return 0 -} - -func (m *Supplier) GetServicesActivationHeightsMap() map[string]uint64 { - if m != nil { - return m.ServicesActivationHeightsMap - } - return nil -} - -func init() { - proto.RegisterType((*Supplier)(nil), "poktroll.shared.Supplier") - proto.RegisterMapType((map[string]uint64)(nil), "poktroll.shared.Supplier.ServicesActivationHeightsMapEntry") -} - -func init() { proto.RegisterFile("poktroll/shared/supplier.proto", fileDescriptor_4a189b52ba503cf2) } - -var fileDescriptor_4a189b52ba503cf2 = []byte{ - // 453 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xbf, 0x6e, 0x13, 0x31, - 0x18, 0x8f, 0x9b, 0xa4, 0x2a, 0x2e, 0xa8, 0xd5, 0x29, 0x12, 0xd7, 0x08, 0x4c, 0x60, 0x40, 0x59, - 0x6a, 0xab, 0x65, 0x41, 0x54, 0x0c, 0x4d, 0x54, 0x89, 0xa5, 0x42, 0xba, 0x6c, 0x2c, 0x27, 0x27, - 0x67, 0x2e, 0x56, 0x12, 0x7f, 0x27, 0x7f, 0x4e, 0x4a, 0x56, 0x9e, 0x80, 0x89, 0x27, 0xe1, 0x21, - 0x18, 0x2b, 0xa6, 0x8e, 0x28, 0x79, 0x11, 0x74, 0x67, 0x5f, 0x90, 0x40, 0xd0, 0xcd, 0x9f, 0x7f, - 0x7f, 0xee, 0xf7, 0x3b, 0x7f, 0x94, 0x15, 0x30, 0x73, 0x16, 0xe6, 0x73, 0x81, 0x53, 0x69, 0x55, - 0x26, 0x70, 0x59, 0x14, 0x73, 0xad, 0x2c, 0x2f, 0x2c, 0x38, 0x88, 0x8e, 0x6a, 0x9c, 0x7b, 0xbc, - 0x7b, 0x32, 0x01, 0x5c, 0x00, 0xa6, 0x15, 0x2c, 0xfc, 0xe0, 0xb9, 0x5d, 0xe6, 0x27, 0x31, 0x96, - 0xa8, 0xc4, 0xea, 0x6c, 0xac, 0x9c, 0x3c, 0x13, 0x13, 0xd0, 0x26, 0xe0, 0x4f, 0xff, 0xfa, 0x96, - 0xb2, 0x2b, 0x3d, 0x51, 0x01, 0xee, 0xe4, 0x90, 0x83, 0xb7, 0x2d, 0x4f, 0xfe, 0xf6, 0xc5, 0xd7, - 0x16, 0x3d, 0x18, 0x85, 0x4c, 0xd1, 0x5b, 0xfa, 0x08, 0x6e, 0x8c, 0xb2, 0xa9, 0xcc, 0x32, 0xab, - 0x10, 0x63, 0xd2, 0x23, 0xfd, 0x07, 0x83, 0xf8, 0xc7, 0xb7, 0xd3, 0x4e, 0x88, 0x72, 0xe9, 0x91, - 0x91, 0xb3, 0xda, 0xe4, 0xc9, 0xc3, 0x8a, 0x1e, 0xee, 0xa2, 0x21, 0x3d, 0x86, 0x42, 0x59, 0xe9, - 0xe0, 0xb7, 0xc3, 0xde, 0x3d, 0x0e, 0x47, 0xb5, 0xa2, 0x36, 0x11, 0xb4, 0x8d, 0x4e, 0xce, 0x54, - 0xdc, 0xec, 0x91, 0xfe, 0xe1, 0xf9, 0x09, 0x0f, 0xb2, 0xb2, 0x35, 0x0f, 0xad, 0xf9, 0x10, 0xb4, - 0x49, 0x3c, 0x2f, 0x1a, 0xd0, 0x83, 0x50, 0x14, 0xe3, 0x56, 0xaf, 0xd9, 0x3f, 0x3c, 0x7f, 0xc9, - 0xff, 0xf8, 0xab, 0xbc, 0x6e, 0x38, 0xf2, 0xc4, 0x21, 0x98, 0x8f, 0x3a, 0x4f, 0x76, 0xba, 0xe8, - 0x82, 0x76, 0x97, 0xa6, 0xb2, 0x4b, 0x51, 0x21, 0x6a, 0x30, 0xa9, 0x32, 0x59, 0x3a, 0x55, 0x3a, - 0x9f, 0xba, 0xb8, 0xdd, 0x23, 0xfd, 0x56, 0xf2, 0x38, 0x30, 0x46, 0x9e, 0x70, 0x65, 0xb2, 0x77, - 0x15, 0x1c, 0x7d, 0x26, 0xf4, 0x59, 0xed, 0x94, 0xca, 0x89, 0xd3, 0x2b, 0xe9, 0x4a, 0x07, 0xaf, - 0xc6, 0x74, 0x21, 0x8b, 0x78, 0xbf, 0x0a, 0x76, 0xf1, 0xcf, 0x60, 0x3c, 0x24, 0xc3, 0xcb, 0x9d, - 0xde, 0xbb, 0xe3, 0xb5, 0x2c, 0xae, 0x8c, 0xb3, 0xeb, 0xe4, 0x09, 0xfe, 0x87, 0xd2, 0x7d, 0x4f, - 0x9f, 0xdf, 0x6b, 0x11, 0x1d, 0xd3, 0xe6, 0x4c, 0xad, 0xfd, 0xab, 0x26, 0xe5, 0x31, 0xea, 0xd0, - 0xf6, 0x4a, 0xce, 0x97, 0xaa, 0x7a, 0xa7, 0x56, 0xe2, 0x87, 0x37, 0x7b, 0xaf, 0xc9, 0xe0, 0xfa, - 0xfb, 0x86, 0x91, 0xdb, 0x0d, 0x23, 0x77, 0x1b, 0x46, 0x7e, 0x6e, 0x18, 0xf9, 0xb2, 0x65, 0x8d, - 0xdb, 0x2d, 0x6b, 0xdc, 0x6d, 0x59, 0xe3, 0x83, 0xc8, 0xb5, 0x9b, 0x2e, 0xc7, 0x7c, 0x02, 0x0b, - 0x51, 0x76, 0x3a, 0x35, 0xca, 0xdd, 0x80, 0x9d, 0x89, 0xdd, 0x0e, 0x7e, 0xaa, 0xb7, 0xd0, 0xad, - 0x0b, 0x85, 0xe3, 0xfd, 0x6a, 0xdd, 0x5e, 0xfd, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x51, 0xcd, 0x0a, - 0x68, 0x11, 0x03, 0x00, 0x00, -} - -func (m *Supplier) 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 *Supplier) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServicesActivationHeightsMap) > 0 { - keysForServicesActivationHeightsMap := make([]string, 0, len(m.ServicesActivationHeightsMap)) - for k := range m.ServicesActivationHeightsMap { - keysForServicesActivationHeightsMap = append(keysForServicesActivationHeightsMap, string(k)) - } - github_com_cosmos_gogoproto_sortkeys.Strings(keysForServicesActivationHeightsMap) - for iNdEx := len(keysForServicesActivationHeightsMap) - 1; iNdEx >= 0; iNdEx-- { - v := m.ServicesActivationHeightsMap[string(keysForServicesActivationHeightsMap[iNdEx])] - baseI := i - i = encodeVarintSupplier(dAtA, i, uint64(v)) - i-- - dAtA[i] = 0x10 - i -= len(keysForServicesActivationHeightsMap[iNdEx]) - copy(dAtA[i:], keysForServicesActivationHeightsMap[iNdEx]) - i = encodeVarintSupplier(dAtA, i, uint64(len(keysForServicesActivationHeightsMap[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintSupplier(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if m.UnstakeSessionEndHeight != 0 { - i = encodeVarintSupplier(dAtA, i, uint64(m.UnstakeSessionEndHeight)) - i-- - dAtA[i] = 0x28 - } - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSupplier(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSupplier(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintSupplier(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintSupplier(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSupplier(dAtA []byte, offset int, v uint64) int { - offset -= sovSupplier(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Supplier) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovSupplier(uint64(l)) - } - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovSupplier(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovSupplier(uint64(l)) - } - if len(m.Services) > 0 { - for _, e := range m.Services { - l = e.Size() - n += 1 + l + sovSupplier(uint64(l)) - } - } - if m.UnstakeSessionEndHeight != 0 { - n += 1 + sovSupplier(uint64(m.UnstakeSessionEndHeight)) - } - if len(m.ServicesActivationHeightsMap) > 0 { - for k, v := range m.ServicesActivationHeightsMap { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovSupplier(uint64(len(k))) + 1 + sovSupplier(uint64(v)) - n += mapEntrySize + 1 + sovSupplier(uint64(mapEntrySize)) - } - } - return n -} - -func sovSupplier(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSupplier(x uint64) (n int) { - return sovSupplier(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Supplier) 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 ErrIntOverflowSupplier - } - 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: Supplier: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Supplier: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - 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 ErrInvalidLengthSupplier - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSupplier - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - 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 ErrInvalidLengthSupplier - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSupplier - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSupplier - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSupplier - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSupplier - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSupplier - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, &SupplierServiceConfig{}) - if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) - } - m.UnstakeSessionEndHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnstakeSessionEndHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServicesActivationHeightsMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSupplier - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSupplier - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ServicesActivationHeightsMap == nil { - m.ServicesActivationHeightsMap = make(map[string]uint64) - } - var mapkey string - var mapvalue uint64 - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthSupplier - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSupplier - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSupplier - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else { - iNdEx = entryPreIndex - skippy, err := skipSupplier(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSupplier - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.ServicesActivationHeightsMap[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSupplier(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSupplier - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSupplier(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, ErrIntOverflowSupplier - } - 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, ErrIntOverflowSupplier - } - 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, ErrIntOverflowSupplier - } - 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, ErrInvalidLengthSupplier - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSupplier - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSupplier - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSupplier = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSupplier = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSupplier = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/shared/types/tx.pb.go b/x/shared/types/tx.pb.go deleted file mode 100644 index 553ff6736..000000000 --- a/x/shared/types/tx.pb.go +++ /dev/null @@ -1,1262 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/shared/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_3f2a7564b43f4d89, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f2a7564b43f4d89, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. -type MsgUpdateParam struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to AsType: - // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 - // *MsgUpdateParam_AsBytes - AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` -} - -func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } -func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParam) ProtoMessage() {} -func (*MsgUpdateParam) Descriptor() ([]byte, []int) { - return fileDescriptor_3f2a7564b43f4d89, []int{2} -} -func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParam.Merge(m, src) -} -func (m *MsgUpdateParam) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParam) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo - -type isMsgUpdateParam_AsType interface { - isMsgUpdateParam_AsType() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgUpdateParam_AsString struct { - AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` -} -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` -} -type MsgUpdateParam_AsBytes struct { - AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` -} - -func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} - -func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { - if m != nil { - return m.AsType - } - return nil -} - -func (m *MsgUpdateParam) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpdateParam) GetAsString() string { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { - return x.AsString - } - return "" -} - -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 - } - return 0 -} - -func (m *MsgUpdateParam) GetAsBytes() []byte { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { - return x.AsBytes - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), - (*MsgUpdateParam_AsBytes)(nil), - } -} - -// MsgUpdateParamResponse defines the response structure for executing a -// MsgUpdateParam message after a single param update. -type MsgUpdateParamResponse struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } -func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamResponse) ProtoMessage() {} -func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f2a7564b43f4d89, []int{3} -} -func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) -} -func (m *MsgUpdateParamResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo - -func (m *MsgUpdateParamResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.shared.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.shared.MsgUpdateParamsResponse") - proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.shared.MsgUpdateParam") - proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.shared.MsgUpdateParamResponse") -} - -func init() { proto.RegisterFile("poktroll/shared/tx.proto", fileDescriptor_3f2a7564b43f4d89) } - -var fileDescriptor_3f2a7564b43f4d89 = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xf6, 0x11, 0x48, 0xea, 0x6b, 0x68, 0x85, 0x55, 0x11, 0xd7, 0x42, 0x8e, 0xc9, 0x82, 0x89, - 0xa8, 0x4f, 0x94, 0xaa, 0x43, 0x36, 0x3c, 0xb5, 0x43, 0x24, 0x64, 0x84, 0x90, 0xba, 0x44, 0x97, - 0xc6, 0x72, 0xac, 0xd6, 0x3e, 0xcb, 0xef, 0x0a, 0xcd, 0x86, 0x18, 0x99, 0xf8, 0x33, 0x18, 0x33, - 0xb0, 0x31, 0xb1, 0x75, 0xac, 0x98, 0x3a, 0x45, 0x28, 0x19, 0x22, 0xf5, 0x5f, 0x60, 0x41, 0x3e, - 0xff, 0x08, 0x71, 0x24, 0x22, 0x75, 0x49, 0xde, 0x7d, 0xdf, 0xf7, 0xbe, 0x7b, 0xef, 0xde, 0x33, - 0x56, 0x23, 0x76, 0xc6, 0x63, 0x76, 0x7e, 0x4e, 0x60, 0x48, 0x63, 0x77, 0x40, 0xf8, 0xa5, 0x15, - 0xc5, 0x8c, 0x33, 0x65, 0x3b, 0x67, 0xac, 0x94, 0xd1, 0x1e, 0xd1, 0xc0, 0x0f, 0x19, 0x11, 0xbf, - 0xa9, 0x46, 0x6b, 0x9c, 0x32, 0x08, 0x18, 0x90, 0x00, 0x3c, 0xf2, 0xe1, 0x65, 0xf2, 0x97, 0x11, - 0xbb, 0x29, 0xd1, 0x13, 0x27, 0x92, 0x1e, 0x32, 0x6a, 0xc7, 0x63, 0x1e, 0x4b, 0xf1, 0x24, 0xca, - 0xd0, 0x27, 0xe5, 0x3a, 0x22, 0x1a, 0xd3, 0x20, 0xcb, 0x69, 0xfd, 0x40, 0x78, 0xbb, 0x0b, 0xde, - 0xbb, 0x68, 0x40, 0xb9, 0xfb, 0x46, 0x30, 0xca, 0x21, 0x96, 0xe9, 0x05, 0x1f, 0xb2, 0xd8, 0xe7, - 0x23, 0x15, 0x19, 0xc8, 0x94, 0x6d, 0xf5, 0xd7, 0xf7, 0xbd, 0x9d, 0xec, 0xb2, 0xd7, 0x83, 0x41, - 0xec, 0x02, 0xbc, 0xe5, 0xb1, 0x1f, 0x7a, 0xce, 0x42, 0xaa, 0x74, 0x70, 0x35, 0xf5, 0x56, 0xef, - 0x19, 0xc8, 0xdc, 0xdc, 0x6f, 0x58, 0xa5, 0x46, 0xad, 0xf4, 0x02, 0x5b, 0xbe, 0x9a, 0x34, 0xa5, - 0x6f, 0xf3, 0x71, 0x1b, 0x39, 0x59, 0x46, 0xe7, 0xe0, 0xf3, 0x7c, 0xdc, 0x5e, 0x78, 0x7d, 0x99, - 0x8f, 0xdb, 0x4f, 0x8b, 0xc2, 0x2f, 0xf3, 0xd2, 0x4b, 0x95, 0xb6, 0x76, 0x71, 0xa3, 0x04, 0x39, - 0x2e, 0x44, 0x2c, 0x04, 0xb7, 0xf5, 0x07, 0xe1, 0xad, 0x65, 0xee, 0xce, 0x7d, 0x29, 0xf8, 0x7e, - 0x48, 0x03, 0x57, 0x74, 0x25, 0x3b, 0x22, 0x56, 0x5e, 0x60, 0x99, 0x42, 0x0f, 0x84, 0x56, 0xad, - 0x08, 0xaf, 0x87, 0xb7, 0x93, 0xe6, 0x02, 0x3c, 0x92, 0x9c, 0x0d, 0x9a, 0x99, 0x29, 0xcf, 0xf1, - 0x06, 0x85, 0x9e, 0x1f, 0xf2, 0xc3, 0x03, 0xb5, 0x6a, 0x20, 0xb3, 0x62, 0xd7, 0x6f, 0x27, 0xcd, - 0x02, 0x3b, 0x92, 0x9c, 0x1a, 0x85, 0xe3, 0x24, 0xcc, 0xa4, 0xfd, 0x11, 0x77, 0x41, 0xad, 0x19, - 0xc8, 0xac, 0x17, 0x52, 0x81, 0xa5, 0x52, 0x3b, 0x09, 0x3b, 0x5b, 0xcb, 0x6f, 0x66, 0xcb, 0xb8, - 0x46, 0xa1, 0xc7, 0x47, 0x91, 0xdb, 0x3a, 0xc6, 0x8f, 0x97, 0x9b, 0xcf, 0xdf, 0x45, 0x21, 0xc5, - 0x90, 0xd0, 0x7f, 0x87, 0x94, 0x4f, 0x66, 0xff, 0x27, 0xc2, 0x95, 0x2e, 0x78, 0xca, 0x09, 0xae, - 0x2f, 0x6d, 0x89, 0xb1, 0x92, 0x58, 0x1a, 0x85, 0x66, 0xae, 0x53, 0x14, 0x45, 0xbd, 0xc7, 0x9b, - 0xff, 0x0e, 0xaa, 0xb9, 0x26, 0x51, 0x7b, 0xb6, 0x46, 0x90, 0x1b, 0x6b, 0x0f, 0x3e, 0x25, 0x5b, - 0x66, 0x77, 0xaf, 0xa6, 0x3a, 0xba, 0x9e, 0xea, 0xe8, 0x66, 0xaa, 0xa3, 0xdf, 0x53, 0x1d, 0x7d, - 0x9d, 0xe9, 0xd2, 0xf5, 0x4c, 0x97, 0x6e, 0x66, 0xba, 0x74, 0x42, 0x3c, 0x9f, 0x0f, 0x2f, 0xfa, - 0xd6, 0x29, 0x0b, 0x48, 0xe2, 0xbb, 0x17, 0xba, 0xfc, 0x23, 0x8b, 0xcf, 0xc8, 0xea, 0x02, 0x26, - 0x8f, 0x0b, 0xfd, 0xaa, 0xf8, 0x76, 0x5e, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x90, 0x6c, 0xe9, - 0x9c, 0xe3, 0x03, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.shared.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, "/poktroll.shared.Msg/UpdateParam", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.shared.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.shared.Msg/UpdateParam", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.shared.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/shared/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AsType != nil { - { - size := m.AsType.Size() - i -= size - if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.AsString) - copy(dAtA[i:], m.AsString) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.AsBytes != nil { - i -= len(m.AsBytes) - copy(dAtA[i:], m.AsBytes) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.AsType != nil { - n += m.AsType.Size() - } - return n -} - -func (m *MsgUpdateParam_AsString) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AsString) - n += 1 + l + sovTx(uint64(l)) - return n -} -func (m *MsgUpdateParam_AsInt64) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.AsInt64)) - return n -} -func (m *MsgUpdateParam_AsBytes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AsBytes != nil { - l = len(m.AsBytes) - n += 1 + l + sovTx(uint64(l)) - } - return n -} -func (m *MsgUpdateParamResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParam) 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 ErrIntOverflowTx - } - 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: MsgUpdateParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AsType = &MsgUpdateParam_AsInt64{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.AsType = &MsgUpdateParam_AsBytes{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index fa530172c..e6c04685f 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -69,8 +69,10 @@ func (k msgServer) UnstakeSupplier( supplier.UnstakeSessionEndHeight = uint64(shared.GetSessionEndHeight(&sharedParams, currentHeight)) k.SetSupplier(ctx, supplier) + unbondingHeight := shared.GetSupplierUnbondingHeight(&sharedParams, &supplier) event := &types.EventSupplierUnbondingBegin{ - Supplier: &supplier, + Supplier: &supplier, + UnbondingHeight: unbondingHeight, } if eventErr := sdkCtx.EventManager().EmitTypedEvent(event); eventErr != nil { logger.Error(fmt.Sprintf("failed to emit event: %+v; %s", event, eventErr)) diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index 62ba7a601..24f4f2dd0 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -70,7 +70,8 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { logger.Info(fmt.Sprintf("Successfully removed the supplier: %+v", supplier)) event := &types.EventSupplierUnbondingEnd{ - Supplier: &supplier, + Supplier: &supplier, + UnbondingHeight: unbondingHeight, } if eventErr := sdkCtx.EventManager().EmitTypedEvent(event); eventErr != nil { logger.Error(fmt.Sprintf("failed to emit event: %+v; %s", event, eventErr)) diff --git a/x/supplier/types/event.pb.go b/x/supplier/types/event.pb.go deleted file mode 100644 index ede1d3985..000000000 --- a/x/supplier/types/event.pb.go +++ /dev/null @@ -1,682 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/supplier/event.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/shared/types" - 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 - -// EventSupplierStaked is emitted with the commitment of the supplier is stake message. -type EventSupplierStaked struct { - Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` -} - -func (m *EventSupplierStaked) Reset() { *m = EventSupplierStaked{} } -func (m *EventSupplierStaked) String() string { return proto.CompactTextString(m) } -func (*EventSupplierStaked) ProtoMessage() {} -func (*EventSupplierStaked) Descriptor() ([]byte, []int) { - return fileDescriptor_22d2d1a82853ce0a, []int{0} -} -func (m *EventSupplierStaked) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSupplierStaked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventSupplierStaked) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSupplierStaked.Merge(m, src) -} -func (m *EventSupplierStaked) XXX_Size() int { - return m.Size() -} -func (m *EventSupplierStaked) XXX_DiscardUnknown() { - xxx_messageInfo_EventSupplierStaked.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSupplierStaked proto.InternalMessageInfo - -func (m *EventSupplierStaked) GetSupplier() *types.Supplier { - if m != nil { - return m.Supplier - } - return nil -} - -// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. -type EventSupplierUnbondingBegin struct { - Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` -} - -func (m *EventSupplierUnbondingBegin) Reset() { *m = EventSupplierUnbondingBegin{} } -func (m *EventSupplierUnbondingBegin) String() string { return proto.CompactTextString(m) } -func (*EventSupplierUnbondingBegin) ProtoMessage() {} -func (*EventSupplierUnbondingBegin) Descriptor() ([]byte, []int) { - return fileDescriptor_22d2d1a82853ce0a, []int{1} -} -func (m *EventSupplierUnbondingBegin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSupplierUnbondingBegin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventSupplierUnbondingBegin) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSupplierUnbondingBegin.Merge(m, src) -} -func (m *EventSupplierUnbondingBegin) XXX_Size() int { - return m.Size() -} -func (m *EventSupplierUnbondingBegin) XXX_DiscardUnknown() { - xxx_messageInfo_EventSupplierUnbondingBegin.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSupplierUnbondingBegin proto.InternalMessageInfo - -func (m *EventSupplierUnbondingBegin) GetSupplier() *types.Supplier { - if m != nil { - return m.Supplier - } - return nil -} - -// EventSupplierUnbondingEnd is emitted with the commitment of last block of the -// supplier unbonding period. -type EventSupplierUnbondingEnd struct { - Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` -} - -func (m *EventSupplierUnbondingEnd) Reset() { *m = EventSupplierUnbondingEnd{} } -func (m *EventSupplierUnbondingEnd) String() string { return proto.CompactTextString(m) } -func (*EventSupplierUnbondingEnd) ProtoMessage() {} -func (*EventSupplierUnbondingEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_22d2d1a82853ce0a, []int{2} -} -func (m *EventSupplierUnbondingEnd) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSupplierUnbondingEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventSupplierUnbondingEnd) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSupplierUnbondingEnd.Merge(m, src) -} -func (m *EventSupplierUnbondingEnd) XXX_Size() int { - return m.Size() -} -func (m *EventSupplierUnbondingEnd) XXX_DiscardUnknown() { - xxx_messageInfo_EventSupplierUnbondingEnd.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSupplierUnbondingEnd proto.InternalMessageInfo - -func (m *EventSupplierUnbondingEnd) GetSupplier() *types.Supplier { - if m != nil { - return m.Supplier - } - return nil -} - -func init() { - proto.RegisterType((*EventSupplierStaked)(nil), "poktroll.supplier.EventSupplierStaked") - proto.RegisterType((*EventSupplierUnbondingBegin)(nil), "poktroll.supplier.EventSupplierUnbondingBegin") - proto.RegisterType((*EventSupplierUnbondingEnd)(nil), "poktroll.supplier.EventSupplierUnbondingEnd") -} - -func init() { proto.RegisterFile("poktroll/supplier/event.proto", fileDescriptor_22d2d1a82853ce0a) } - -var fileDescriptor_22d2d1a82853ce0a = []byte{ - // 247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x4f, 0x2d, - 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x49, 0xeb, 0xc1, 0xa4, - 0xa5, 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0x0a, 0xf4, 0x21, 0x1c, 0x88, 0x6a, - 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x88, 0x38, 0x88, 0x05, 0x15, 0x95, 0x43, 0x58, 0x91, 0x91, - 0x58, 0x94, 0x9a, 0x02, 0xb7, 0x09, 0x22, 0xaf, 0xe4, 0xc3, 0x25, 0xec, 0x0a, 0xb2, 0x32, 0x18, - 0x2a, 0x1c, 0x5c, 0x92, 0x98, 0x9d, 0x9a, 0x22, 0x64, 0xca, 0xc5, 0x01, 0x53, 0x28, 0xc1, 0xa8, - 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa9, 0x87, 0x70, 0x0d, 0xd8, 0x24, 0x3d, 0x98, 0x96, 0x20, 0xb8, - 0x52, 0xa5, 0x10, 0x2e, 0x69, 0x14, 0xd3, 0x42, 0xf3, 0x92, 0xf2, 0xf3, 0x52, 0x32, 0xf3, 0xd2, - 0x9d, 0x52, 0xd3, 0x33, 0xf3, 0xc8, 0x35, 0x35, 0x88, 0x4b, 0x12, 0xbb, 0xa9, 0xae, 0x79, 0xe4, - 0xba, 0xd4, 0xc9, 0xff, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, - 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, - 0x63, 0x88, 0x32, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0x19, - 0xa6, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0f, 0xcd, 0x0a, 0x44, 0x94, 0x95, - 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xd3, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xfd, - 0x1f, 0x53, 0xd0, 0xd4, 0x01, 0x00, 0x00, -} - -func (m *EventSupplierStaked) 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 *EventSupplierStaked) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSupplierStaked) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Supplier != nil { - { - size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventSupplierUnbondingBegin) 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 *EventSupplierUnbondingBegin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSupplierUnbondingBegin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Supplier != nil { - { - size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventSupplierUnbondingEnd) 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 *EventSupplierUnbondingEnd) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSupplierUnbondingEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Supplier != nil { - { - size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventSupplierStaked) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Supplier != nil { - l = m.Supplier.Size() - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func (m *EventSupplierUnbondingBegin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Supplier != nil { - l = m.Supplier.Size() - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func (m *EventSupplierUnbondingEnd) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Supplier != nil { - l = m.Supplier.Size() - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventSupplierStaked) 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 ErrIntOverflowEvent - } - 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: EventSupplierStaked: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSupplierStaked: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Supplier == nil { - m.Supplier = &types.Supplier{} - } - if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventSupplierUnbondingBegin) 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 ErrIntOverflowEvent - } - 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: EventSupplierUnbondingBegin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSupplierUnbondingBegin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Supplier == nil { - m.Supplier = &types.Supplier{} - } - if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventSupplierUnbondingEnd) 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 ErrIntOverflowEvent - } - 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: EventSupplierUnbondingEnd: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSupplierUnbondingEnd: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Supplier == nil { - m.Supplier = &types.Supplier{} - } - if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/supplier/types/genesis.pb.go b/x/supplier/types/genesis.pb.go deleted file mode 100644 index 75b27ed38..000000000 --- a/x/supplier/types/genesis.pb.go +++ /dev/null @@ -1,386 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/supplier/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/shared/types" - 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 - -// GenesisState defines the supplier module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - SupplierList []types.Supplier `protobuf:"bytes,2,rep,name=supplierList,proto3" json:"supplierList"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_c7fecde842e217fc, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetSupplierList() []types.Supplier { - if m != nil { - return m.SupplierList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.supplier.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/supplier/genesis.proto", fileDescriptor_c7fecde842e217fc) } - -var fileDescriptor_c7fecde842e217fc = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x4f, 0x4f, - 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x29, 0xd0, - 0x83, 0x29, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x55, 0x52, 0x22, - 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0xc3, 0x34, 0xbc, 0x20, 0xb1, - 0x28, 0x31, 0xb7, 0x18, 0x53, 0x3e, 0x23, 0xb1, 0x28, 0x35, 0x05, 0xae, 0x0c, 0x22, 0xaf, 0x34, - 0x91, 0x91, 0x8b, 0xc7, 0x1d, 0xe2, 0x9a, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x1b, 0x2e, 0x36, - 0x88, 0x01, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x92, 0x7a, 0x18, 0xae, 0xd3, 0x0b, 0x00, - 0x2b, 0x70, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x3d, - 0x42, 0xce, 0x5c, 0x3c, 0x30, 0x55, 0x3e, 0x99, 0xc5, 0x25, 0x12, 0x4c, 0x0a, 0xcc, 0x68, 0x66, - 0x80, 0x5d, 0xa1, 0x17, 0x0c, 0x55, 0xe4, 0xc4, 0x02, 0x32, 0x23, 0x08, 0x45, 0x93, 0x93, 0xff, - 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, - 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x98, - 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x32, 0x56, 0x37, 0x2f, 0xb5, - 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xee, 0xd3, 0x0a, 0x44, 0x58, 0x94, 0x54, 0x16, 0xa4, 0x16, - 0x27, 0xb1, 0x81, 0xfd, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x67, 0x25, 0x98, 0x6b, 0x8a, - 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SupplierList) > 0 { - for iNdEx := len(m.SupplierList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SupplierList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.SupplierList) > 0 { - for _, e := range m.SupplierList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierList", 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.SupplierList = append(m.SupplierList, types.Supplier{}) - if err := m.SupplierList[len(m.SupplierList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/supplier/types/params.pb.go b/x/supplier/types/params.pb.go deleted file mode 100644 index 4400a9ef5..000000000 --- a/x/supplier/types/params.pb.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/supplier/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_60f7a8031a8c22d5, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.supplier.Params") -} - -func init() { proto.RegisterFile("poktroll/supplier/params.proto", fileDescriptor_60f7a8031a8c22d5) } - -var fileDescriptor_60f7a8031a8c22d5 = []byte{ - // 181 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x2f, 0x48, - 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xc9, 0xeb, 0xc1, - 0xe4, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x95, 0x94, 0x48, 0x7a, - 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb9, 0xd8, 0x02, 0xc0, 0x66, - 0x59, 0x29, 0xbf, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x14, 0xdc, 0xba, 0x0a, 0x84, - 0x85, 0x10, 0x45, 0x4e, 0xfe, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, - 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, - 0xb1, 0x1c, 0x43, 0x94, 0x61, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, - 0xc8, 0x10, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x6c, 0x26, 0x96, 0x54, 0x16, - 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x7e, 0xc4, - 0x71, 0xe4, 0x00, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/supplier/types/query.pb.go b/x/supplier/types/query.pb.go deleted file mode 100644 index fc4da1c09..000000000 --- a/x/supplier/types/query.pb.go +++ /dev/null @@ -1,1370 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/supplier/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/shared/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetSupplierRequest struct { - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` -} - -func (m *QueryGetSupplierRequest) Reset() { *m = QueryGetSupplierRequest{} } -func (m *QueryGetSupplierRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetSupplierRequest) ProtoMessage() {} -func (*QueryGetSupplierRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{2} -} -func (m *QueryGetSupplierRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetSupplierRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetSupplierRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetSupplierRequest.Merge(m, src) -} -func (m *QueryGetSupplierRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetSupplierRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetSupplierRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetSupplierRequest proto.InternalMessageInfo - -func (m *QueryGetSupplierRequest) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -type QueryGetSupplierResponse struct { - Supplier types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier"` -} - -func (m *QueryGetSupplierResponse) Reset() { *m = QueryGetSupplierResponse{} } -func (m *QueryGetSupplierResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetSupplierResponse) ProtoMessage() {} -func (*QueryGetSupplierResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{3} -} -func (m *QueryGetSupplierResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetSupplierResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetSupplierResponse.Merge(m, src) -} -func (m *QueryGetSupplierResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetSupplierResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetSupplierResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetSupplierResponse proto.InternalMessageInfo - -func (m *QueryGetSupplierResponse) GetSupplier() types.Supplier { - if m != nil { - return m.Supplier - } - return types.Supplier{} -} - -type QueryAllSuppliersRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllSuppliersRequest) Reset() { *m = QueryAllSuppliersRequest{} } -func (m *QueryAllSuppliersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllSuppliersRequest) ProtoMessage() {} -func (*QueryAllSuppliersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{4} -} -func (m *QueryAllSuppliersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllSuppliersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllSuppliersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllSuppliersRequest.Merge(m, src) -} -func (m *QueryAllSuppliersRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllSuppliersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllSuppliersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllSuppliersRequest proto.InternalMessageInfo - -func (m *QueryAllSuppliersRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllSuppliersResponse struct { - Supplier []types.Supplier `protobuf:"bytes,1,rep,name=supplier,proto3" json:"supplier"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllSuppliersResponse) Reset() { *m = QueryAllSuppliersResponse{} } -func (m *QueryAllSuppliersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllSuppliersResponse) ProtoMessage() {} -func (*QueryAllSuppliersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7a8c18c53656bd0d, []int{5} -} -func (m *QueryAllSuppliersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllSuppliersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllSuppliersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllSuppliersResponse.Merge(m, src) -} -func (m *QueryAllSuppliersResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllSuppliersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllSuppliersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllSuppliersResponse proto.InternalMessageInfo - -func (m *QueryAllSuppliersResponse) GetSupplier() []types.Supplier { - if m != nil { - return m.Supplier - } - return nil -} - -func (m *QueryAllSuppliersResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.supplier.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.supplier.QueryParamsResponse") - proto.RegisterType((*QueryGetSupplierRequest)(nil), "poktroll.supplier.QueryGetSupplierRequest") - proto.RegisterType((*QueryGetSupplierResponse)(nil), "poktroll.supplier.QueryGetSupplierResponse") - proto.RegisterType((*QueryAllSuppliersRequest)(nil), "poktroll.supplier.QueryAllSuppliersRequest") - proto.RegisterType((*QueryAllSuppliersResponse)(nil), "poktroll.supplier.QueryAllSuppliersResponse") -} - -func init() { proto.RegisterFile("poktroll/supplier/query.proto", fileDescriptor_7a8c18c53656bd0d) } - -var fileDescriptor_7a8c18c53656bd0d = []byte{ - // 567 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0x13, 0x31, - 0x14, 0xc7, 0xe3, 0x16, 0xa2, 0xd6, 0x20, 0x41, 0x4d, 0x24, 0x92, 0x08, 0x0e, 0x74, 0x12, 0x21, - 0x0a, 0xd4, 0x26, 0x65, 0x2c, 0x0c, 0x4d, 0x25, 0x3a, 0x52, 0x92, 0x01, 0x89, 0x81, 0xca, 0x49, - 0xac, 0xeb, 0xa9, 0x97, 0xb3, 0x6b, 0x3b, 0x40, 0x85, 0x58, 0x58, 0x58, 0x91, 0x18, 0x99, 0xd8, - 0x3a, 0x32, 0xf0, 0x21, 0x3a, 0x56, 0xb0, 0x54, 0x0c, 0x08, 0x25, 0x48, 0x7c, 0x0d, 0x14, 0xdb, - 0x97, 0xa6, 0xdc, 0x45, 0x49, 0x97, 0xc8, 0xe7, 0xf7, 0xff, 0xbf, 0xf7, 0xf3, 0x7b, 0x4f, 0x81, - 0x37, 0x05, 0xdf, 0xd3, 0x92, 0x47, 0x11, 0x51, 0x7d, 0x21, 0xa2, 0x90, 0x49, 0xb2, 0xdf, 0x67, - 0xf2, 0x00, 0x0b, 0xc9, 0x35, 0x47, 0x2b, 0x49, 0x18, 0x27, 0xe1, 0xf2, 0x0a, 0xed, 0x85, 0x31, - 0x27, 0xe6, 0xd7, 0xaa, 0xca, 0x85, 0x80, 0x07, 0xdc, 0x1c, 0xc9, 0xe8, 0xe4, 0x6e, 0x6f, 0x04, - 0x9c, 0x07, 0x11, 0x23, 0x54, 0x84, 0x84, 0xc6, 0x31, 0xd7, 0x54, 0x87, 0x3c, 0x56, 0x2e, 0x5a, - 0xea, 0x70, 0xd5, 0xe3, 0x6a, 0xc7, 0xda, 0xec, 0x87, 0x0b, 0xd5, 0xec, 0x17, 0x69, 0x53, 0xc5, - 0x2c, 0x0d, 0x79, 0x55, 0x6f, 0x33, 0x4d, 0xeb, 0x44, 0xd0, 0x20, 0x8c, 0x4d, 0x1e, 0xa7, 0xf5, - 0x26, 0xb5, 0x89, 0xaa, 0xc3, 0xc3, 0x71, 0x3c, 0xfd, 0x3e, 0x41, 0x25, 0xed, 0xa9, 0x74, 0x7c, - 0x97, 0x4a, 0xd6, 0x1d, 0xcb, 0x6c, 0xdc, 0x2f, 0x40, 0xf4, 0x6c, 0x44, 0xb0, 0x6d, 0x4c, 0x4d, - 0xb6, 0xdf, 0x67, 0x4a, 0xfb, 0x2d, 0x78, 0xed, 0xcc, 0xad, 0x12, 0x3c, 0x56, 0x0c, 0x3d, 0x82, - 0x79, 0x9b, 0xbc, 0x08, 0x6e, 0x83, 0xea, 0xa5, 0xb5, 0x12, 0x4e, 0xb5, 0x0f, 0x5b, 0x4b, 0x63, - 0xf9, 0xe8, 0xd7, 0xad, 0xdc, 0xe1, 0xdf, 0xaf, 0x35, 0xd0, 0x74, 0x1e, 0xff, 0x25, 0xbc, 0x6e, - 0x92, 0x6e, 0x31, 0xdd, 0x72, 0x6a, 0x57, 0x0f, 0x6d, 0xc2, 0xab, 0x5c, 0x30, 0x49, 0x35, 0x97, - 0x3b, 0xb4, 0xdb, 0x95, 0x4c, 0xd9, 0x12, 0xcb, 0x8d, 0xe2, 0xf7, 0x6f, 0xab, 0x05, 0xd7, 0xbd, - 0x0d, 0x1b, 0x69, 0x69, 0x19, 0xc6, 0x41, 0xf3, 0x4a, 0xe2, 0x70, 0xd7, 0xfe, 0x73, 0x58, 0x4c, - 0xe7, 0x77, 0xe4, 0xeb, 0x70, 0x29, 0x21, 0xcc, 0x60, 0x37, 0x9d, 0xc1, 0x89, 0xa9, 0x71, 0x61, - 0xc4, 0xde, 0x1c, 0x1b, 0xfc, 0xb6, 0x4b, 0xbc, 0x11, 0x45, 0x89, 0x26, 0xe9, 0x14, 0x7a, 0x02, - 0xe1, 0xe9, 0xcc, 0x5c, 0xea, 0x0a, 0x76, 0xc0, 0xa3, 0xa1, 0x61, 0xbb, 0x6e, 0x6e, 0x74, 0x78, - 0x9b, 0x06, 0xcc, 0x79, 0x9b, 0x13, 0x4e, 0xff, 0x0b, 0x80, 0xa5, 0x8c, 0x22, 0x99, 0xf8, 0x8b, - 0xe7, 0xc2, 0x47, 0x5b, 0x67, 0x10, 0x17, 0x0c, 0xe2, 0xdd, 0x99, 0x88, 0xb6, 0xf2, 0x24, 0xe3, - 0xda, 0xcf, 0x45, 0x78, 0xd1, 0x30, 0xa2, 0x0f, 0x00, 0xe6, 0xed, 0xa0, 0xd1, 0x9d, 0x8c, 0x1d, - 0x48, 0x6f, 0x54, 0xb9, 0x32, 0x4b, 0x66, 0xeb, 0xf9, 0xf8, 0xfd, 0x8f, 0x3f, 0x9f, 0x16, 0xaa, - 0xa8, 0x42, 0x46, 0xfa, 0xd5, 0x98, 0xe9, 0xd7, 0x5c, 0xee, 0x91, 0x69, 0x5b, 0x8e, 0x0e, 0x01, - 0x5c, 0x4a, 0x5e, 0x8e, 0x6a, 0xd3, 0x8a, 0xa4, 0x57, 0xae, 0x7c, 0x6f, 0x2e, 0xad, 0xa3, 0xda, - 0x34, 0x54, 0x8f, 0xd1, 0xfa, 0x2c, 0xaa, 0xf1, 0xe1, 0xed, 0xff, 0xfb, 0xfc, 0x0e, 0x7d, 0x06, - 0xf0, 0xf2, 0xe4, 0x74, 0xd1, 0x54, 0x84, 0x8c, 0x45, 0x2b, 0xdf, 0x9f, 0x4f, 0xec, 0x80, 0x1f, - 0x18, 0xe0, 0x1a, 0xaa, 0xce, 0x0b, 0xdc, 0x78, 0x7a, 0x34, 0xf0, 0xc0, 0xf1, 0xc0, 0x03, 0x27, - 0x03, 0x0f, 0xfc, 0x1e, 0x78, 0xe0, 0xe3, 0xd0, 0xcb, 0x1d, 0x0f, 0xbd, 0xdc, 0xc9, 0xd0, 0xcb, - 0xbd, 0xa8, 0x07, 0xa1, 0xde, 0xed, 0xb7, 0x71, 0x87, 0xf7, 0xa6, 0x64, 0x7c, 0x73, 0x9a, 0x53, - 0x1f, 0x08, 0xa6, 0xda, 0x79, 0xf3, 0x07, 0xf3, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, - 0x67, 0x7e, 0xca, 0x82, 0x05, 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 Supplier items. - Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) - AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.supplier.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) { - out := new(QueryGetSupplierResponse) - err := c.cc.Invoke(ctx, "/poktroll.supplier.Query/Supplier", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) { - out := new(QueryAllSuppliersResponse) - err := c.cc.Invoke(ctx, "/poktroll.supplier.Query/AllSuppliers", in, out, opts...) - 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 Supplier items. - Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) - AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, 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) Supplier(ctx context.Context, req *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Supplier not implemented") -} -func (*UnimplementedQueryServer) AllSuppliers(ctx context.Context, req *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllSuppliers not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.supplier.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 _Query_Supplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetSupplierRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Supplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.supplier.Query/Supplier", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Supplier(ctx, req.(*QueryGetSupplierRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllSuppliers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllSuppliersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllSuppliers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.supplier.Query/AllSuppliers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllSuppliers(ctx, req.(*QueryAllSuppliersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.supplier.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Supplier", - Handler: _Query_Supplier_Handler, - }, - { - MethodName: "AllSuppliers", - Handler: _Query_AllSuppliers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/supplier/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetSupplierRequest) 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 *QueryGetSupplierRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetSupplierRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetSupplierResponse) 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 *QueryGetSupplierResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Supplier.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 *QueryAllSuppliersRequest) 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 *QueryAllSuppliersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllSuppliersRequest) 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 *QueryAllSuppliersResponse) 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 *QueryAllSuppliersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllSuppliersResponse) 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.Supplier) > 0 { - for iNdEx := len(m.Supplier) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Supplier[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 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 *QueryGetSupplierRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetSupplierResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Supplier.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllSuppliersRequest) 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 *QueryAllSuppliersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Supplier) > 0 { - for _, e := range m.Supplier { - 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 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 *QueryGetSupplierRequest) 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: QueryGetSupplierRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSupplierRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", 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.OperatorAddress = 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 *QueryGetSupplierResponse) 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: QueryGetSupplierResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier.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 *QueryAllSuppliersRequest) 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: QueryAllSuppliersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllSuppliersRequest: 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllSuppliersResponse) 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: QueryAllSuppliersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllSuppliersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier = append(m.Supplier, types.Supplier{}) - if err := m.Supplier[len(m.Supplier)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/supplier/types/query.pb.gw.go b/x/supplier/types/query.pb.gw.go deleted file mode 100644 index 2114c1d77..000000000 --- a/x/supplier/types/query.pb.gw.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/supplier/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSupplierRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") - } - - protoReq.OperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) - } - - msg, err := client.Supplier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSupplierRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["operator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") - } - - protoReq.OperatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) - } - - msg, err := server.Supplier(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllSuppliers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllSuppliers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllSuppliersRequest - 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_AllSuppliers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllSuppliers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllSuppliers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllSuppliersRequest - 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_AllSuppliers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllSuppliers(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Supplier_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_Supplier_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_Supplier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllSuppliers_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_AllSuppliers_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_AllSuppliers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Supplier_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_Supplier_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_Supplier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllSuppliers_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_AllSuppliers_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_AllSuppliers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "supplier", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Supplier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "supplier", "operator_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllSuppliers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "supplier"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Supplier_0 = runtime.ForwardResponseMessage - - forward_Query_AllSuppliers_0 = runtime.ForwardResponseMessage -) diff --git a/x/supplier/types/tx.pb.go b/x/supplier/types/tx.pb.go deleted file mode 100644 index d08f9199e..000000000 --- a/x/supplier/types/tx.pb.go +++ /dev/null @@ -1,1515 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/supplier/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/pokt-network/poktroll/x/shared/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/supplier parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -type MsgStakeSupplier struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - OperatorAddress string `protobuf:"bytes,3,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - Stake *types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*types1.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` -} - -func (m *MsgStakeSupplier) Reset() { *m = MsgStakeSupplier{} } -func (m *MsgStakeSupplier) String() string { return proto.CompactTextString(m) } -func (*MsgStakeSupplier) ProtoMessage() {} -func (*MsgStakeSupplier) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{2} -} -func (m *MsgStakeSupplier) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeSupplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeSupplier) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeSupplier.Merge(m, src) -} -func (m *MsgStakeSupplier) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeSupplier) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeSupplier.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeSupplier proto.InternalMessageInfo - -func (m *MsgStakeSupplier) GetSigner() string { - if m != nil { - return m.Signer - } - return "" -} - -func (m *MsgStakeSupplier) GetOwnerAddress() string { - if m != nil { - return m.OwnerAddress - } - return "" -} - -func (m *MsgStakeSupplier) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -func (m *MsgStakeSupplier) GetStake() *types.Coin { - if m != nil { - return m.Stake - } - return nil -} - -func (m *MsgStakeSupplier) GetServices() []*types1.SupplierServiceConfig { - if m != nil { - return m.Services - } - return nil -} - -type MsgStakeSupplierResponse struct { -} - -func (m *MsgStakeSupplierResponse) Reset() { *m = MsgStakeSupplierResponse{} } -func (m *MsgStakeSupplierResponse) String() string { return proto.CompactTextString(m) } -func (*MsgStakeSupplierResponse) ProtoMessage() {} -func (*MsgStakeSupplierResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{3} -} -func (m *MsgStakeSupplierResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStakeSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgStakeSupplierResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStakeSupplierResponse.Merge(m, src) -} -func (m *MsgStakeSupplierResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgStakeSupplierResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStakeSupplierResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStakeSupplierResponse proto.InternalMessageInfo - -type MsgUnstakeSupplier struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` -} - -func (m *MsgUnstakeSupplier) Reset() { *m = MsgUnstakeSupplier{} } -func (m *MsgUnstakeSupplier) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeSupplier) ProtoMessage() {} -func (*MsgUnstakeSupplier) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{4} -} -func (m *MsgUnstakeSupplier) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeSupplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeSupplier) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeSupplier.Merge(m, src) -} -func (m *MsgUnstakeSupplier) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeSupplier) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeSupplier.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeSupplier proto.InternalMessageInfo - -func (m *MsgUnstakeSupplier) GetSigner() string { - if m != nil { - return m.Signer - } - return "" -} - -func (m *MsgUnstakeSupplier) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -type MsgUnstakeSupplierResponse struct { -} - -func (m *MsgUnstakeSupplierResponse) Reset() { *m = MsgUnstakeSupplierResponse{} } -func (m *MsgUnstakeSupplierResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUnstakeSupplierResponse) ProtoMessage() {} -func (*MsgUnstakeSupplierResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_63b974929807ef57, []int{5} -} -func (m *MsgUnstakeSupplierResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnstakeSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUnstakeSupplierResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnstakeSupplierResponse.Merge(m, src) -} -func (m *MsgUnstakeSupplierResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUnstakeSupplierResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnstakeSupplierResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnstakeSupplierResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.supplier.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.supplier.MsgUpdateParamsResponse") - proto.RegisterType((*MsgStakeSupplier)(nil), "poktroll.supplier.MsgStakeSupplier") - proto.RegisterType((*MsgStakeSupplierResponse)(nil), "poktroll.supplier.MsgStakeSupplierResponse") - proto.RegisterType((*MsgUnstakeSupplier)(nil), "poktroll.supplier.MsgUnstakeSupplier") - proto.RegisterType((*MsgUnstakeSupplierResponse)(nil), "poktroll.supplier.MsgUnstakeSupplierResponse") -} - -func init() { proto.RegisterFile("poktroll/supplier/tx.proto", fileDescriptor_63b974929807ef57) } - -var fileDescriptor_63b974929807ef57 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x31, 0x8f, 0x12, 0x41, - 0x18, 0x65, 0x41, 0x88, 0x0c, 0x77, 0xe1, 0x6e, 0x73, 0xc9, 0x2d, 0x1b, 0x5d, 0x09, 0x17, 0x0d, - 0xc1, 0xb0, 0x23, 0x98, 0x5c, 0x71, 0xd1, 0x42, 0xa8, 0x89, 0x06, 0x62, 0x63, 0xe1, 0x65, 0x80, - 0x71, 0xd8, 0x00, 0x3b, 0x9b, 0x99, 0x81, 0xbb, 0xeb, 0x8c, 0xa5, 0x95, 0xa5, 0x3f, 0xc1, 0x92, - 0xc2, 0xc2, 0xce, 0xf6, 0x62, 0x75, 0xb1, 0xba, 0xca, 0x18, 0x28, 0xf8, 0x1b, 0x66, 0x77, 0x67, - 0x40, 0x16, 0x94, 0x33, 0x36, 0xc0, 0xcc, 0x7b, 0xef, 0xfb, 0xde, 0xbc, 0xf9, 0x06, 0x60, 0x7a, - 0xb4, 0x2f, 0x18, 0x1d, 0x0c, 0x20, 0x1f, 0x79, 0xde, 0xc0, 0xc1, 0x0c, 0x8a, 0x73, 0xdb, 0x63, - 0x54, 0x50, 0x7d, 0x5f, 0x61, 0xb6, 0xc2, 0xcc, 0x7d, 0x34, 0x74, 0x5c, 0x0a, 0x83, 0xcf, 0x90, - 0x65, 0x1e, 0x76, 0x28, 0x1f, 0x52, 0x0e, 0x87, 0x9c, 0xc0, 0x71, 0xc5, 0xff, 0x92, 0x40, 0x2e, - 0x04, 0x4e, 0x83, 0x15, 0x0c, 0x17, 0x12, 0x3a, 0x20, 0x94, 0xd0, 0x70, 0xdf, 0xff, 0x25, 0x77, - 0x2d, 0x59, 0xa9, 0x8d, 0x38, 0x86, 0xe3, 0x4a, 0x1b, 0x0b, 0x54, 0x81, 0x1d, 0xea, 0xb8, 0x0a, - 0x5f, 0xf7, 0xea, 0x21, 0x86, 0x86, 0xaa, 0xea, 0xdd, 0x25, 0xde, 0x43, 0x0c, 0x77, 0x21, 0xc7, - 0x6c, 0xec, 0x74, 0x70, 0x08, 0x17, 0xbe, 0x6a, 0x20, 0xdb, 0xe0, 0xe4, 0xa5, 0xd7, 0x45, 0x02, - 0xbf, 0x08, 0x84, 0xfa, 0x31, 0x48, 0xa3, 0x91, 0xe8, 0x51, 0xe6, 0x88, 0x0b, 0x43, 0xcb, 0x6b, - 0xc5, 0x74, 0xcd, 0xf8, 0xfe, 0xb9, 0x7c, 0x20, 0xdd, 0x3e, 0xeb, 0x76, 0x19, 0xe6, 0xbc, 0x25, - 0x98, 0xe3, 0x92, 0xe6, 0x92, 0xaa, 0x3f, 0x01, 0xa9, 0xb0, 0xb5, 0x11, 0xcf, 0x6b, 0xc5, 0x4c, - 0x35, 0x67, 0xaf, 0x65, 0x65, 0x87, 0x2d, 0x6a, 0xe9, 0xcb, 0x1f, 0xf7, 0x62, 0x9f, 0xe6, 0x93, - 0x92, 0xd6, 0x94, 0x9a, 0x93, 0xe3, 0x77, 0xf3, 0x49, 0x69, 0x59, 0xed, 0xfd, 0x7c, 0x52, 0x3a, - 0x5a, 0x78, 0x3f, 0x5f, 0x9e, 0x2e, 0xe2, 0xb6, 0x90, 0x03, 0x87, 0x91, 0xad, 0x26, 0xe6, 0x1e, - 0x75, 0x39, 0x2e, 0x7c, 0x8b, 0x83, 0xbd, 0x06, 0x27, 0x2d, 0x81, 0xfa, 0xb8, 0x25, 0xf5, 0xfa, - 0x23, 0x90, 0xe2, 0x0e, 0x71, 0x31, 0xdb, 0x7a, 0x34, 0xc9, 0xd3, 0x9f, 0x82, 0x5d, 0x7a, 0xe6, - 0x62, 0x76, 0x8a, 0x42, 0x38, 0x38, 0xde, 0xdf, 0x84, 0x3b, 0x01, 0x5d, 0xee, 0xe9, 0x75, 0xb0, - 0x47, 0x3d, 0xcc, 0x90, 0xa0, 0xcb, 0x0a, 0x89, 0x2d, 0x15, 0xb2, 0x4a, 0xa1, 0x8a, 0x40, 0x90, - 0xe4, 0xfe, 0x31, 0x8c, 0x5b, 0x32, 0x5a, 0x29, 0xf3, 0xc7, 0xc2, 0x96, 0x63, 0x61, 0xd7, 0xa9, - 0xe3, 0x36, 0x43, 0x9e, 0x5e, 0x03, 0xb7, 0xe5, 0x4d, 0x73, 0x23, 0x99, 0x4f, 0x14, 0x33, 0xd5, - 0x07, 0xbf, 0x5d, 0x47, 0x30, 0x0a, 0xb6, 0xca, 0xa4, 0x15, 0x12, 0xeb, 0xd4, 0x7d, 0xe3, 0x90, - 0xe6, 0x42, 0x77, 0x92, 0xf1, 0xaf, 0x44, 0xa6, 0x50, 0x30, 0x81, 0x11, 0xcd, 0x72, 0x11, 0xf4, - 0x47, 0x0d, 0xe8, 0xfe, 0x25, 0xb8, 0xfc, 0x3f, 0xa3, 0xde, 0x94, 0x55, 0xfc, 0x1f, 0xb3, 0x5a, - 0xb5, 0x7d, 0x07, 0x98, 0xeb, 0xce, 0x94, 0xf1, 0xea, 0x97, 0x38, 0x48, 0x34, 0x38, 0xd1, 0x5f, - 0x83, 0x9d, 0x95, 0x27, 0x50, 0xd8, 0x30, 0xba, 0x91, 0x29, 0x33, 0x4b, 0xdb, 0x39, 0xaa, 0x8f, - 0x8e, 0xc0, 0xee, 0xea, 0x14, 0x1e, 0x6d, 0x16, 0xaf, 0x90, 0xcc, 0x87, 0x37, 0x20, 0x2d, 0x5a, - 0x10, 0x90, 0x8d, 0xe6, 0x7f, 0xff, 0x0f, 0x0e, 0x57, 0x69, 0x66, 0xf9, 0x46, 0x34, 0xd5, 0xc8, - 0x4c, 0xbe, 0xf5, 0xdf, 0x6d, 0xed, 0xf9, 0xe5, 0xd4, 0xd2, 0xae, 0xa6, 0x96, 0x76, 0x3d, 0xb5, - 0xb4, 0x9f, 0x53, 0x4b, 0xfb, 0x30, 0xb3, 0x62, 0x57, 0x33, 0x2b, 0x76, 0x3d, 0xb3, 0x62, 0xaf, - 0x2a, 0xc4, 0x11, 0xbd, 0x51, 0xdb, 0xee, 0xd0, 0x21, 0xf4, 0xab, 0x97, 0x5d, 0x2c, 0xce, 0x28, - 0xeb, 0xc3, 0x4d, 0x4f, 0x5a, 0x5c, 0x78, 0x98, 0xb7, 0x53, 0xc1, 0x3f, 0xd2, 0xe3, 0x5f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xb5, 0x70, 0x92, 0x1e, 0x7e, 0x05, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) - UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) { - out := new(MsgStakeSupplierResponse) - err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/StakeSupplier", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) { - out := new(MsgUnstakeSupplierResponse) - err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/UnstakeSupplier", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) - UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) StakeSupplier(ctx context.Context, req *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StakeSupplier not implemented") -} -func (*UnimplementedMsgServer) UnstakeSupplier(ctx context.Context, req *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnstakeSupplier not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.supplier.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_StakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStakeSupplier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StakeSupplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.supplier.Msg/StakeSupplier", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StakeSupplier(ctx, req.(*MsgStakeSupplier)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnstakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnstakeSupplier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnstakeSupplier(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.supplier.Msg/UnstakeSupplier", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnstakeSupplier(ctx, req.(*MsgUnstakeSupplier)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.supplier.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "StakeSupplier", - Handler: _Msg_StakeSupplier_Handler, - }, - { - MethodName: "UnstakeSupplier", - Handler: _Msg_UnstakeSupplier_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/supplier/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgStakeSupplier) 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 *MsgStakeSupplier) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Stake != nil { - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgStakeSupplierResponse) 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 *MsgStakeSupplierResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeSupplier) 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 *MsgUnstakeSupplier) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUnstakeSupplierResponse) 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 *MsgUnstakeSupplierResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnstakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgStakeSupplier) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Stake != nil { - l = m.Stake.Size() - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Services) > 0 { - for _, e := range m.Services { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgStakeSupplierResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUnstakeSupplier) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUnstakeSupplierResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeSupplier) 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 ErrIntOverflowTx - } - 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: MsgStakeSupplier: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeSupplier: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stake == nil { - m.Stake = &types.Coin{} - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, &types1.SupplierServiceConfig{}) - if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStakeSupplierResponse) 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 ErrIntOverflowTx - } - 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: MsgStakeSupplierResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeSupplier) 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 ErrIntOverflowTx - } - 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: MsgUnstakeSupplier: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeSupplier: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUnstakeSupplierResponse) 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 ErrIntOverflowTx - } - 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: MsgUnstakeSupplierResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnstakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/event.pb.go b/x/tokenomics/types/event.pb.go deleted file mode 100644 index 85e281f24..000000000 --- a/x/tokenomics/types/event.pb.go +++ /dev/null @@ -1,1736 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/event.proto - -package types - -import ( - fmt "fmt" - types1 "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/pokt-network/poktroll/x/proof/types" - 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 - -type ClaimExpirationReason int32 - -const ( - ClaimExpirationReason_EXPIRATION_REASON_UNSPECIFIED ClaimExpirationReason = 0 - ClaimExpirationReason_PROOF_MISSING ClaimExpirationReason = 1 - ClaimExpirationReason_PROOF_INVALID ClaimExpirationReason = 2 -) - -var ClaimExpirationReason_name = map[int32]string{ - 0: "EXPIRATION_REASON_UNSPECIFIED", - 1: "PROOF_MISSING", - 2: "PROOF_INVALID", -} - -var ClaimExpirationReason_value = map[string]int32{ - "EXPIRATION_REASON_UNSPECIFIED": 0, - "PROOF_MISSING": 1, - "PROOF_INVALID": 2, -} - -func (x ClaimExpirationReason) String() string { - return proto.EnumName(ClaimExpirationReason_name, int32(x)) -} - -func (ClaimExpirationReason) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{0} -} - -// EventClaimExpired is an event emitted during settlement whenever a claim requiring -// an on-chain proof doesn't have one. The claim cannot be settled, leading to that work -// never being rewarded. -type EventClaimExpired struct { - Claim *types.Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - // TODO_MAINNET: Shold we include the proof here too? - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` - ExpirationReason ClaimExpirationReason `protobuf:"varint,4,opt,name=expiration_reason,json=expirationReason,proto3,enum=poktroll.tokenomics.ClaimExpirationReason" json:"expiration_reason"` -} - -func (m *EventClaimExpired) Reset() { *m = EventClaimExpired{} } -func (m *EventClaimExpired) String() string { return proto.CompactTextString(m) } -func (*EventClaimExpired) ProtoMessage() {} -func (*EventClaimExpired) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{0} -} -func (m *EventClaimExpired) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventClaimExpired) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventClaimExpired) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventClaimExpired.Merge(m, src) -} -func (m *EventClaimExpired) XXX_Size() int { - return m.Size() -} -func (m *EventClaimExpired) XXX_DiscardUnknown() { - xxx_messageInfo_EventClaimExpired.DiscardUnknown(m) -} - -var xxx_messageInfo_EventClaimExpired proto.InternalMessageInfo - -func (m *EventClaimExpired) GetClaim() *types.Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventClaimExpired) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventClaimExpired) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -func (m *EventClaimExpired) GetExpirationReason() ClaimExpirationReason { - if m != nil { - return m.ExpirationReason - } - return ClaimExpirationReason_EXPIRATION_REASON_UNSPECIFIED -} - -// EventClaimSettled is an event emitted whenever a claim is settled. -// The proof_required determines whether the claim requires a proof that has been submitted or not -type EventClaimSettled struct { - Claim *types.Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` - ProofRequirement types.ProofRequirementReason `protobuf:"varint,4,opt,name=proof_requirement,json=proofRequirement,proto3,enum=poktroll.proof.ProofRequirementReason" json:"proof_requirement"` -} - -func (m *EventClaimSettled) Reset() { *m = EventClaimSettled{} } -func (m *EventClaimSettled) String() string { return proto.CompactTextString(m) } -func (*EventClaimSettled) ProtoMessage() {} -func (*EventClaimSettled) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{1} -} -func (m *EventClaimSettled) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventClaimSettled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventClaimSettled) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventClaimSettled.Merge(m, src) -} -func (m *EventClaimSettled) XXX_Size() int { - return m.Size() -} -func (m *EventClaimSettled) XXX_DiscardUnknown() { - xxx_messageInfo_EventClaimSettled.DiscardUnknown(m) -} - -var xxx_messageInfo_EventClaimSettled proto.InternalMessageInfo - -func (m *EventClaimSettled) GetClaim() *types.Claim { - if m != nil { - return m.Claim - } - return nil -} - -func (m *EventClaimSettled) GetNumRelays() uint64 { - if m != nil { - return m.NumRelays - } - return 0 -} - -func (m *EventClaimSettled) GetNumComputeUnits() uint64 { - if m != nil { - return m.NumComputeUnits - } - return 0 -} - -func (m *EventClaimSettled) GetProofRequirement() types.ProofRequirementReason { - if m != nil { - return m.ProofRequirement - } - return types.ProofRequirementReason_NOT_REQUIRED -} - -// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated -// for a given service. -type EventRelayMiningDifficultyUpdated struct { - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` - NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` - PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` - NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` -} - -func (m *EventRelayMiningDifficultyUpdated) Reset() { *m = EventRelayMiningDifficultyUpdated{} } -func (m *EventRelayMiningDifficultyUpdated) String() string { return proto.CompactTextString(m) } -func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} -func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{2} -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRelayMiningDifficultyUpdated.Merge(m, src) -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Size() int { - return m.Size() -} -func (m *EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown() { - xxx_messageInfo_EventRelayMiningDifficultyUpdated.DiscardUnknown(m) -} - -var xxx_messageInfo_EventRelayMiningDifficultyUpdated proto.InternalMessageInfo - -func (m *EventRelayMiningDifficultyUpdated) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { - if m != nil { - return m.PrevTargetHashHexEncoded - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { - if m != nil { - return m.NewTargetHashHexEncoded - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { - if m != nil { - return m.PrevNumRelaysEma - } - return 0 -} - -func (m *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { - if m != nil { - return m.NewNumRelaysEma - } - return 0 -} - -// EventApplicationOverserviced is emitted when an application has less stake than -// what a supplier is claiming (i.e. amount available for burning is insufficient). -// This means the following will ALWAYS be strictly true: effective_burn < expected_burn. -type EventApplicationOverserviced struct { - ApplicationAddr string `protobuf:"bytes,1,opt,name=application_addr,json=applicationAddr,proto3" json:"application_addr,omitempty"` - SupplierOperatorAddr string `protobuf:"bytes,2,opt,name=supplier_operator_addr,json=supplierOperatorAddr,proto3" json:"supplier_operator_addr,omitempty"` - // Expected burn is the amount the supplier is claiming for work done - // to service the application during the session. - // This is usually the amount in the Claim submitted. - ExpectedBurn *types1.Coin `protobuf:"bytes,3,opt,name=expected_burn,json=expectedBurn,proto3" json:"expected_burn,omitempty"` - // Effective burn is the amount that is actually being paid to the supplier - // for the work done. It is less than the expected burn (claim amount) and - // is a function of the relay mining algorithm. - // E.g. The application's stake divided by the number of suppliers in a session. - EffectiveBurn *types1.Coin `protobuf:"bytes,4,opt,name=effective_burn,json=effectiveBurn,proto3" json:"effective_burn,omitempty"` -} - -func (m *EventApplicationOverserviced) Reset() { *m = EventApplicationOverserviced{} } -func (m *EventApplicationOverserviced) String() string { return proto.CompactTextString(m) } -func (*EventApplicationOverserviced) ProtoMessage() {} -func (*EventApplicationOverserviced) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{3} -} -func (m *EventApplicationOverserviced) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventApplicationOverserviced) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventApplicationOverserviced) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventApplicationOverserviced.Merge(m, src) -} -func (m *EventApplicationOverserviced) XXX_Size() int { - return m.Size() -} -func (m *EventApplicationOverserviced) XXX_DiscardUnknown() { - xxx_messageInfo_EventApplicationOverserviced.DiscardUnknown(m) -} - -var xxx_messageInfo_EventApplicationOverserviced proto.InternalMessageInfo - -func (m *EventApplicationOverserviced) GetApplicationAddr() string { - if m != nil { - return m.ApplicationAddr - } - return "" -} - -func (m *EventApplicationOverserviced) GetSupplierOperatorAddr() string { - if m != nil { - return m.SupplierOperatorAddr - } - return "" -} - -func (m *EventApplicationOverserviced) GetExpectedBurn() *types1.Coin { - if m != nil { - return m.ExpectedBurn - } - return nil -} - -func (m *EventApplicationOverserviced) GetEffectiveBurn() *types1.Coin { - if m != nil { - return m.EffectiveBurn - } - return nil -} - -// EventSupplierSlashed is emitted when a supplier is slashed for not providing, -// or provided invalid required proofs for claims. -type EventSupplierSlashed struct { - SupplierOperatorAddr string `protobuf:"bytes,1,opt,name=supplier_operator_addr,json=supplierOperatorAddr,proto3" json:"supplier_operator_addr,omitempty"` - // Number of expired claims (due to missing or invalid proof) that led to slashing. - NumExpiredClaims uint64 `protobuf:"varint,2,opt,name=num_expired_claims,json=numExpiredClaims,proto3" json:"num_expired_claims,omitempty"` - // Amount slashed from the supplier's stake due to the expired claims. - // This is a function of the number of expired claims and proof missing penalty. - SlashingAmount *types1.Coin `protobuf:"bytes,3,opt,name=slashing_amount,json=slashingAmount,proto3" json:"slashing_amount,omitempty"` -} - -func (m *EventSupplierSlashed) Reset() { *m = EventSupplierSlashed{} } -func (m *EventSupplierSlashed) String() string { return proto.CompactTextString(m) } -func (*EventSupplierSlashed) ProtoMessage() {} -func (*EventSupplierSlashed) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{4} -} -func (m *EventSupplierSlashed) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSupplierSlashed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventSupplierSlashed) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSupplierSlashed.Merge(m, src) -} -func (m *EventSupplierSlashed) XXX_Size() int { - return m.Size() -} -func (m *EventSupplierSlashed) XXX_DiscardUnknown() { - xxx_messageInfo_EventSupplierSlashed.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSupplierSlashed proto.InternalMessageInfo - -func (m *EventSupplierSlashed) GetSupplierOperatorAddr() string { - if m != nil { - return m.SupplierOperatorAddr - } - return "" -} - -func (m *EventSupplierSlashed) GetNumExpiredClaims() uint64 { - if m != nil { - return m.NumExpiredClaims - } - return 0 -} - -func (m *EventSupplierSlashed) GetSlashingAmount() *types1.Coin { - if m != nil { - return m.SlashingAmount - } - return nil -} - -func init() { - proto.RegisterEnum("poktroll.tokenomics.ClaimExpirationReason", ClaimExpirationReason_name, ClaimExpirationReason_value) - proto.RegisterType((*EventClaimExpired)(nil), "poktroll.tokenomics.EventClaimExpired") - proto.RegisterType((*EventClaimSettled)(nil), "poktroll.tokenomics.EventClaimSettled") - proto.RegisterType((*EventRelayMiningDifficultyUpdated)(nil), "poktroll.tokenomics.EventRelayMiningDifficultyUpdated") - proto.RegisterType((*EventApplicationOverserviced)(nil), "poktroll.tokenomics.EventApplicationOverserviced") - proto.RegisterType((*EventSupplierSlashed)(nil), "poktroll.tokenomics.EventSupplierSlashed") -} - -func init() { proto.RegisterFile("poktroll/tokenomics/event.proto", fileDescriptor_a78874bbf91a58c7) } - -var fileDescriptor_a78874bbf91a58c7 = []byte{ - // 809 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcf, 0x72, 0xdb, 0x44, - 0x18, 0x8f, 0xdc, 0x94, 0x19, 0x6f, 0x49, 0x62, 0x6f, 0x13, 0x30, 0xa1, 0x55, 0x52, 0x1f, 0x98, - 0x50, 0x88, 0x34, 0x4d, 0x19, 0x4e, 0x4c, 0x07, 0x3b, 0x51, 0xa9, 0x66, 0xa8, 0x1d, 0xe4, 0x86, - 0x61, 0xb8, 0x2c, 0x6b, 0xe9, 0xb3, 0xbd, 0x44, 0xda, 0x15, 0xab, 0x95, 0xe3, 0x1c, 0x79, 0x03, - 0x1e, 0x80, 0x17, 0xe0, 0xc0, 0x2b, 0x70, 0xe6, 0xd8, 0x63, 0x4f, 0x19, 0x26, 0xb9, 0xe5, 0x29, - 0x98, 0x5d, 0xc9, 0xb1, 0x71, 0x42, 0x73, 0xee, 0xc5, 0x5e, 0x7f, 0xdf, 0xef, 0xf7, 0xfd, 0xf9, - 0xc9, 0xfb, 0x13, 0xda, 0x4a, 0xc5, 0xb1, 0x92, 0x22, 0x8e, 0x5d, 0x25, 0x8e, 0x81, 0x8b, 0x84, - 0x85, 0x99, 0x0b, 0x63, 0xe0, 0xca, 0x49, 0xa5, 0x50, 0x02, 0xdf, 0x9f, 0x02, 0x9c, 0x19, 0x60, - 0xd3, 0x0e, 0x45, 0x96, 0x88, 0xcc, 0xed, 0xd3, 0x0c, 0xdc, 0xf1, 0x93, 0x3e, 0x28, 0xfa, 0xc4, - 0x0d, 0x05, 0xe3, 0x05, 0x69, 0x73, 0x7d, 0x28, 0x86, 0xc2, 0x1c, 0x5d, 0x7d, 0x2a, 0xa3, 0x9b, - 0x57, 0xbd, 0x52, 0x29, 0xc4, 0xc0, 0x55, 0xa7, 0x29, 0x64, 0x45, 0xae, 0xf9, 0x67, 0x05, 0xd5, - 0x3d, 0xdd, 0x76, 0x3f, 0xa6, 0x2c, 0xf1, 0x26, 0x29, 0x93, 0x10, 0xe1, 0x2f, 0xd1, 0xdd, 0x50, - 0xff, 0x6e, 0x58, 0xdb, 0xd6, 0xce, 0xbd, 0xbd, 0x0d, 0xe7, 0x6a, 0x18, 0x53, 0xc1, 0x31, 0xe0, - 0x76, 0xf5, 0xf2, 0x6c, 0xab, 0xc0, 0x05, 0xc5, 0x17, 0xde, 0x45, 0x88, 0xe7, 0x09, 0x91, 0x10, - 0xd3, 0xd3, 0xac, 0x51, 0xd9, 0xb6, 0x76, 0x96, 0xdb, 0xab, 0x97, 0x67, 0x5b, 0x73, 0xd1, 0xa0, - 0xca, 0xf3, 0x24, 0x30, 0x47, 0xdc, 0x42, 0x75, 0x9d, 0x08, 0x45, 0x92, 0xe6, 0x0a, 0x48, 0xce, - 0x99, 0xca, 0x1a, 0x77, 0x0c, 0x6b, 0xe3, 0xf2, 0x6c, 0xeb, 0x7a, 0x32, 0x58, 0xe3, 0x79, 0xb2, - 0x5f, 0x44, 0x8e, 0x74, 0x00, 0x73, 0x54, 0x07, 0x3d, 0x34, 0x55, 0x4c, 0x70, 0x22, 0x81, 0x66, - 0x82, 0x37, 0x96, 0xb7, 0xad, 0x9d, 0xd5, 0xbd, 0xc7, 0xce, 0x0d, 0x12, 0x3a, 0xb3, 0x3d, 0x0d, - 0x25, 0x30, 0x8c, 0xa2, 0xdd, 0xb5, 0x42, 0x41, 0x0d, 0x16, 0x80, 0xcd, 0x3f, 0xfe, 0xa3, 0x57, - 0x0f, 0x94, 0x8a, 0xdf, 0x29, 0xbd, 0x7e, 0x46, 0x75, 0x33, 0x12, 0x91, 0xf0, 0x4b, 0xce, 0x24, - 0x24, 0xc0, 0x55, 0xa9, 0xd7, 0x27, 0x8b, 0x53, 0x1f, 0xea, 0xcf, 0x60, 0x86, 0x9b, 0xd7, 0xea, - 0x5a, 0x91, 0xa0, 0x96, 0x2e, 0xc0, 0x9b, 0xbf, 0x57, 0xd0, 0x23, 0xa3, 0x95, 0x19, 0xff, 0x25, - 0xe3, 0x8c, 0x0f, 0x0f, 0xd8, 0x60, 0xc0, 0xc2, 0x3c, 0x56, 0xa7, 0x47, 0x69, 0x44, 0x15, 0x44, - 0xf8, 0x21, 0x42, 0x19, 0xc8, 0x31, 0x0b, 0x81, 0xb0, 0xc8, 0x08, 0x58, 0x0d, 0xaa, 0x65, 0xc4, - 0x8f, 0xf0, 0x33, 0xf4, 0x20, 0x95, 0x30, 0x26, 0x8a, 0xca, 0x21, 0x28, 0x32, 0xa2, 0xd9, 0x88, - 0x8c, 0x60, 0x42, 0x80, 0x87, 0x22, 0x82, 0xc8, 0x88, 0x56, 0x0d, 0x1a, 0x1a, 0xf3, 0xca, 0x40, - 0x5e, 0xd0, 0x6c, 0xf4, 0x02, 0x26, 0x5e, 0x91, 0xc7, 0x5f, 0xa1, 0x8f, 0x39, 0x9c, 0xfc, 0x2f, - 0xfd, 0x8e, 0xa1, 0x7f, 0xc8, 0xe1, 0xe4, 0x46, 0xf6, 0x2e, 0xba, 0x6f, 0xba, 0xcf, 0x9e, 0x07, - 0x81, 0x84, 0x1a, 0xc1, 0x96, 0xf5, 0xc6, 0x30, 0xee, 0x4c, 0x9f, 0x8e, 0x97, 0x50, 0xfc, 0x19, - 0xc2, 0xba, 0xd9, 0x02, 0xfa, 0xae, 0x41, 0xaf, 0x71, 0x38, 0x99, 0x07, 0x37, 0x7f, 0xad, 0xa0, - 0x07, 0x46, 0x9e, 0x56, 0x9a, 0xc6, 0x2c, 0x34, 0xff, 0xb2, 0xee, 0x18, 0x64, 0xb9, 0x7b, 0x84, - 0x3f, 0x45, 0x35, 0x3a, 0x4b, 0x11, 0x1a, 0x45, 0xb2, 0xd4, 0x67, 0x6d, 0x2e, 0xde, 0x8a, 0x22, - 0x89, 0xbf, 0x40, 0x1f, 0x64, 0xb9, 0x8e, 0x81, 0x24, 0x22, 0x05, 0x49, 0x95, 0x90, 0x05, 0xa1, - 0xd0, 0x67, 0x7d, 0x9a, 0xed, 0x96, 0x49, 0xc3, 0x7a, 0x86, 0x56, 0x60, 0x92, 0x42, 0xa8, 0x20, - 0x22, 0xfd, 0x5c, 0x72, 0xa3, 0xc6, 0xbd, 0xbd, 0x8f, 0x9c, 0xc2, 0x66, 0x1c, 0x6d, 0x33, 0x4e, - 0x69, 0x33, 0xce, 0xbe, 0x60, 0x3c, 0x78, 0x7f, 0x8a, 0x6f, 0xe7, 0x92, 0xe3, 0xaf, 0xd1, 0x2a, - 0x0c, 0x06, 0x10, 0x2a, 0x36, 0x86, 0xa2, 0xc0, 0xf2, 0x6d, 0x05, 0x56, 0xae, 0x08, 0xba, 0x42, - 0xf3, 0x2f, 0x0b, 0xad, 0x1b, 0x0d, 0x7a, 0xe5, 0x7c, 0xbd, 0x98, 0x66, 0x23, 0x88, 0xde, 0xb2, - 0x90, 0xf5, 0x96, 0x85, 0x3e, 0x47, 0x58, 0x6b, 0x0f, 0x85, 0x8d, 0x11, 0x73, 0xc9, 0xca, 0x7b, - 0x15, 0xd4, 0x78, 0x3e, 0xf5, 0x37, 0x73, 0x1d, 0x33, 0xdc, 0x46, 0x6b, 0x99, 0x6e, 0xc7, 0xf8, - 0x90, 0xd0, 0x44, 0xe4, 0x5c, 0xdd, 0x2e, 0xc0, 0xea, 0x94, 0xd1, 0x32, 0x84, 0xc7, 0x3f, 0xa1, - 0x8d, 0x1b, 0x1d, 0x05, 0x3f, 0x42, 0x0f, 0xbd, 0x1f, 0x0e, 0xfd, 0xa0, 0xf5, 0xca, 0xef, 0x76, - 0x48, 0xe0, 0xb5, 0x7a, 0xdd, 0x0e, 0x39, 0xea, 0xf4, 0x0e, 0xbd, 0x7d, 0xff, 0xb9, 0xef, 0x1d, - 0xd4, 0x96, 0x70, 0x1d, 0xad, 0x1c, 0x06, 0xdd, 0xee, 0x73, 0xf2, 0xd2, 0xef, 0xf5, 0xfc, 0xce, - 0x37, 0x35, 0x6b, 0x16, 0xf2, 0x3b, 0xdf, 0xb7, 0xbe, 0xf5, 0x0f, 0x6a, 0x95, 0xf6, 0x77, 0x7f, - 0x9f, 0xdb, 0xd6, 0xeb, 0x73, 0xdb, 0x7a, 0x73, 0x6e, 0x5b, 0xff, 0x9c, 0xdb, 0xd6, 0x6f, 0x17, - 0xf6, 0xd2, 0xeb, 0x0b, 0x7b, 0xe9, 0xcd, 0x85, 0xbd, 0xf4, 0xe3, 0xd3, 0x21, 0x53, 0xa3, 0xbc, - 0xef, 0x84, 0x22, 0x71, 0xf5, 0xf5, 0xdd, 0xe5, 0xa0, 0x4e, 0x84, 0x3c, 0x76, 0xaf, 0x3c, 0x7f, - 0x32, 0xff, 0x86, 0x31, 0xd6, 0xdf, 0x7f, 0xcf, 0x78, 0xff, 0xd3, 0x7f, 0x03, 0x00, 0x00, 0xff, - 0xff, 0x69, 0x2d, 0x41, 0xba, 0x85, 0x06, 0x00, 0x00, -} - -func (m *EventClaimExpired) 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 *EventClaimExpired) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventClaimExpired) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExpirationReason != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.ExpirationReason)) - i-- - dAtA[i] = 0x20 - } - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x18 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x10 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventClaimSettled) 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 *EventClaimSettled) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventClaimSettled) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProofRequirement != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.ProofRequirement)) - i-- - dAtA[i] = 0x20 - } - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) - i-- - dAtA[i] = 0x18 - } - if m.NumRelays != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) - i-- - dAtA[i] = 0x10 - } - if m.Claim != nil { - { - size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventRelayMiningDifficultyUpdated) 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 *EventRelayMiningDifficultyUpdated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventRelayMiningDifficultyUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NewNumRelaysEma != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NewNumRelaysEma)) - i-- - dAtA[i] = 0x28 - } - if m.PrevNumRelaysEma != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.PrevNumRelaysEma)) - i-- - dAtA[i] = 0x20 - } - if len(m.NewTargetHashHexEncoded) > 0 { - i -= len(m.NewTargetHashHexEncoded) - copy(dAtA[i:], m.NewTargetHashHexEncoded) - i = encodeVarintEvent(dAtA, i, uint64(len(m.NewTargetHashHexEncoded))) - i-- - dAtA[i] = 0x1a - } - if len(m.PrevTargetHashHexEncoded) > 0 { - i -= len(m.PrevTargetHashHexEncoded) - copy(dAtA[i:], m.PrevTargetHashHexEncoded) - i = encodeVarintEvent(dAtA, i, uint64(len(m.PrevTargetHashHexEncoded))) - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintEvent(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventApplicationOverserviced) 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 *EventApplicationOverserviced) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventApplicationOverserviced) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EffectiveBurn != nil { - { - size, err := m.EffectiveBurn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.ExpectedBurn != nil { - { - size, err := m.ExpectedBurn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.SupplierOperatorAddr) > 0 { - i -= len(m.SupplierOperatorAddr) - copy(dAtA[i:], m.SupplierOperatorAddr) - i = encodeVarintEvent(dAtA, i, uint64(len(m.SupplierOperatorAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.ApplicationAddr) > 0 { - i -= len(m.ApplicationAddr) - copy(dAtA[i:], m.ApplicationAddr) - i = encodeVarintEvent(dAtA, i, uint64(len(m.ApplicationAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventSupplierSlashed) 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 *EventSupplierSlashed) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSupplierSlashed) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SlashingAmount != nil { - { - size, err := m.SlashingAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.NumExpiredClaims != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumExpiredClaims)) - i-- - dAtA[i] = 0x10 - } - if len(m.SupplierOperatorAddr) > 0 { - i -= len(m.SupplierOperatorAddr) - copy(dAtA[i:], m.SupplierOperatorAddr) - i = encodeVarintEvent(dAtA, i, uint64(len(m.SupplierOperatorAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventClaimExpired) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - if m.ExpirationReason != 0 { - n += 1 + sovEvent(uint64(m.ExpirationReason)) - } - return n -} - -func (m *EventClaimSettled) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Claim != nil { - l = m.Claim.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumRelays != 0 { - n += 1 + sovEvent(uint64(m.NumRelays)) - } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) - } - if m.ProofRequirement != 0 { - n += 1 + sovEvent(uint64(m.ProofRequirement)) - } - return n -} - -func (m *EventRelayMiningDifficultyUpdated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.PrevTargetHashHexEncoded) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.NewTargetHashHexEncoded) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - if m.PrevNumRelaysEma != 0 { - n += 1 + sovEvent(uint64(m.PrevNumRelaysEma)) - } - if m.NewNumRelaysEma != 0 { - n += 1 + sovEvent(uint64(m.NewNumRelaysEma)) - } - return n -} - -func (m *EventApplicationOverserviced) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ApplicationAddr) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.SupplierOperatorAddr) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - if m.ExpectedBurn != nil { - l = m.ExpectedBurn.Size() - n += 1 + l + sovEvent(uint64(l)) - } - if m.EffectiveBurn != nil { - l = m.EffectiveBurn.Size() - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func (m *EventSupplierSlashed) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SupplierOperatorAddr) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - if m.NumExpiredClaims != 0 { - n += 1 + sovEvent(uint64(m.NumExpiredClaims)) - } - if m.SlashingAmount != nil { - l = m.SlashingAmount.Size() - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventClaimExpired) 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 ErrIntOverflowEvent - } - 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: EventClaimExpired: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventClaimExpired: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &types.Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationReason", wireType) - } - m.ExpirationReason = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpirationReason |= ClaimExpirationReason(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventClaimSettled) 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 ErrIntOverflowEvent - } - 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: EventClaimSettled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventClaimSettled: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claim == nil { - m.Claim = &types.Claim{} - } - if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - m.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - m.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofRequirement", wireType) - } - m.ProofRequirement = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProofRequirement |= types.ProofRequirementReason(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventRelayMiningDifficultyUpdated) 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 ErrIntOverflowEvent - } - 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: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) - } - m.PrevNumRelaysEma = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevNumRelaysEma |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) - } - m.NewNumRelaysEma = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NewNumRelaysEma |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventApplicationOverserviced) 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 ErrIntOverflowEvent - } - 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: EventApplicationOverserviced: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventApplicationOverserviced: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApplicationAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedBurn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExpectedBurn == nil { - m.ExpectedBurn = &types1.Coin{} - } - if err := m.ExpectedBurn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EffectiveBurn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EffectiveBurn == nil { - m.EffectiveBurn = &types1.Coin{} - } - if err := m.EffectiveBurn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventSupplierSlashed) 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 ErrIntOverflowEvent - } - 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: EventSupplierSlashed: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSupplierSlashed: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SupplierOperatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumExpiredClaims", wireType) - } - m.NumExpiredClaims = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumExpiredClaims |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashingAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlashingAmount == nil { - m.SlashingAmount = &types1.Coin{} - } - if err := m.SlashingAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/genesis.pb.go b/x/tokenomics/types/genesis.pb.go deleted file mode 100644 index 72f5188ed..000000000 --- a/x/tokenomics/types/genesis.pb.go +++ /dev/null @@ -1,387 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// GenesisState defines the tokenomics module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - RelayMiningDifficultyList []RelayMiningDifficulty `protobuf:"bytes,2,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_a4de321d172b0811, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetRelayMiningDifficultyList() []RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficultyList - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "poktroll.tokenomics.GenesisState") -} - -func init() { proto.RegisterFile("poktroll/tokenomics/genesis.proto", fileDescriptor_a4de321d172b0811) } - -var fileDescriptor_a4de321d172b0811 = []byte{ - // 289 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, - 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, - 0x29, 0xd1, 0x43, 0x28, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, - 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x55, 0xc0, 0x66, 0x41, - 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x7c, 0x29, 0x43, 0x6c, 0x2a, 0x8a, 0x52, 0x73, 0x12, 0x2b, - 0xe3, 0x73, 0x33, 0xf3, 0x32, 0xf3, 0xd2, 0xe3, 0x53, 0x32, 0xd3, 0xd2, 0x32, 0x93, 0x4b, 0x73, - 0x4a, 0x2a, 0x21, 0x5a, 0x94, 0xf6, 0x31, 0x72, 0xf1, 0xb8, 0x43, 0x1c, 0x19, 0x5c, 0x92, 0x58, - 0x92, 0x2a, 0x64, 0xc7, 0xc5, 0x06, 0x31, 0x53, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x5a, - 0x0f, 0x8b, 0xa3, 0xf5, 0x02, 0xc0, 0x4a, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, - 0x83, 0x16, 0x63, 0x10, 0x54, 0x97, 0x50, 0x1e, 0x97, 0x24, 0xd8, 0x46, 0x5f, 0xb0, 0x85, 0x2e, - 0x70, 0xfb, 0x7c, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xb4, 0xb0, 0x1a, - 0x19, 0x84, 0x4d, 0x97, 0x13, 0x0b, 0xc8, 0x86, 0x20, 0xdc, 0x46, 0x3a, 0x05, 0x9e, 0x78, 0x24, - 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, - 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xc6, 0xe9, 0x99, 0x25, - 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x4b, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, - 0x8b, 0xb2, 0xf5, 0xe1, 0x21, 0x55, 0x81, 0x1c, 0x56, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, - 0xe0, 0xa0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xac, 0xa4, 0x6f, 0xd2, 0x01, 0x00, - 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RelayMiningDifficultyList) > 0 { - for iNdEx := len(m.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RelayMiningDifficultyList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.RelayMiningDifficultyList) > 0 { - for _, e := range m.RelayMiningDifficultyList { - l = e.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 *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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficultyList", 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.RelayMiningDifficultyList = append(m.RelayMiningDifficultyList, RelayMiningDifficulty{}) - if err := m.RelayMiningDifficultyList[len(m.RelayMiningDifficultyList)-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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/params.pb.go b/x/tokenomics/types/params.pb.go deleted file mode 100644 index 909476b25..000000000 --- a/x/tokenomics/types/params.pb.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// Params defines the parameters for the tokenomics module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_df10a06914fc6eee, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "poktroll.tokenomics.Params") -} - -func init() { proto.RegisterFile("poktroll/tokenomics/params.proto", fileDescriptor_df10a06914fc6eee) } - -var fileDescriptor_df10a06914fc6eee = []byte{ - // 184 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, - 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xa9, - 0xd0, 0x43, 0xa8, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, 0x52, - 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xd2, 0xe7, 0x62, 0x0b, - 0x00, 0x9b, 0x66, 0xa5, 0xfa, 0x62, 0x81, 0x3c, 0x63, 0xd7, 0xf3, 0x0d, 0x5a, 0x32, 0x70, 0x2b, - 0x2b, 0x90, 0x2d, 0x85, 0x28, 0x73, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, - 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x8c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, - 0x73, 0xf5, 0x41, 0xc6, 0xe8, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0x63, 0x37, 0xb3, - 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x14, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x45, 0xfa, 0x9e, 0x90, 0xec, 0x00, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/query.pb.go b/x/tokenomics/types/query.pb.go deleted file mode 100644 index 70675f20f..000000000 --- a/x/tokenomics/types/query.pb.go +++ /dev/null @@ -1,1369 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetRelayMiningDifficultyRequest struct { - ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` -} - -func (m *QueryGetRelayMiningDifficultyRequest) Reset() { *m = QueryGetRelayMiningDifficultyRequest{} } -func (m *QueryGetRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} -func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{2} -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.Merge(m, src) -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetRelayMiningDifficultyRequest proto.InternalMessageInfo - -func (m *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -type QueryGetRelayMiningDifficultyResponse struct { - RelayMiningDifficulty RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` -} - -func (m *QueryGetRelayMiningDifficultyResponse) Reset() { *m = QueryGetRelayMiningDifficultyResponse{} } -func (m *QueryGetRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} -func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{3} -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.Merge(m, src) -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetRelayMiningDifficultyResponse proto.InternalMessageInfo - -func (m *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficulty - } - return RelayMiningDifficulty{} -} - -type QueryAllRelayMiningDifficultyRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRelayMiningDifficultyRequest) Reset() { *m = QueryAllRelayMiningDifficultyRequest{} } -func (m *QueryAllRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} -func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{4} -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.Merge(m, src) -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRelayMiningDifficultyRequest proto.InternalMessageInfo - -func (m *QueryAllRelayMiningDifficultyRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllRelayMiningDifficultyResponse struct { - RelayMiningDifficulty []RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRelayMiningDifficultyResponse) Reset() { *m = QueryAllRelayMiningDifficultyResponse{} } -func (m *QueryAllRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} -func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{5} -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.Merge(m, src) -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRelayMiningDifficultyResponse proto.InternalMessageInfo - -func (m *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficulty - } - return nil -} - -func (m *QueryAllRelayMiningDifficultyResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.tokenomics.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.tokenomics.QueryParamsResponse") - proto.RegisterType((*QueryGetRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest") - proto.RegisterType((*QueryGetRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse") - proto.RegisterType((*QueryAllRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest") - proto.RegisterType((*QueryAllRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse") -} - -func init() { proto.RegisterFile("poktroll/tokenomics/query.proto", fileDescriptor_19d6daded0c54373) } - -var fileDescriptor_19d6daded0c54373 = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0xb5, 0x06, 0x32, 0x9e, 0x9c, 0xb6, 0x50, 0x63, 0xd9, 0x96, 0x45, 0x6d, 0x08, - 0xb8, 0x63, 0xda, 0x53, 0x15, 0x84, 0x84, 0x6a, 0xf0, 0x50, 0x68, 0x17, 0xbc, 0x78, 0x09, 0x93, - 0xed, 0x64, 0x1d, 0xb2, 0x3b, 0xb3, 0xdd, 0x9d, 0x54, 0x83, 0x78, 0xf1, 0x2e, 0x0a, 0x7e, 0x09, - 0x8f, 0x7e, 0x8c, 0x9e, 0xa4, 0xa0, 0x87, 0x5c, 0x14, 0x49, 0x04, 0xbf, 0x86, 0xec, 0xcc, 0xa4, - 0x49, 0x71, 0x37, 0x0b, 0xc5, 0xcb, 0xb2, 0x3b, 0xf3, 0xde, 0xfb, 0xff, 0x7f, 0x6f, 0xde, 0x0e, - 0xdc, 0x8c, 0x44, 0x5f, 0xc6, 0x22, 0x08, 0xb0, 0x14, 0x7d, 0xca, 0x45, 0xc8, 0xbc, 0x04, 0x9f, - 0x0c, 0x68, 0x3c, 0x74, 0xa2, 0x58, 0x48, 0x81, 0x56, 0xa6, 0x01, 0xce, 0x2c, 0xa0, 0x7a, 0x93, - 0x84, 0x8c, 0x0b, 0xac, 0x9e, 0x3a, 0xae, 0xba, 0xea, 0x0b, 0x5f, 0xa8, 0x57, 0x9c, 0xbe, 0x99, - 0xd5, 0x0d, 0x5f, 0x08, 0x3f, 0xa0, 0x98, 0x44, 0x0c, 0x13, 0xce, 0x85, 0x24, 0x92, 0x09, 0x9e, - 0x98, 0xdd, 0x5b, 0x9e, 0x48, 0x42, 0x91, 0x74, 0x74, 0x9a, 0xfe, 0x30, 0x5b, 0x75, 0xfd, 0x85, - 0xbb, 0x24, 0xa1, 0xda, 0x0f, 0x3e, 0x6d, 0x74, 0xa9, 0x24, 0x0d, 0x1c, 0x11, 0x9f, 0x71, 0x55, - 0xc7, 0xc4, 0x5a, 0xf3, 0xb1, 0xd3, 0x28, 0x4f, 0xb0, 0xe9, 0xfe, 0x56, 0x16, 0x63, 0x44, 0x62, - 0x12, 0x4e, 0xd5, 0x1a, 0x59, 0x11, 0x31, 0x0d, 0xc8, 0xb0, 0x13, 0x32, 0xce, 0xb8, 0xdf, 0x39, - 0x66, 0xbd, 0x1e, 0xf3, 0x06, 0x81, 0x34, 0x7d, 0xb1, 0x57, 0x21, 0x3a, 0x4a, 0x6d, 0x1d, 0xaa, - 0x3a, 0x2e, 0x3d, 0x19, 0xd0, 0x44, 0xda, 0xcf, 0xe1, 0xca, 0xa5, 0xd5, 0x24, 0x12, 0x3c, 0xa1, - 0xe8, 0x31, 0x2c, 0x6b, 0xbd, 0x75, 0xb0, 0x05, 0x6a, 0x37, 0x76, 0x6e, 0x3b, 0x19, 0x5d, 0x75, - 0x74, 0x52, 0xab, 0x72, 0xf6, 0x73, 0xb3, 0xf4, 0xf9, 0xcf, 0x97, 0x3a, 0x70, 0x4d, 0x96, 0xbd, - 0x0f, 0xef, 0xa8, 0xb2, 0x6d, 0x2a, 0xdd, 0xd4, 0xd5, 0x81, 0x32, 0xb5, 0x7f, 0xe1, 0xc9, 0xc8, - 0xa3, 0x0d, 0x58, 0x49, 0x68, 0x7c, 0xca, 0x3c, 0xfa, 0xec, 0x58, 0x49, 0x55, 0xdc, 0xd9, 0x82, - 0xfd, 0x01, 0xc0, 0xbb, 0x05, 0x65, 0x8c, 0xdf, 0x1e, 0x5c, 0x8b, 0xb3, 0x02, 0x8c, 0xfd, 0x7a, - 0xa6, 0xfd, 0xcc, 0x92, 0xad, 0xe5, 0x94, 0xc6, 0xcd, 0x2e, 0x67, 0x73, 0xc3, 0xd5, 0x0c, 0x82, - 0x85, 0x5c, 0x4f, 0x21, 0x9c, 0x9d, 0xba, 0x31, 0x71, 0xcf, 0x31, 0x03, 0x93, 0x1e, 0xbb, 0xa3, - 0x47, 0xd6, 0x1c, 0xbe, 0x73, 0x48, 0x7c, 0x6a, 0x72, 0xdd, 0xb9, 0x4c, 0x7b, 0x34, 0xed, 0x40, - 0xbe, 0x60, 0x71, 0x07, 0xae, 0xfd, 0xc7, 0x0e, 0xa0, 0xf6, 0x25, 0xb2, 0x25, 0x45, 0xb6, 0x5d, - 0x48, 0xa6, 0x4d, 0xce, 0xa3, 0xed, 0x7c, 0x5d, 0x86, 0xd7, 0x15, 0x1a, 0x7a, 0x0f, 0x60, 0x59, - 0x8f, 0x12, 0xda, 0xce, 0xb4, 0xf9, 0xef, 0xdc, 0x56, 0x6b, 0xc5, 0x81, 0x5a, 0xd3, 0x7e, 0xf0, - 0xee, 0xdb, 0xef, 0x4f, 0x4b, 0x75, 0x54, 0xc3, 0x69, 0xc6, 0x7d, 0x4e, 0xe5, 0x2b, 0x11, 0xf7, - 0x71, 0xfe, 0x2f, 0x86, 0x7e, 0x00, 0xb8, 0x96, 0xd9, 0x19, 0xb4, 0x97, 0xaf, 0x5a, 0x30, 0xe9, - 0xd5, 0x87, 0x57, 0x49, 0x35, 0x08, 0x07, 0x0a, 0xa1, 0x8d, 0x9e, 0x14, 0x23, 0xe4, 0xdc, 0x01, - 0xf8, 0xcd, 0xc5, 0x5f, 0xf5, 0x16, 0x7d, 0x07, 0x70, 0x3d, 0x53, 0xb0, 0x19, 0x04, 0x8b, 0x10, - 0x0b, 0x86, 0x7e, 0x11, 0x62, 0xd1, 0xf8, 0xda, 0x4d, 0x85, 0xf8, 0x08, 0xed, 0x5d, 0x19, 0xb1, - 0x75, 0x74, 0x36, 0xb6, 0xc0, 0xf9, 0xd8, 0x02, 0xa3, 0xb1, 0x05, 0x7e, 0x8d, 0x2d, 0xf0, 0x71, - 0x62, 0x95, 0xce, 0x27, 0x56, 0x69, 0x34, 0xb1, 0x4a, 0x2f, 0x76, 0x7d, 0x26, 0x5f, 0x0e, 0xba, - 0x8e, 0x27, 0xc2, 0x1c, 0x89, 0xd7, 0xf3, 0x22, 0x72, 0x18, 0xd1, 0xa4, 0x5b, 0x56, 0x57, 0xe7, - 0xee, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x5a, 0x86, 0x05, 0x75, 0x06, 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 RelayMiningDifficulty items. - RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/poktroll.tokenomics.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { - out := new(QueryGetRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficulty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { - out := new(QueryAllRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", in, out, opts...) - 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 RelayMiningDifficulty items. - RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, 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) RelayMiningDifficulty(ctx context.Context, req *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") -} -func (*UnimplementedQueryServer) RelayMiningDifficultyAll(ctx context.Context, req *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/poktroll.tokenomics.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 _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficulty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficulty", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.tokenomics.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "RelayMiningDifficulty", - Handler: _Query_RelayMiningDifficulty_Handler, - }, - { - MethodName: "RelayMiningDifficultyAll", - Handler: _Query_RelayMiningDifficultyAll_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/tokenomics/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 { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -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 (m *QueryGetRelayMiningDifficultyRequest) 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 *QueryGetRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRelayMiningDifficultyResponse) 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 *QueryGetRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RelayMiningDifficulty.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 *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyResponse) 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 *QueryAllRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRelayMiningDifficultyResponse) 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.RelayMiningDifficulty) > 0 { - for iNdEx := len(m.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RelayMiningDifficulty[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 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 *QueryGetRelayMiningDifficultyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetRelayMiningDifficultyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.RelayMiningDifficulty.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RelayMiningDifficulty) > 0 { - for _, e := range m.RelayMiningDifficulty { - 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 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 *QueryGetRelayMiningDifficultyRequest) 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: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = 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 *QueryGetRelayMiningDifficultyResponse) 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: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty.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 *QueryAllRelayMiningDifficultyRequest) 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: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllRelayMiningDifficultyResponse) 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: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty = append(m.RelayMiningDifficulty, RelayMiningDifficulty{}) - if err := m.RelayMiningDifficulty[len(m.RelayMiningDifficulty)-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:]) - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/query.pb.gw.go b/x/tokenomics/types/query.pb.gw.go deleted file mode 100644 index 15d7f5446..000000000 --- a/x/tokenomics/types/query.pb.gw.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: poktroll/tokenomics/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["serviceId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") - } - - protoReq.ServiceId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) - } - - msg, err := client.RelayMiningDifficulty(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["serviceId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") - } - - protoReq.ServiceId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) - } - - msg, err := server.RelayMiningDifficulty(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_RelayMiningDifficultyAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRelayMiningDifficultyRequest - 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_RelayMiningDifficultyAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RelayMiningDifficultyAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRelayMiningDifficultyRequest - 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_RelayMiningDifficultyAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RelayMiningDifficultyAll(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficulty_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_RelayMiningDifficulty_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_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficulty_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_RelayMiningDifficulty_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_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_RelayMiningDifficulty_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty", "serviceId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_RelayMiningDifficultyAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_RelayMiningDifficulty_0 = runtime.ForwardResponseMessage - - forward_Query_RelayMiningDifficultyAll_0 = runtime.ForwardResponseMessage -) diff --git a/x/tokenomics/types/relay_mining_difficulty.pb.go b/x/tokenomics/types/relay_mining_difficulty.pb.go deleted file mode 100644 index 981a19384..000000000 --- a/x/tokenomics/types/relay_mining_difficulty.pb.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/relay_mining_difficulty.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - 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 - -// RelayMiningDifficulty is a message used to store the on-chain Relay Mining -// difficulty associated with a specific service ID. -type RelayMiningDifficulty struct { - // The service ID the relay mining difficulty is associated with. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // The block height at which this relay mining difficulty was computed. - // This is needed to determine how much time has passed since the last time - // the exponential moving average was computed. - BlockHeight int64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - // The exponential moving average of the number of relays for this service. - NumRelaysEma uint64 `protobuf:"varint,3,opt,name=num_relays_ema,json=numRelaysEma,proto3" json:"num_relays_ema,omitempty"` - // The target hash determining the difficulty to mine relays for this service. - // For example, if we use sha256 to hash the (RelayRequest,ReqlayResponse) tuple, - // and the difficulty has 4 leading zero bits, then the target hash would be: - // 0b0000111... (until 32 bytes are filled up). - TargetHash []byte `protobuf:"bytes,4,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"` -} - -func (m *RelayMiningDifficulty) Reset() { *m = RelayMiningDifficulty{} } -func (m *RelayMiningDifficulty) String() string { return proto.CompactTextString(m) } -func (*RelayMiningDifficulty) ProtoMessage() {} -func (*RelayMiningDifficulty) Descriptor() ([]byte, []int) { - return fileDescriptor_1777fca7cd39aaea, []int{0} -} -func (m *RelayMiningDifficulty) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RelayMiningDifficulty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *RelayMiningDifficulty) XXX_Merge(src proto.Message) { - xxx_messageInfo_RelayMiningDifficulty.Merge(m, src) -} -func (m *RelayMiningDifficulty) XXX_Size() int { - return m.Size() -} -func (m *RelayMiningDifficulty) XXX_DiscardUnknown() { - xxx_messageInfo_RelayMiningDifficulty.DiscardUnknown(m) -} - -var xxx_messageInfo_RelayMiningDifficulty proto.InternalMessageInfo - -func (m *RelayMiningDifficulty) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *RelayMiningDifficulty) GetBlockHeight() int64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *RelayMiningDifficulty) GetNumRelaysEma() uint64 { - if m != nil { - return m.NumRelaysEma - } - return 0 -} - -func (m *RelayMiningDifficulty) GetTargetHash() []byte { - if m != nil { - return m.TargetHash - } - return nil -} - -func init() { - proto.RegisterType((*RelayMiningDifficulty)(nil), "poktroll.tokenomics.RelayMiningDifficulty") -} - -func init() { - proto.RegisterFile("poktroll/tokenomics/relay_mining_difficulty.proto", fileDescriptor_1777fca7cd39aaea) -} - -var fileDescriptor_1777fca7cd39aaea = []byte{ - // 292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0xeb, 0xbf, 0xd5, 0x2f, 0xd5, 0xad, 0x18, 0x02, 0x48, 0x11, 0x12, 0x26, 0x20, 0x86, - 0x2c, 0x34, 0x42, 0x7d, 0x03, 0x04, 0x52, 0x19, 0x18, 0xc8, 0xc8, 0x62, 0x39, 0x89, 0x6b, 0x5b, - 0x89, 0xed, 0xc8, 0x76, 0x80, 0xbc, 0x05, 0x8f, 0xc0, 0xe3, 0x30, 0x76, 0xec, 0x88, 0x92, 0x17, - 0x41, 0x71, 0xa1, 0xb0, 0x59, 0x9f, 0xef, 0x39, 0xf7, 0x9e, 0x03, 0xaf, 0x6b, 0x5d, 0x3a, 0xa3, - 0xab, 0x2a, 0x71, 0xba, 0xa4, 0x4a, 0x4b, 0x91, 0xdb, 0xc4, 0xd0, 0x8a, 0xb4, 0x58, 0x0a, 0x25, - 0x14, 0xc3, 0x85, 0x58, 0xaf, 0x45, 0xde, 0x54, 0xae, 0x5d, 0xd4, 0x46, 0x3b, 0x1d, 0x1c, 0xfe, - 0x48, 0x16, 0xbf, 0x92, 0x93, 0x23, 0xa6, 0x99, 0xf6, 0xff, 0xc9, 0xf0, 0xda, 0x8d, 0x5e, 0xbc, - 0x03, 0x78, 0x9c, 0x0e, 0x66, 0x0f, 0xde, 0xeb, 0x76, 0x6f, 0x15, 0x9c, 0x42, 0x68, 0xa9, 0x79, - 0x16, 0x39, 0xc5, 0xa2, 0x08, 0x41, 0x04, 0xe2, 0x69, 0x3a, 0xfd, 0x26, 0xf7, 0x45, 0x70, 0x0e, - 0xe7, 0x59, 0xa5, 0xf3, 0x12, 0x73, 0x2a, 0x18, 0x77, 0xe1, 0xbf, 0x08, 0xc4, 0xe3, 0x74, 0xe6, - 0xd9, 0xca, 0xa3, 0xe0, 0x12, 0x1e, 0xa8, 0x46, 0x62, 0x7f, 0xab, 0xc5, 0x54, 0x92, 0x70, 0x1c, - 0x81, 0x78, 0x92, 0xce, 0x55, 0x23, 0xfd, 0x4e, 0x7b, 0x27, 0x49, 0x70, 0x06, 0x67, 0x8e, 0x18, - 0x46, 0x1d, 0xe6, 0xc4, 0xf2, 0x70, 0x12, 0x81, 0x78, 0x9e, 0xc2, 0x1d, 0x5a, 0x11, 0xcb, 0x6f, - 0x1e, 0x3f, 0x3a, 0x04, 0x36, 0x1d, 0x02, 0xdb, 0x0e, 0x81, 0xcf, 0x0e, 0x81, 0xb7, 0x1e, 0x8d, - 0x36, 0x3d, 0x1a, 0x6d, 0x7b, 0x34, 0x7a, 0x5a, 0x32, 0xe1, 0x78, 0x93, 0x2d, 0x72, 0x2d, 0x93, - 0x21, 0xf6, 0x95, 0xa2, 0xee, 0x45, 0x9b, 0x32, 0xd9, 0xd7, 0xf6, 0xfa, 0xb7, 0x38, 0xd7, 0xd6, - 0xd4, 0x66, 0xff, 0x7d, 0xf8, 0xe5, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x9e, 0x74, 0x57, - 0x5c, 0x01, 0x00, 0x00, -} - -func (m *RelayMiningDifficulty) 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 *RelayMiningDifficulty) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RelayMiningDifficulty) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TargetHash) > 0 { - i -= len(m.TargetHash) - copy(dAtA[i:], m.TargetHash) - i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(len(m.TargetHash))) - i-- - dAtA[i] = 0x22 - } - if m.NumRelaysEma != 0 { - i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(m.NumRelaysEma)) - i-- - dAtA[i] = 0x18 - } - if m.BlockHeight != 0 { - i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x10 - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRelayMiningDifficulty(dAtA []byte, offset int, v uint64) int { - offset -= sovRelayMiningDifficulty(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RelayMiningDifficulty) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovRelayMiningDifficulty(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovRelayMiningDifficulty(uint64(m.BlockHeight)) - } - if m.NumRelaysEma != 0 { - n += 1 + sovRelayMiningDifficulty(uint64(m.NumRelaysEma)) - } - l = len(m.TargetHash) - if l > 0 { - n += 1 + l + sovRelayMiningDifficulty(uint64(l)) - } - return n -} - -func sovRelayMiningDifficulty(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRelayMiningDifficulty(x uint64) (n int) { - return sovRelayMiningDifficulty(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RelayMiningDifficulty) 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 ErrIntOverflowRelayMiningDifficulty - } - 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: RelayMiningDifficulty: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RelayMiningDifficulty: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelayMiningDifficulty - } - 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 ErrInvalidLengthRelayMiningDifficulty - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRelayMiningDifficulty - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelayMiningDifficulty - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumRelaysEma", wireType) - } - m.NumRelaysEma = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelayMiningDifficulty - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumRelaysEma |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRelayMiningDifficulty - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRelayMiningDifficulty - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRelayMiningDifficulty - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TargetHash = append(m.TargetHash[:0], dAtA[iNdEx:postIndex]...) - if m.TargetHash == nil { - m.TargetHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRelayMiningDifficulty(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRelayMiningDifficulty - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRelayMiningDifficulty(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, ErrIntOverflowRelayMiningDifficulty - } - 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, ErrIntOverflowRelayMiningDifficulty - } - 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, ErrIntOverflowRelayMiningDifficulty - } - 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, ErrInvalidLengthRelayMiningDifficulty - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRelayMiningDifficulty - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRelayMiningDifficulty - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRelayMiningDifficulty = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRelayMiningDifficulty = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRelayMiningDifficulty = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go deleted file mode 100644 index e4fec264c..000000000 --- a/x/tokenomics/types/tx.pb.go +++ /dev/null @@ -1,1266 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type to update all params at once. -type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/tokenomics parameters to update. - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_aa0f2fdbd9b6d7eb, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_aa0f2fdbd9b6d7eb, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. -type MsgUpdateParam struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // The (name, as_type) tuple must match the corresponding name and type as - // specified in the `Params` message in `proof/params.proto.` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to AsType: - // - // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 - // *MsgUpdateParam_AsBytes - AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` -} - -func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } -func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParam) ProtoMessage() {} -func (*MsgUpdateParam) Descriptor() ([]byte, []int) { - return fileDescriptor_aa0f2fdbd9b6d7eb, []int{2} -} -func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParam.Merge(m, src) -} -func (m *MsgUpdateParam) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParam) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo - -type isMsgUpdateParam_AsType interface { - isMsgUpdateParam_AsType() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgUpdateParam_AsString struct { - AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` -} -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` -} -type MsgUpdateParam_AsBytes struct { - AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` -} - -func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} - -func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { - if m != nil { - return m.AsType - } - return nil -} - -func (m *MsgUpdateParam) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpdateParam) GetAsString() string { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { - return x.AsString - } - return "" -} - -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 - } - return 0 -} - -func (m *MsgUpdateParam) GetAsBytes() []byte { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { - return x.AsBytes - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), - (*MsgUpdateParam_AsBytes)(nil), - } -} - -// MsgUpdateParamResponse defines the response structure for executing a -// MsgUpdateParam message after a single param update. -type MsgUpdateParamResponse struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } -func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamResponse) ProtoMessage() {} -func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_aa0f2fdbd9b6d7eb, []int{3} -} -func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) -} -func (m *MsgUpdateParamResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo - -func (m *MsgUpdateParamResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.tokenomics.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.tokenomics.MsgUpdateParamsResponse") - proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.tokenomics.MsgUpdateParam") - proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.tokenomics.MsgUpdateParamResponse") -} - -func init() { proto.RegisterFile("poktroll/tokenomics/tx.proto", fileDescriptor_aa0f2fdbd9b6d7eb) } - -var fileDescriptor_aa0f2fdbd9b6d7eb = []byte{ - // 508 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xf6, 0x11, 0x48, 0xea, 0x6b, 0x28, 0xc2, 0x54, 0xd4, 0x35, 0xc8, 0xb1, 0x02, 0x48, 0x21, - 0xb4, 0xb6, 0x68, 0x50, 0x85, 0x3a, 0x20, 0xe1, 0xa9, 0x0c, 0x91, 0xc0, 0x88, 0x85, 0xc5, 0xba, - 0x24, 0x27, 0xd7, 0x4a, 0xed, 0xb3, 0xfc, 0xae, 0xd0, 0x6c, 0x88, 0x91, 0x89, 0x9f, 0xc1, 0x98, - 0x81, 0x7f, 0xc0, 0xd2, 0xb1, 0x30, 0x75, 0x8a, 0x50, 0x32, 0x44, 0xea, 0x5f, 0x60, 0x41, 0x3e, - 0x3b, 0x4e, 0x13, 0x59, 0x22, 0x62, 0x49, 0xde, 0x7d, 0xdf, 0xf7, 0xde, 0xdd, 0xf7, 0xde, 0x33, - 0xbe, 0x1f, 0xb1, 0x3e, 0x8f, 0xd9, 0xf1, 0xb1, 0xc5, 0x59, 0x9f, 0x86, 0x2c, 0xf0, 0xbb, 0x60, - 0xf1, 0x53, 0x33, 0x8a, 0x19, 0x67, 0xca, 0x9d, 0x19, 0x6b, 0xce, 0x59, 0xed, 0x36, 0x09, 0xfc, - 0x90, 0x59, 0xe2, 0x37, 0xd5, 0x69, 0x5b, 0x5d, 0x06, 0x01, 0x03, 0x2b, 0x00, 0xcf, 0xfa, 0xf0, - 0x34, 0xf9, 0xcb, 0x88, 0xed, 0x94, 0x70, 0xc5, 0xc9, 0x4a, 0x0f, 0x19, 0xb5, 0xe9, 0x31, 0x8f, - 0xa5, 0x78, 0x12, 0x65, 0xa8, 0x51, 0xf4, 0x9e, 0x88, 0xc4, 0x24, 0xc8, 0xf2, 0xea, 0x3f, 0x10, - 0xbe, 0xd5, 0x06, 0xef, 0x5d, 0xd4, 0x23, 0x9c, 0xbe, 0x16, 0x8c, 0xb2, 0x8f, 0x65, 0x72, 0xc2, - 0x8f, 0x58, 0xec, 0xf3, 0x81, 0x8a, 0x0c, 0xd4, 0x90, 0x6d, 0xf5, 0xd7, 0xf7, 0xdd, 0xcd, 0xec, - 0xc2, 0x97, 0xbd, 0x5e, 0x4c, 0x01, 0xde, 0xf2, 0xd8, 0x0f, 0x3d, 0x67, 0x2e, 0x55, 0x5e, 0xe0, - 0x72, 0x5a, 0x5b, 0xbd, 0x66, 0xa0, 0xc6, 0xfa, 0xde, 0x3d, 0xb3, 0xc0, 0xb0, 0x99, 0x5e, 0x62, - 0xcb, 0x67, 0xa3, 0x9a, 0xf4, 0x6d, 0x3a, 0x6c, 0x22, 0x27, 0xcb, 0x3a, 0x78, 0xfe, 0x79, 0x3a, - 0x6c, 0xce, 0xeb, 0x7d, 0x99, 0x0e, 0x9b, 0x8f, 0x72, 0x03, 0xa7, 0x57, 0x2d, 0x2c, 0xbd, 0xb8, - 0xbe, 0x8d, 0xb7, 0x96, 0x20, 0x87, 0x42, 0xc4, 0x42, 0xa0, 0xf5, 0x3f, 0x08, 0x6f, 0x2c, 0x72, - 0xff, 0xed, 0x4f, 0xc1, 0xd7, 0x43, 0x12, 0x50, 0xe1, 0x4e, 0x76, 0x44, 0xac, 0xec, 0x60, 0x99, - 0x80, 0x0b, 0x42, 0xab, 0x96, 0x44, 0xad, 0x9b, 0x97, 0xa3, 0xda, 0x1c, 0x3c, 0x94, 0x9c, 0x35, - 0x92, 0x15, 0x53, 0x1e, 0xe3, 0x35, 0x02, 0xae, 0x1f, 0xf2, 0xfd, 0x67, 0x6a, 0xd9, 0x40, 0x8d, - 0x92, 0x5d, 0xbd, 0x1c, 0xd5, 0x72, 0xec, 0x50, 0x72, 0x2a, 0x04, 0x5e, 0x25, 0x61, 0x26, 0xed, - 0x0c, 0x38, 0x05, 0xb5, 0x62, 0xa0, 0x46, 0x35, 0x97, 0x0a, 0x2c, 0x95, 0xda, 0x49, 0x78, 0xb0, - 0xb1, 0xd8, 0x37, 0x5b, 0xc6, 0x15, 0x02, 0x2e, 0x1f, 0x44, 0xb4, 0xde, 0xc6, 0x77, 0x17, 0xcd, - 0xcf, 0xfa, 0xa2, 0xb4, 0xf2, 0x61, 0xa1, 0x7f, 0x0e, 0x6b, 0x36, 0xa1, 0xbd, 0x9f, 0x08, 0x97, - 0xda, 0xe0, 0x29, 0x1d, 0x5c, 0x5d, 0xd8, 0x98, 0x87, 0x85, 0xc9, 0x4b, 0x23, 0xd1, 0x76, 0x56, - 0x51, 0xe5, 0x0f, 0x74, 0xf1, 0xfa, 0xd5, 0xa1, 0x3d, 0x58, 0x21, 0x59, 0x7b, 0xb2, 0x82, 0x68, - 0x76, 0x81, 0x76, 0xe3, 0x53, 0xb2, 0x7d, 0xf6, 0x9b, 0xb3, 0xb1, 0x8e, 0xce, 0xc7, 0x3a, 0xba, - 0x18, 0xeb, 0xe8, 0xf7, 0x58, 0x47, 0x5f, 0x27, 0xba, 0x74, 0x3e, 0xd1, 0xa5, 0x8b, 0x89, 0x2e, - 0xbd, 0x6f, 0x79, 0x3e, 0x3f, 0x3a, 0xe9, 0x98, 0x5d, 0x16, 0x58, 0x49, 0xed, 0xdd, 0x90, 0xf2, - 0x8f, 0x2c, 0xee, 0x5b, 0xc5, 0x8b, 0x99, 0x34, 0x1d, 0x3a, 0x65, 0xf1, 0x6d, 0xb5, 0xfe, 0x06, - 0x00, 0x00, 0xff, 0xff, 0x02, 0x3d, 0xf2, 0x43, 0x0f, 0x04, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { - out := new(MsgUpdateParamResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Msg/UpdateParam", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a (governance) operation for updating the module - // parameters. The authority defaults to the x/gov module account. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParam(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Msg/UpdateParam", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "poktroll.tokenomics.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "UpdateParam", - Handler: _Msg_UpdateParam_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "poktroll/tokenomics/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AsType != nil { - { - size := m.AsType.Size() - i -= size - if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.AsString) - copy(dAtA[i:], m.AsString) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.AsBytes != nil { - i -= len(m.AsBytes) - copy(dAtA[i:], m.AsBytes) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.AsType != nil { - n += m.AsType.Size() - } - return n -} - -func (m *MsgUpdateParam_AsString) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AsString) - n += 1 + l + sovTx(uint64(l)) - return n -} -func (m *MsgUpdateParam_AsInt64) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.AsInt64)) - return n -} -func (m *MsgUpdateParam_AsBytes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AsBytes != nil { - l = len(m.AsBytes) - n += 1 + l + sovTx(uint64(l)) - } - return n -} -func (m *MsgUpdateParamResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParam) 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 ErrIntOverflowTx - } - 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: MsgUpdateParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AsType = &MsgUpdateParam_AsInt64{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.AsType = &MsgUpdateParam_AsBytes{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) From 08c9b5dc02f7c9cf50258da7f8ff099ab5dc4a88 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 19 Sep 2024 21:22:10 +0200 Subject: [PATCH 44/77] chore: review improvements Co-authored-by: red-0ne --- api/poktroll/supplier/event.pulsar.go | 4 ++-- proto/poktroll/supplier/event.proto | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/poktroll/supplier/event.pulsar.go b/api/poktroll/supplier/event.pulsar.go index a32d25aad..ba4e7444f 100644 --- a/api/poktroll/supplier/event.pulsar.go +++ b/api/poktroll/supplier/event.pulsar.go @@ -1429,7 +1429,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// EventSupplierStaked is emitted with the commitment of the supplier is stake message. +// EventSupplierStaked is emitted with the commitment of the supplier stake message. type EventSupplierStaked struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1465,7 +1465,7 @@ func (x *EventSupplierStaked) GetSupplier() *shared.Supplier { return nil } -// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. +// EventSupplierUnstaked is emitted with the commitment of the supplier unstake message. type EventSupplierUnbondingBegin struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/poktroll/supplier/event.proto b/proto/poktroll/supplier/event.proto index 0227eddd7..fdcb9b47b 100644 --- a/proto/poktroll/supplier/event.proto +++ b/proto/poktroll/supplier/event.proto @@ -9,12 +9,12 @@ import "gogoproto/gogo.proto"; import "poktroll/shared/supplier.proto"; -// EventSupplierStaked is emitted with the commitment of the supplier is stake message. +// EventSupplierStaked is emitted with the commitment of the supplier stake message. message EventSupplierStaked { poktroll.shared.Supplier supplier = 1 [(gogoproto.jsontag) = "supplier"]; } -// EventSupplierUnstaked is emitted with the commitment of the supplier is unstake message. +// EventSupplierUnstaked is emitted with the commitment of the supplier unstake message. message EventSupplierUnbondingBegin { poktroll.shared.Supplier supplier = 1 [(gogoproto.jsontag) = "supplier"]; int64 unbonding_height = 2 [(gogoproto.jsontag) = "unbonding_height"]; From 8b98715b09f2356a2d6d14d376e77d7a3d30a6df Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 09:41:26 +0200 Subject: [PATCH 45/77] fix: failing tests --- testutil/keeper/session.go | 55 ++++++++++++++++------- x/proof/module/helpers_test.go | 5 +-- x/proof/module/query_claim_test.go | 24 +++++++--- x/session/keeper/session_hydrator_test.go | 29 +++++++++--- x/supplier/keeper/unbond_suppliers.go | 1 + 5 files changed, 85 insertions(+), 29 deletions(-) diff --git a/testutil/keeper/session.go b/testutil/keeper/session.go index 74ff98a07..8f84999f0 100644 --- a/testutil/keeper/session.go +++ b/testutil/keeper/session.go @@ -113,8 +113,33 @@ var ( } ) -func SessionKeeper(t testing.TB) (keeper.Keeper, context.Context) { +// keeperConfig is a configuration struct to be used during keeper construction +// to modify its behavior. +type keeperConfig struct { + // moduleParams is a map of module names to their respective module parameters. + // This is used to set the initial module parameters in the keeper. + moduleParams map[string]sdk.Msg +} + +// KeeperOptionFn is a function type that sets/updates fields on the keeperConfig. +type KeeperOptionFn func(*keeperConfig) + +// WithModuleParams returns a KeeperOptionFn that sets the moduleParams field +// on the keeperConfig. +func WithModuleParams(moduleParams map[string]sdk.Msg) KeeperOptionFn { + return func(c *keeperConfig) { + c.moduleParams = moduleParams + } +} + +func SessionKeeper(t testing.TB, opts ...KeeperOptionFn) (keeper.Keeper, context.Context) { t.Helper() + + cfg := &keeperConfig{} + for _, opt := range opts { + opt(cfg) + } + storeKey := storetypes.NewKVStoreKey(types.StoreKey) db := dbm.NewMemDB() @@ -134,7 +159,12 @@ func SessionKeeper(t testing.TB) (keeper.Keeper, context.Context) { mockAppKeeper := defaultAppKeeperMock(t) mockSupplierKeeper := defaultSupplierKeeperMock(t) - mockSharedKeeper := defaultSharedKeeperMock(t) + + sharedParams := new(sharedtypes.Params) + if params, ok := cfg.moduleParams[sharedtypes.ModuleName]; ok { + sharedParams = params.(*sharedtypes.Params) + } + mockSharedKeeper := defaultSharedKeeperMock(t, sharedParams) k := keeper.NewKeeper( cdc, @@ -218,25 +248,18 @@ func defaultSupplierKeeperMock(t testing.TB) types.SupplierKeeper { return mockSupplierKeeper } -func defaultSharedKeeperMock(t testing.TB) types.SharedKeeper { +func defaultSharedKeeperMock(t testing.TB, params *sharedtypes.Params) types.SharedKeeper { t.Helper() ctrl := gomock.NewController(t) + if params == nil { + params = new(sharedtypes.Params) + *params = sharedtypes.DefaultParams() + } + mockSharedKeeper := mocks.NewMockSharedKeeper(ctrl) mockSharedKeeper.EXPECT().GetParams(gomock.Any()). - Return(sharedtypes.DefaultParams()). + Return(*params). AnyTimes() return mockSharedKeeper } - -// TODO_TECHDEBT: Figure out how to vary the supplierKeep on a per test basis with exposing `SupplierKeeper publically` - -// type option[V any] func(k *keeper.Keeper) - -// WithPublisher returns an option function which sets the given publishCh of the -// resulting observable when passed to NewObservable(). -// func WithSupplierKeeperMock(supplierKeeper types.SupplierKeeper) option[any] { -// return func(k *keeper.Keeper) { -// k.supplierKeeper = supplierKeeper -// } -// } diff --git a/x/proof/module/helpers_test.go b/x/proof/module/helpers_test.go index 7f983a1fc..59948a505 100644 --- a/x/proof/module/helpers_test.go +++ b/x/proof/module/helpers_test.go @@ -37,6 +37,7 @@ func networkWithClaimObjects( numSessions int, numSuppliers int, numApps int, + sharedParams *sharedtypes.Params, ) (net *network.Network, claims []types.Claim, clientCtx cosmosclient.Context) { t.Helper() @@ -84,14 +85,12 @@ func networkWithClaimObjects( appGenesisBuffer, err := cfg.Codec.MarshalJSON(appGenesisState) require.NoError(t, err) - sharedParams := sharedtypes.DefaultParams() - // Create numSessions * numApps * numSuppliers claims. for sessionIdx := 0; sessionIdx < numSessions; sessionIdx++ { for _, appAcct := range appAccts { for _, supplierOperatorAcct := range supplierOperatorAccts { claim := newTestClaim( - t, &sharedParams, + t, sharedParams, supplierOperatorAcct.Address.String(), testsession.GetSessionStartHeightWithDefaultParams(1), appAcct.Address.String(), diff --git a/x/proof/module/query_claim_test.go b/x/proof/module/query_claim_test.go index 70cf9e48c..818adad8c 100644 --- a/x/proof/module/query_claim_test.go +++ b/x/proof/module/query_claim_test.go @@ -24,7 +24,8 @@ func TestClaim_Show(t *testing.T) { numSuppliers := 3 numApps := 3 - net, claims, clientCtx := networkWithClaimObjects(t, numSessions, numApps, numSuppliers) + sharedParams := sharedtypes.DefaultParams() + net, claims, clientCtx := networkWithClaimObjects(t, numSessions, numApps, numSuppliers, &sharedParams) commonArgs := []string{ fmt.Sprintf("--%s=json", cometcli.OutputFlag), @@ -122,17 +123,30 @@ func TestClaim_Show(t *testing.T) { func TestClaim_List(t *testing.T) { numSuppliers := 4 numApps := 1 + numBlocksPerSession := 4 + sharedParams := &sharedtypes.Params{ + NumBlocksPerSession: uint64(numBlocksPerSession), + GracePeriodEndOffsetBlocks: 1, + ClaimWindowOpenOffsetBlocks: 1, + ClaimWindowCloseOffsetBlocks: 4, + ProofWindowOpenOffsetBlocks: 0, + ProofWindowCloseOffsetBlocks: 4, + SupplierUnbondingPeriodSessions: 1, + ApplicationUnbondingPeriodSessions: 1, + ComputeUnitsToTokensMultiplier: 42, + } + // TODO_HACK(@Olshansk): Due to the bug found in `networkWithClaimObjects`, this // is a temporary workaround instead of setting numSessions to its own // independent constant, which requires us to temporarily align the // with the num blocks per session. See the `forloop` in `networkWithClaimObjects` // that has a TODO_HACK as well. - require.Equal(t, 0, numSuppliers*numApps%sharedtypes.DefaultNumBlocksPerSession) + require.Equal(t, 0, numSuppliers*numApps%numBlocksPerSession) - numSessions := numSuppliers * numApps / sharedtypes.DefaultNumBlocksPerSession + numSessions := numSuppliers * numApps / numBlocksPerSession // Submitting one claim per block for simplicity - numClaimsPerSession := sharedtypes.DefaultNumBlocksPerSession + numClaimsPerSession := numBlocksPerSession totalClaims := numSessions * numClaimsPerSession // TODO_FLAKY(@bryanchriswhite): The `networkWithClaimObjects is flaky because @@ -145,7 +159,7 @@ func TestClaim_List(t *testing.T) { t.Errorf("Test panicked: %s", r) } }() - net, claims, clientCtx := networkWithClaimObjects(t, numSessions, numSuppliers, numApps) + net, claims, clientCtx := networkWithClaimObjects(t, numSessions, numSuppliers, numApps, sharedParams) prepareArgs := func(next []byte, offset, limit uint64, total bool) []string { args := []string{ diff --git a/x/session/keeper/session_hydrator_test.go b/x/session/keeper/session_hydrator_test.go index 6f0994da3..df1f0682c 100644 --- a/x/session/keeper/session_hydrator_test.go +++ b/x/session/keeper/session_hydrator_test.go @@ -10,10 +10,29 @@ import ( "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/x/session/keeper" "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +var ( + testSharedParams = sharedtypes.Params{ + NumBlocksPerSession: 4, + GracePeriodEndOffsetBlocks: 1, + ClaimWindowOpenOffsetBlocks: 1, + ClaimWindowCloseOffsetBlocks: 0, + ProofWindowOpenOffsetBlocks: 4, + ProofWindowCloseOffsetBlocks: 4, + SupplierUnbondingPeriodSessions: 1, + ApplicationUnbondingPeriodSessions: 1, + ComputeUnitsToTokensMultiplier: 42, + } + + sharedParamsOpt = keepertest.WithModuleParams(map[string]sdk.Msg{ + sharedtypes.ModuleName: &testSharedParams, + }) ) func TestSession_HydrateSession_Success_BaseCase(t *testing.T) { - sessionKeeper, ctx := keepertest.SessionKeeper(t) + sessionKeeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors blockHeight := int64(10) @@ -112,7 +131,7 @@ func TestSession_HydrateSession_Metadata(t *testing.T) { appAddr := keepertest.TestApp1Address serviceId := keepertest.TestServiceId1 - sessionKeeper, ctx := keepertest.SessionKeeper(t) + sessionKeeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, test := range tests { @@ -199,7 +218,7 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { }, } - sessionKeeper, ctx := keepertest.SessionKeeper(t) + sessionKeeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, test := range tests { @@ -270,7 +289,7 @@ func TestSession_HydrateSession_Application(t *testing.T) { } blockHeight := int64(10) - sessionKeeper, ctx := keepertest.SessionKeeper(t) + sessionKeeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, test := range tests { @@ -331,7 +350,7 @@ func TestSession_HydrateSession_Suppliers(t *testing.T) { } blockHeight := int64(10) - sessionKeeper, ctx := keepertest.SessionKeeper(t) + sessionKeeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, test := range tests { diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index ba8242e88..16a491c64 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -5,6 +5,7 @@ import ( "fmt" cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/shared" "github.com/pokt-network/poktroll/x/supplier/types" ) From bedc05c5d8d44671782eb15de86f4aef09fc4cda Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 10:08:47 +0200 Subject: [PATCH 46/77] fix: failing tests --- .../keeper/msg_server_update_param_test.go | 134 ++++++++++-------- 1 file changed, 71 insertions(+), 63 deletions(-) diff --git a/x/shared/keeper/msg_server_update_param_test.go b/x/shared/keeper/msg_server_update_param_test.go index 9554c7019..da4a2ca03 100644 --- a/x/shared/keeper/msg_server_update_param_test.go +++ b/x/shared/keeper/msg_server_update_param_test.go @@ -14,18 +14,29 @@ import ( sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) +var testSharedParams = sharedtypes.Params{ + NumBlocksPerSession: 4, + GracePeriodEndOffsetBlocks: 1, + ClaimWindowOpenOffsetBlocks: 2, + ClaimWindowCloseOffsetBlocks: 4, + ProofWindowOpenOffsetBlocks: 0, + ProofWindowCloseOffsetBlocks: 4, + SupplierUnbondingPeriodSessions: 4, + ApplicationUnbondingPeriodSessions: 4, + ComputeUnitsToTokensMultiplier: 42, +} + func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { - var expectedNumBlocksPerSession int64 = 8 + var expectedNumBlocksPerSession int64 = 13 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - // Set the parameters to their default values - defaultParams := sharedtypes.DefaultParams() - require.NoError(t, k.SetParams(ctx, defaultParams)) + // Set the parameters. + require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedNumBlocksPerSession), defaultParams.NumBlocksPerSession) + require.NotEqual(t, uint64(expectedNumBlocksPerSession), testSharedParams.NumBlocksPerSession) // Update the number of blocks per session updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -39,7 +50,7 @@ func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { require.Equal(t, uint64(expectedNumBlocksPerSession), res.Params.NumBlocksPerSession) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "NumBlocksPerSession") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "NumBlocksPerSession") } func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { @@ -47,30 +58,30 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - - defaultParams := sharedtypes.DefaultParams() + // Copy test params to avoid modifying them. + sharedParams := testSharedParams // Calculate the minimum unbonding period sessions required by the staking actors // to pass UpdateParam validation. minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( - &defaultParams, - defaultParams.ClaimWindowOpenOffsetBlocks, + &sharedParams, + sharedParams.ClaimWindowOpenOffsetBlocks, uint64(expectedClaimWindowOpenOffestBlocks), ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions // Update the ApplicationUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedClaimWindowOpenOffestBlocks), defaultParams.ClaimWindowOpenOffsetBlocks) + require.NotEqual(t, uint64(expectedClaimWindowOpenOffestBlocks), sharedParams.ClaimWindowOpenOffsetBlocks) // Update the claim window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -84,7 +95,7 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { require.Equal(t, uint64(expectedClaimWindowOpenOffestBlocks), res.Params.ClaimWindowOpenOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ClaimWindowOpenOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ClaimWindowOpenOffsetBlocks") } func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { @@ -92,30 +103,30 @@ func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - - defaultParams := sharedtypes.DefaultParams() + // Copy test params to avoid modifying them. + sharedParams := testSharedParams // Calculate the minimum unbonding period sessions required by the staking actors // to pass UpdateParam validation. minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( - &defaultParams, - defaultParams.ClaimWindowOpenOffsetBlocks, + &sharedParams, + sharedParams.ClaimWindowOpenOffsetBlocks, uint64(expectedClaimWindowCloseOffestBlocks), ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions // Update the ApplicationUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedClaimWindowCloseOffestBlocks), defaultParams.ClaimWindowCloseOffsetBlocks) + require.NotEqual(t, uint64(expectedClaimWindowCloseOffestBlocks), sharedParams.ClaimWindowCloseOffsetBlocks) // Update the claim window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -129,7 +140,7 @@ func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { require.Equal(t, uint64(expectedClaimWindowCloseOffestBlocks), res.Params.ClaimWindowCloseOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ClaimWindowCloseOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ClaimWindowCloseOffsetBlocks") } func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { @@ -137,30 +148,30 @@ func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - - defaultParams := sharedtypes.DefaultParams() + // Copy test params to avoid modifying them. + sharedParams := testSharedParams // Calculate the minimum unbonding period sessions required by the staking actors // to pass UpdateParam validation. minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( - &defaultParams, - defaultParams.ClaimWindowOpenOffsetBlocks, + &sharedParams, + sharedParams.ClaimWindowOpenOffsetBlocks, uint64(expectedProofWindowOpenOffestBlocks), ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions // Update the ApplicationUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedProofWindowOpenOffestBlocks), defaultParams.ProofWindowOpenOffsetBlocks) + require.NotEqual(t, uint64(expectedProofWindowOpenOffestBlocks), sharedParams.ProofWindowOpenOffsetBlocks) // Update the proof window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -174,7 +185,7 @@ func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { require.Equal(t, uint64(expectedProofWindowOpenOffestBlocks), res.Params.ProofWindowOpenOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofWindowOpenOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ProofWindowOpenOffsetBlocks") } func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { @@ -182,30 +193,30 @@ func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - - defaultParams := sharedtypes.DefaultParams() + // Copy test params to avoid modifying them. + sharedParams := testSharedParams // Calculate the minimum unbonding period sessions required by the staking actors // to pass UpdateParam validation. minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( - &defaultParams, - defaultParams.ClaimWindowOpenOffsetBlocks, + &sharedParams, + sharedParams.ClaimWindowOpenOffsetBlocks, uint64(expectedProofWindowCloseOffestBlocks), ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.SupplierUnbondingPeriodSessions = minUnbodningPeriodSessions // Update the ApplicationUnbondingPeriodSessions such that it is greater than the // cumulative proof window close blocks to pass UpdateParam validation. - defaultParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions + sharedParams.ApplicationUnbondingPeriodSessions = minUnbodningPeriodSessions // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedProofWindowCloseOffestBlocks), defaultParams.ProofWindowCloseOffsetBlocks) + require.NotEqual(t, uint64(expectedProofWindowCloseOffestBlocks), sharedParams.ProofWindowCloseOffsetBlocks) // Update the proof window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -219,7 +230,7 @@ func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { require.Equal(t, uint64(expectedProofWindowCloseOffestBlocks), res.Params.ProofWindowCloseOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofWindowCloseOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ProofWindowCloseOffsetBlocks") } func TestMsgUpdateParam_UpdateGracePeriodEndOffsetBlocks(t *testing.T) { @@ -227,18 +238,18 @@ func TestMsgUpdateParam_UpdateGracePeriodEndOffsetBlocks(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - - defaultParams := sharedtypes.DefaultParams() + // Copy test params to avoid modifying them. + sharedParams := testSharedParams // Update the claim window open offset blocks which has to be at least equal to // GracePeriodEndOffsetBlocks to pass UpdateParam validation. - defaultParams.ClaimWindowOpenOffsetBlocks = uint64(expectedGracePeriodEndOffestBlocks) + sharedParams.ClaimWindowOpenOffsetBlocks = uint64(expectedGracePeriodEndOffestBlocks) // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedGracePeriodEndOffestBlocks), defaultParams.GetGracePeriodEndOffsetBlocks()) + require.NotEqual(t, uint64(expectedGracePeriodEndOffestBlocks), sharedParams.GetGracePeriodEndOffsetBlocks()) // Update the proof window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -252,7 +263,7 @@ func TestMsgUpdateParam_UpdateGracePeriodEndOffsetBlocks(t *testing.T) { require.Equal(t, uint64(expectedGracePeriodEndOffestBlocks), res.Params.GetGracePeriodEndOffsetBlocks()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "GracePeriodEndOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "GracePeriodEndOffsetBlocks") } func TestMsgUpdateParam_UpdateSupplierUnbondingPeriodSessions(t *testing.T) { @@ -261,12 +272,11 @@ func TestMsgUpdateParam_UpdateSupplierUnbondingPeriodSessions(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - defaultParams := sharedtypes.DefaultParams() - // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + // Set the parameters. + require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedSupplierUnbondingPerid), defaultParams.GetSupplierUnbondingPeriodSessions()) + require.NotEqual(t, uint64(expectedSupplierUnbondingPerid), testSharedParams.GetSupplierUnbondingPeriodSessions()) // Update the supplier unbonding period param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -280,7 +290,7 @@ func TestMsgUpdateParam_UpdateSupplierUnbondingPeriodSessions(t *testing.T) { require.Equal(t, uint64(expectedSupplierUnbondingPerid), res.Params.GetSupplierUnbondingPeriodSessions()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "SupplierUnbondingPeriodSessions") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "SupplierUnbondingPeriodSessions") // Ensure that a supplier unbonding period that is less than the cumulative // proof window close blocks is not allowed. @@ -299,12 +309,11 @@ func TestMsgUpdateParam_UpdateApplicationUnbondingPeriodSessions(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - defaultParams := sharedtypes.DefaultParams() - // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + // Set the parameters. + require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedApplicationUnbondingPerid), defaultParams.GetApplicationUnbondingPeriodSessions()) + require.NotEqual(t, uint64(expectedApplicationUnbondingPerid), testSharedParams.GetApplicationUnbondingPeriodSessions()) // Update the application unbonding period param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -318,7 +327,7 @@ func TestMsgUpdateParam_UpdateApplicationUnbondingPeriodSessions(t *testing.T) { require.Equal(t, uint64(expectedApplicationUnbondingPerid), res.Params.GetApplicationUnbondingPeriodSessions()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ApplicationUnbondingPeriodSessions") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "ApplicationUnbondingPeriodSessions") // Ensure that a application unbonding period that is less than the cumulative // proof window close blocks is not allowed. @@ -337,12 +346,11 @@ func TestMsgUpdateParam_ComputeUnitsToTokenMultiplier(t *testing.T) { k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) - defaultParams := sharedtypes.DefaultParams() - // Set the parameters to their default values - require.NoError(t, k.SetParams(ctx, defaultParams)) + // Set the parameters. + require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedComputeUnitsToTokenMultiplier), defaultParams.GetComputeUnitsToTokensMultiplier()) + require.NotEqual(t, uint64(expectedComputeUnitsToTokenMultiplier), testSharedParams.GetComputeUnitsToTokensMultiplier()) // Update the compute units to token multiplier param updateParamMsg := &sharedtypes.MsgUpdateParam{ @@ -356,7 +364,7 @@ func TestMsgUpdateParam_ComputeUnitsToTokenMultiplier(t *testing.T) { require.Equal(t, uint64(expectedComputeUnitsToTokenMultiplier), res.Params.GetComputeUnitsToTokensMultiplier()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ComputeUnitsToTokensMultiplier") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "ComputeUnitsToTokensMultiplier") // Ensure that compute units to token multiplier that is less than 1 is not allowed. updateParamMsg = &sharedtypes.MsgUpdateParam{ From 287761458b7ec10dadee3c92cb56b44f99a72aa2 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 10:33:53 +0200 Subject: [PATCH 47/77] fix: failing tests --- x/session/keeper/query_get_session_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/session/keeper/query_get_session_test.go b/x/session/keeper/query_get_session_test.go index b683aed19..cff54f93a 100644 --- a/x/session/keeper/query_get_session_test.go +++ b/x/session/keeper/query_get_session_test.go @@ -21,7 +21,7 @@ func init() { // the Cosmos SDK context aware wrapper around it. func TestSession_GetSession_Success(t *testing.T) { - keeper, ctx := keepertest.SessionKeeper(t) + keeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors tests := []struct { @@ -69,7 +69,7 @@ func TestSession_GetSession_Success(t *testing.T) { } func TestSession_GetSession_Failure(t *testing.T) { - keeper, ctx := keepertest.SessionKeeper(t) + keeper, ctx := keepertest.SessionKeeper(t, sharedParamsOpt) ctx = sdk.UnwrapSDKContext(ctx).WithBlockHeight(100) // provide a sufficiently large block height to avoid errors tests := []struct { From 8fa1be426631a6bd5d0e9284063bea1f9ca91bbb Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 10:44:36 +0200 Subject: [PATCH 48/77] chore: regenerate protobufs --- api/poktroll/application/query_grpc.pb.go | 194 ++ api/poktroll/application/tx_grpc.pb.go | 270 ++ api/poktroll/gateway/query_grpc.pb.go | 194 ++ api/poktroll/gateway/tx_grpc.pb.go | 194 ++ api/poktroll/proof/query_grpc.pb.go | 272 ++ api/poktroll/proof/tx_grpc.pb.go | 232 ++ api/poktroll/service/query_grpc.pb.go | 194 ++ api/poktroll/service/tx_grpc.pb.go | 194 ++ api/poktroll/session/query_grpc.pb.go | 156 + api/poktroll/session/tx_grpc.pb.go | 118 + api/poktroll/shared/query_grpc.pb.go | 116 + api/poktroll/shared/tx_grpc.pb.go | 156 + api/poktroll/supplier/event.pulsar.go | 2 +- api/poktroll/supplier/query_grpc.pb.go | 194 ++ api/poktroll/supplier/tx_grpc.pb.go | 194 ++ api/poktroll/tokenomics/query_grpc.pb.go | 194 ++ api/poktroll/tokenomics/tx_grpc.pb.go | 156 + go.mod | 6 +- x/application/types/event.pb.go | 372 +++ x/application/types/genesis.pb.go | 387 +++ x/application/types/params.pb.go | 330 ++ x/application/types/query.pb.go | 1366 ++++++++ x/application/types/query.pb.gw.go | 337 ++ x/application/types/tx.pb.go | 2103 +++++++++++++ x/application/types/types.pb.go | 896 ++++++ x/gateway/types/event.pb.go | 317 ++ x/gateway/types/genesis.pb.go | 385 +++ x/gateway/types/params.pb.go | 285 ++ x/gateway/types/query.pb.go | 1367 ++++++++ x/gateway/types/query.pb.gw.go | 337 ++ x/gateway/types/tx.pb.go | 1293 ++++++++ x/gateway/types/types.pb.go | 379 +++ x/proof/types/event.pb.go | 1259 ++++++++ x/proof/types/genesis.pb.go | 448 +++ x/proof/types/params.pb.go | 599 ++++ x/proof/types/query.pb.go | 2756 +++++++++++++++++ x/proof/types/query.pb.gw.go | 565 ++++ x/proof/types/tx.pb.go | 2396 ++++++++++++++ x/proof/types/types.pb.go | 791 +++++ x/service/types/genesis.pb.go | 386 +++ x/service/types/params.pb.go | 358 +++ x/service/types/query.pb.go | 1366 ++++++++ x/service/types/query.pb.gw.go | 337 ++ x/service/types/relay.pb.go | 1370 ++++++++ x/service/types/tx.pb.go | 1529 +++++++++ x/session/types/genesis.pb.go | 320 ++ x/session/types/params.pb.go | 285 ++ x/session/types/query.pb.go | 1008 ++++++ x/session/types/query.pb.gw.go | 236 ++ x/session/types/tx.pb.go | 590 ++++ x/session/types/types.pb.go | 933 ++++++ x/shared/types/genesis.pb.go | 320 ++ x/shared/types/params.pb.go | 671 ++++ x/shared/types/query.pb.go | 532 ++++ x/shared/types/query.pb.gw.go | 153 + x/shared/types/service.pb.go | 1675 ++++++++++ x/shared/types/supplier.pb.go | 706 +++++ x/shared/types/tx.pb.go | 1262 ++++++++ x/supplier/types/event.pb.go | 755 +++++ x/supplier/types/genesis.pb.go | 386 +++ x/supplier/types/params.pb.go | 285 ++ x/supplier/types/query.pb.go | 1370 ++++++++ x/supplier/types/query.pb.gw.go | 337 ++ x/supplier/types/tx.pb.go | 1515 +++++++++ x/tokenomics/types/event.pb.go | 1736 +++++++++++ x/tokenomics/types/genesis.pb.go | 387 +++ x/tokenomics/types/params.pb.go | 285 ++ x/tokenomics/types/query.pb.go | 1369 ++++++++ x/tokenomics/types/query.pb.gw.go | 337 ++ .../types/relay_mining_difficulty.pb.go | 456 +++ x/tokenomics/types/tx.pb.go | 1266 ++++++++ 71 files changed, 46522 insertions(+), 3 deletions(-) create mode 100644 api/poktroll/application/query_grpc.pb.go create mode 100644 api/poktroll/application/tx_grpc.pb.go create mode 100644 api/poktroll/gateway/query_grpc.pb.go create mode 100644 api/poktroll/gateway/tx_grpc.pb.go create mode 100644 api/poktroll/proof/query_grpc.pb.go create mode 100644 api/poktroll/proof/tx_grpc.pb.go create mode 100644 api/poktroll/service/query_grpc.pb.go create mode 100644 api/poktroll/service/tx_grpc.pb.go create mode 100644 api/poktroll/session/query_grpc.pb.go create mode 100644 api/poktroll/session/tx_grpc.pb.go create mode 100644 api/poktroll/shared/query_grpc.pb.go create mode 100644 api/poktroll/shared/tx_grpc.pb.go create mode 100644 api/poktroll/supplier/query_grpc.pb.go create mode 100644 api/poktroll/supplier/tx_grpc.pb.go create mode 100644 api/poktroll/tokenomics/query_grpc.pb.go create mode 100644 api/poktroll/tokenomics/tx_grpc.pb.go create mode 100644 x/application/types/event.pb.go create mode 100644 x/application/types/genesis.pb.go create mode 100644 x/application/types/params.pb.go create mode 100644 x/application/types/query.pb.go create mode 100644 x/application/types/query.pb.gw.go create mode 100644 x/application/types/tx.pb.go create mode 100644 x/application/types/types.pb.go create mode 100644 x/gateway/types/event.pb.go create mode 100644 x/gateway/types/genesis.pb.go create mode 100644 x/gateway/types/params.pb.go create mode 100644 x/gateway/types/query.pb.go create mode 100644 x/gateway/types/query.pb.gw.go create mode 100644 x/gateway/types/tx.pb.go create mode 100644 x/gateway/types/types.pb.go create mode 100644 x/proof/types/event.pb.go create mode 100644 x/proof/types/genesis.pb.go create mode 100644 x/proof/types/params.pb.go create mode 100644 x/proof/types/query.pb.go create mode 100644 x/proof/types/query.pb.gw.go create mode 100644 x/proof/types/tx.pb.go create mode 100644 x/proof/types/types.pb.go create mode 100644 x/service/types/genesis.pb.go create mode 100644 x/service/types/params.pb.go create mode 100644 x/service/types/query.pb.go create mode 100644 x/service/types/query.pb.gw.go create mode 100644 x/service/types/relay.pb.go create mode 100644 x/service/types/tx.pb.go create mode 100644 x/session/types/genesis.pb.go create mode 100644 x/session/types/params.pb.go create mode 100644 x/session/types/query.pb.go create mode 100644 x/session/types/query.pb.gw.go create mode 100644 x/session/types/tx.pb.go create mode 100644 x/session/types/types.pb.go create mode 100644 x/shared/types/genesis.pb.go create mode 100644 x/shared/types/params.pb.go create mode 100644 x/shared/types/query.pb.go create mode 100644 x/shared/types/query.pb.gw.go create mode 100644 x/shared/types/service.pb.go create mode 100644 x/shared/types/supplier.pb.go create mode 100644 x/shared/types/tx.pb.go create mode 100644 x/supplier/types/event.pb.go create mode 100644 x/supplier/types/genesis.pb.go create mode 100644 x/supplier/types/params.pb.go create mode 100644 x/supplier/types/query.pb.go create mode 100644 x/supplier/types/query.pb.gw.go create mode 100644 x/supplier/types/tx.pb.go create mode 100644 x/tokenomics/types/event.pb.go create mode 100644 x/tokenomics/types/genesis.pb.go create mode 100644 x/tokenomics/types/params.pb.go create mode 100644 x/tokenomics/types/query.pb.go create mode 100644 x/tokenomics/types/query.pb.gw.go create mode 100644 x/tokenomics/types/relay_mining_difficulty.pb.go create mode 100644 x/tokenomics/types/tx.pb.go diff --git a/api/poktroll/application/query_grpc.pb.go b/api/poktroll/application/query_grpc.pb.go new file mode 100644 index 000000000..38b436639 --- /dev/null +++ b/api/poktroll/application/query_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/application/query.proto + +package application + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.application.Query/Params" + Query_Application_FullMethodName = "/poktroll.application.Query/Application" + Query_AllApplications_FullMethodName = "/poktroll.application.Query/AllApplications" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 Application items. + Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) + AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetApplicationResponse) + err := c.cc.Invoke(ctx, Query_Application_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllApplicationsResponse) + err := c.cc.Invoke(ctx, Query_AllApplications_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Application items. + Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) + AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Application not implemented") +} +func (UnimplementedQueryServer) AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllApplications not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Application_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetApplicationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Application(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Application_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Application(ctx, req.(*QueryGetApplicationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllApplicationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllApplications(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllApplications_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllApplications(ctx, req.(*QueryAllApplicationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.application.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Application", + Handler: _Query_Application_Handler, + }, + { + MethodName: "AllApplications", + Handler: _Query_AllApplications_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/application/query.proto", +} diff --git a/api/poktroll/application/tx_grpc.pb.go b/api/poktroll/application/tx_grpc.pb.go new file mode 100644 index 000000000..b8a8e8cee --- /dev/null +++ b/api/poktroll/application/tx_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/application/tx.proto + +package application + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.application.Msg/UpdateParams" + Msg_StakeApplication_FullMethodName = "/poktroll.application.Msg/StakeApplication" + Msg_UnstakeApplication_FullMethodName = "/poktroll.application.Msg/UnstakeApplication" + Msg_DelegateToGateway_FullMethodName = "/poktroll.application.Msg/DelegateToGateway" + Msg_UndelegateFromGateway_FullMethodName = "/poktroll.application.Msg/UndelegateFromGateway" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) + UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) + DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) + UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgStakeApplicationResponse) + err := c.cc.Invoke(ctx, Msg_StakeApplication_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUnstakeApplicationResponse) + err := c.cc.Invoke(ctx, Msg_UnstakeApplication_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgDelegateToGatewayResponse) + err := c.cc.Invoke(ctx, Msg_DelegateToGateway_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUndelegateFromGatewayResponse) + err := c.cc.Invoke(ctx, Msg_UndelegateFromGateway_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) + UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) + DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) + UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeApplication not implemented") +} +func (UnimplementedMsgServer) UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeApplication not implemented") +} +func (UnimplementedMsgServer) DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegateToGateway not implemented") +} +func (UnimplementedMsgServer) UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_StakeApplication_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeApplication(ctx, req.(*MsgStakeApplication)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UnstakeApplication_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeApplication(ctx, req.(*MsgUnstakeApplication)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DelegateToGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegateToGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelegateToGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_DelegateToGateway_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DelegateToGateway(ctx, req.(*MsgDelegateToGateway)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegateFromGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UndelegateFromGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UndelegateFromGateway_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UndelegateFromGateway(ctx, req.(*MsgUndelegateFromGateway)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.application.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeApplication", + Handler: _Msg_StakeApplication_Handler, + }, + { + MethodName: "UnstakeApplication", + Handler: _Msg_UnstakeApplication_Handler, + }, + { + MethodName: "DelegateToGateway", + Handler: _Msg_DelegateToGateway_Handler, + }, + { + MethodName: "UndelegateFromGateway", + Handler: _Msg_UndelegateFromGateway_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/application/tx.proto", +} diff --git a/api/poktroll/gateway/query_grpc.pb.go b/api/poktroll/gateway/query_grpc.pb.go new file mode 100644 index 000000000..d6106bde7 --- /dev/null +++ b/api/poktroll/gateway/query_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/gateway/query.proto + +package gateway + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.gateway.Query/Params" + Query_Gateway_FullMethodName = "/poktroll.gateway.Query/Gateway" + Query_AllGateways_FullMethodName = "/poktroll.gateway.Query/AllGateways" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 Gateway items. + Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) + AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetGatewayResponse) + err := c.cc.Invoke(ctx, Query_Gateway_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllGatewaysResponse) + err := c.cc.Invoke(ctx, Query_AllGateways_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Gateway items. + Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) + AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Gateway not implemented") +} +func (UnimplementedQueryServer) AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllGateways not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Gateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetGatewayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Gateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Gateway_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Gateway(ctx, req.(*QueryGetGatewayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllGatewaysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllGateways(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllGateways_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllGateways(ctx, req.(*QueryAllGatewaysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.gateway.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Gateway", + Handler: _Query_Gateway_Handler, + }, + { + MethodName: "AllGateways", + Handler: _Query_AllGateways_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/gateway/query.proto", +} diff --git a/api/poktroll/gateway/tx_grpc.pb.go b/api/poktroll/gateway/tx_grpc.pb.go new file mode 100644 index 000000000..097b42380 --- /dev/null +++ b/api/poktroll/gateway/tx_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/gateway/tx.proto + +package gateway + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.gateway.Msg/UpdateParams" + Msg_StakeGateway_FullMethodName = "/poktroll.gateway.Msg/StakeGateway" + Msg_UnstakeGateway_FullMethodName = "/poktroll.gateway.Msg/UnstakeGateway" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) + UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgStakeGatewayResponse) + err := c.cc.Invoke(ctx, Msg_StakeGateway_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUnstakeGatewayResponse) + err := c.cc.Invoke(ctx, Msg_UnstakeGateway_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) + UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeGateway not implemented") +} +func (UnimplementedMsgServer) UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeGateway not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_StakeGateway_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeGateway(ctx, req.(*MsgStakeGateway)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UnstakeGateway_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeGateway(ctx, req.(*MsgUnstakeGateway)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.gateway.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeGateway", + Handler: _Msg_StakeGateway_Handler, + }, + { + MethodName: "UnstakeGateway", + Handler: _Msg_UnstakeGateway_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/gateway/tx.proto", +} diff --git a/api/poktroll/proof/query_grpc.pb.go b/api/poktroll/proof/query_grpc.pb.go new file mode 100644 index 000000000..aa2dc91eb --- /dev/null +++ b/api/poktroll/proof/query_grpc.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/proof/query.proto + +package proof + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.proof.Query/Params" + Query_Claim_FullMethodName = "/poktroll.proof.Query/Claim" + Query_AllClaims_FullMethodName = "/poktroll.proof.Query/AllClaims" + Query_Proof_FullMethodName = "/poktroll.proof.Query/Proof" + Query_AllProofs_FullMethodName = "/poktroll.proof.Query/AllProofs" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 Claim items. + Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) + AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) + // Queries a list of Proof items. + Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) + AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetClaimResponse) + err := c.cc.Invoke(ctx, Query_Claim_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllClaimsResponse) + err := c.cc.Invoke(ctx, Query_AllClaims_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetProofResponse) + err := c.cc.Invoke(ctx, Query_Proof_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllProofsResponse) + err := c.cc.Invoke(ctx, Query_AllProofs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Claim items. + Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) + AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) + // Queries a list of Proof items. + Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) + AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") +} +func (UnimplementedQueryServer) AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllClaims not implemented") +} +func (UnimplementedQueryServer) Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") +} +func (UnimplementedQueryServer) AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllProofs not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetClaimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Claim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Claim_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Claim(ctx, req.(*QueryGetClaimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllClaims_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllClaimsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllClaims(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllClaims_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllClaims(ctx, req.(*QueryAllClaimsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetProofRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Proof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proof(ctx, req.(*QueryGetProofRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllProofs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllProofsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllProofs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllProofs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllProofs(ctx, req.(*QueryAllProofsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.proof.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Claim", + Handler: _Query_Claim_Handler, + }, + { + MethodName: "AllClaims", + Handler: _Query_AllClaims_Handler, + }, + { + MethodName: "Proof", + Handler: _Query_Proof_Handler, + }, + { + MethodName: "AllProofs", + Handler: _Query_AllProofs_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/proof/query.proto", +} diff --git a/api/poktroll/proof/tx_grpc.pb.go b/api/poktroll/proof/tx_grpc.pb.go new file mode 100644 index 000000000..51c26c023 --- /dev/null +++ b/api/poktroll/proof/tx_grpc.pb.go @@ -0,0 +1,232 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/proof/tx.proto + +package proof + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.proof.Msg/UpdateParams" + Msg_CreateClaim_FullMethodName = "/poktroll.proof.Msg/CreateClaim" + Msg_SubmitProof_FullMethodName = "/poktroll.proof.Msg/SubmitProof" + Msg_UpdateParam_FullMethodName = "/poktroll.proof.Msg/UpdateParam" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) + SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCreateClaimResponse) + err := c.cc.Invoke(ctx, Msg_CreateClaim_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgSubmitProofResponse) + err := c.cc.Invoke(ctx, Msg_SubmitProof_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) + SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClaim not implemented") +} +func (UnimplementedMsgServer) SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProof not implemented") +} +func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateClaim_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClaim(ctx, req.(*MsgCreateClaim)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SubmitProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SubmitProof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProof(ctx, req.(*MsgSubmitProof)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParam_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.proof.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "CreateClaim", + Handler: _Msg_CreateClaim_Handler, + }, + { + MethodName: "SubmitProof", + Handler: _Msg_SubmitProof_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/proof/tx.proto", +} diff --git a/api/poktroll/service/query_grpc.pb.go b/api/poktroll/service/query_grpc.pb.go new file mode 100644 index 000000000..98d68bf29 --- /dev/null +++ b/api/poktroll/service/query_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/service/query.proto + +package service + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.service.Query/Params" + Query_Service_FullMethodName = "/poktroll.service.Query/Service" + Query_AllServices_FullMethodName = "/poktroll.service.Query/AllServices" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 Service items. + Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) + AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetServiceResponse) + err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllServicesResponse) + err := c.cc.Invoke(ctx, Query_AllServices_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Service items. + Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) + AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") +} +func (UnimplementedQueryServer) AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Service(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Service_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Service(ctx, req.(*QueryGetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllServices_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllServices(ctx, req.(*QueryAllServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.service.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Service", + Handler: _Query_Service_Handler, + }, + { + MethodName: "AllServices", + Handler: _Query_AllServices_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/service/query.proto", +} diff --git a/api/poktroll/service/tx_grpc.pb.go b/api/poktroll/service/tx_grpc.pb.go new file mode 100644 index 000000000..45f7d6418 --- /dev/null +++ b/api/poktroll/service/tx_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/service/tx.proto + +package service + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.service.Msg/UpdateParams" + Msg_UpdateParam_FullMethodName = "/poktroll.service.Msg/UpdateParam" + Msg_AddService_FullMethodName = "/poktroll.service.Msg/AddService" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) + AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgAddServiceResponse) + err := c.cc.Invoke(ctx, Msg_AddService_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) + AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} +func (UnimplementedMsgServer) AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParam_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddService) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_AddService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddService(ctx, req.(*MsgAddService)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.service.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + { + MethodName: "AddService", + Handler: _Msg_AddService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/service/tx.proto", +} diff --git a/api/poktroll/session/query_grpc.pb.go b/api/poktroll/session/query_grpc.pb.go new file mode 100644 index 000000000..ea6063319 --- /dev/null +++ b/api/poktroll/session/query_grpc.pb.go @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/session/query.proto + +package session + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.session.Query/Params" + Query_GetSession_FullMethodName = "/poktroll.session.Query/GetSession" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries the session given app_address, service and block_height. + GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetSessionResponse) + err := c.cc.Invoke(ctx, Query_GetSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries the session given app_address, service and block_height. + GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetSession(ctx, req.(*QueryGetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.session.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "GetSession", + Handler: _Query_GetSession_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/session/query.proto", +} diff --git a/api/poktroll/session/tx_grpc.pb.go b/api/poktroll/session/tx_grpc.pb.go new file mode 100644 index 000000000..33cba3055 --- /dev/null +++ b/api/poktroll/session/tx_grpc.pb.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/session/tx.proto + +package session + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.session.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.session.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/session/tx.proto", +} diff --git a/api/poktroll/shared/query_grpc.pb.go b/api/poktroll/shared/query_grpc.pb.go new file mode 100644 index 000000000..95d4fc364 --- /dev/null +++ b/api/poktroll/shared/query_grpc.pb.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/shared/query.proto + +package shared + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.shared.Query/Params" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.shared.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/shared/query.proto", +} diff --git a/api/poktroll/shared/tx_grpc.pb.go b/api/poktroll/shared/tx_grpc.pb.go new file mode 100644 index 000000000..19e2023a9 --- /dev/null +++ b/api/poktroll/shared/tx_grpc.pb.go @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/shared/tx.proto + +package shared + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.shared.Msg/UpdateParams" + Msg_UpdateParam_FullMethodName = "/poktroll.shared.Msg/UpdateParam" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParam_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.shared.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/shared/tx.proto", +} diff --git a/api/poktroll/supplier/event.pulsar.go b/api/poktroll/supplier/event.pulsar.go index ba4e7444f..ea4260339 100644 --- a/api/poktroll/supplier/event.pulsar.go +++ b/api/poktroll/supplier/event.pulsar.go @@ -2,11 +2,11 @@ package supplier import ( + shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/supplier/query_grpc.pb.go b/api/poktroll/supplier/query_grpc.pb.go new file mode 100644 index 000000000..aa83f20ec --- /dev/null +++ b/api/poktroll/supplier/query_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/supplier/query.proto + +package supplier + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.supplier.Query/Params" + Query_Supplier_FullMethodName = "/poktroll.supplier.Query/Supplier" + Query_AllSuppliers_FullMethodName = "/poktroll.supplier.Query/AllSuppliers" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 Supplier items. + Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) + AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetSupplierResponse) + err := c.cc.Invoke(ctx, Query_Supplier_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllSuppliersResponse) + err := c.cc.Invoke(ctx, Query_AllSuppliers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Supplier items. + Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) + AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Supplier not implemented") +} +func (UnimplementedQueryServer) AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllSuppliers not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Supplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSupplierRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Supplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Supplier_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Supplier(ctx, req.(*QueryGetSupplierRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllSuppliers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllSuppliersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllSuppliers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AllSuppliers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllSuppliers(ctx, req.(*QueryAllSuppliersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.supplier.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Supplier", + Handler: _Query_Supplier_Handler, + }, + { + MethodName: "AllSuppliers", + Handler: _Query_AllSuppliers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/supplier/query.proto", +} diff --git a/api/poktroll/supplier/tx_grpc.pb.go b/api/poktroll/supplier/tx_grpc.pb.go new file mode 100644 index 000000000..a95a976c9 --- /dev/null +++ b/api/poktroll/supplier/tx_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/supplier/tx.proto + +package supplier + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.supplier.Msg/UpdateParams" + Msg_StakeSupplier_FullMethodName = "/poktroll.supplier.Msg/StakeSupplier" + Msg_UnstakeSupplier_FullMethodName = "/poktroll.supplier.Msg/UnstakeSupplier" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) + UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgStakeSupplierResponse) + err := c.cc.Invoke(ctx, Msg_StakeSupplier_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUnstakeSupplierResponse) + err := c.cc.Invoke(ctx, Msg_UnstakeSupplier_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) + UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeSupplier not implemented") +} +func (UnimplementedMsgServer) UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeSupplier not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeSupplier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeSupplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_StakeSupplier_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeSupplier(ctx, req.(*MsgStakeSupplier)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeSupplier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeSupplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UnstakeSupplier_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeSupplier(ctx, req.(*MsgUnstakeSupplier)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.supplier.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeSupplier", + Handler: _Msg_StakeSupplier_Handler, + }, + { + MethodName: "UnstakeSupplier", + Handler: _Msg_UnstakeSupplier_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/supplier/tx.proto", +} diff --git a/api/poktroll/tokenomics/query_grpc.pb.go b/api/poktroll/tokenomics/query_grpc.pb.go new file mode 100644 index 000000000..e45017866 --- /dev/null +++ b/api/poktroll/tokenomics/query_grpc.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/tokenomics/query.proto + +package tokenomics + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.tokenomics.Query/Params" + Query_RelayMiningDifficulty_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficulty" + Query_RelayMiningDifficultyAll_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficultyAll" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +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 RelayMiningDifficulty items. + RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, Query_RelayMiningDifficulty_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, Query_RelayMiningDifficultyAll_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of RelayMiningDifficulty items. + RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") +} +func (UnimplementedQueryServer) RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficulty(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RelayMiningDifficulty_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RelayMiningDifficultyAll_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.tokenomics.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "RelayMiningDifficulty", + Handler: _Query_RelayMiningDifficulty_Handler, + }, + { + MethodName: "RelayMiningDifficultyAll", + Handler: _Query_RelayMiningDifficultyAll_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/tokenomics/query.proto", +} diff --git a/api/poktroll/tokenomics/tx_grpc.pb.go b/api/poktroll/tokenomics/tx_grpc.pb.go new file mode 100644 index 000000000..307e37b0b --- /dev/null +++ b/api/poktroll/tokenomics/tx_grpc.pb.go @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/tokenomics/tx.proto + +package tokenomics + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.tokenomics.Msg/UpdateParams" + Msg_UpdateParam_FullMethodName = "/poktroll.tokenomics.Msg/UpdateParam" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParam_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParam_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.tokenomics.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/tokenomics/tx.proto", +} diff --git a/go.mod b/go.mod index 9f47b177c..91de15f1d 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,10 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -require github.com/jhump/protoreflect v1.16.0 +require ( + cosmossdk.io/x/tx v0.13.4 + github.com/jhump/protoreflect v1.16.0 +) require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 // indirect @@ -92,7 +95,6 @@ require ( connectrpc.com/connect v1.16.2 // indirect connectrpc.com/otelconnect v0.7.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/tx v0.13.4 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/application/types/event.pb.go b/x/application/types/event.pb.go new file mode 100644 index 000000000..7d331adec --- /dev/null +++ b/x/application/types/event.pb.go @@ -0,0 +1,372 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// EventRedelegation is an event emitted whenever an application changes its +// delegatee gateways on chain. This is in response to both a DelegateToGateway +// and UndelegateFromGateway message. +type EventRedelegation struct { + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` +} + +func (m *EventRedelegation) Reset() { *m = EventRedelegation{} } +func (m *EventRedelegation) String() string { return proto.CompactTextString(m) } +func (*EventRedelegation) ProtoMessage() {} +func (*EventRedelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_d0d229437c622598, []int{0} +} +func (m *EventRedelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRedelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventRedelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRedelegation.Merge(m, src) +} +func (m *EventRedelegation) XXX_Size() int { + return m.Size() +} +func (m *EventRedelegation) XXX_DiscardUnknown() { + xxx_messageInfo_EventRedelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRedelegation proto.InternalMessageInfo + +func (m *EventRedelegation) GetAppAddress() string { + if m != nil { + return m.AppAddress + } + return "" +} + +func (m *EventRedelegation) GetGatewayAddress() string { + if m != nil { + return m.GatewayAddress + } + return "" +} + +func init() { + proto.RegisterType((*EventRedelegation)(nil), "poktroll.application.EventRedelegation") +} + +func init() { proto.RegisterFile("poktroll/application/event.proto", fileDescriptor_d0d229437c622598) } + +var fileDescriptor_d0d229437c622598 = []byte{ + // 248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, + 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa9, + 0xd0, 0x43, 0x52, 0x21, 0x25, 0x99, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x1c, 0x0f, 0x56, 0xa3, 0x0f, + 0xe1, 0x40, 0x34, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x43, 0xc4, 0x41, 0x2c, 0x88, 0xa8, 0xd2, + 0x44, 0x46, 0x2e, 0x41, 0x57, 0x90, 0xb1, 0x41, 0xa9, 0x29, 0xa9, 0x39, 0xa9, 0xe9, 0x60, 0x63, + 0x84, 0x2c, 0xb9, 0xb8, 0x13, 0x0b, 0x0a, 0xe2, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, + 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x1a, 0xe9, 0x08, 0x91, + 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0xe2, 0x4a, 0x2c, 0x28, 0x80, 0x8a, 0x08, 0x39, 0x72, + 0xf1, 0xa7, 0x27, 0x96, 0xa4, 0x96, 0x27, 0x56, 0xc2, 0xb5, 0x33, 0x11, 0xd0, 0xce, 0x07, 0xd5, + 0x00, 0x15, 0x75, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, + 0x61, 0xa0, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0f, 0xb2, 0x0a, 0x94, 0x40, + 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x7b, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0xca, 0xe7, 0xe9, 0xb0, 0x59, 0x01, 0x00, 0x00, +} + +func (m *EventRedelegation) 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 *EventRedelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRedelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GatewayAddress) > 0 { + i -= len(m.GatewayAddress) + copy(dAtA[i:], m.GatewayAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.GatewayAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.AppAddress) > 0 { + i -= len(m.AppAddress) + copy(dAtA[i:], m.AppAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.AppAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventRedelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.GatewayAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventRedelegation) 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 ErrIntOverflowEvent + } + 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: EventRedelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRedelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GatewayAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/application/types/genesis.pb.go b/x/application/types/genesis.pb.go new file mode 100644 index 000000000..0f0b4e831 --- /dev/null +++ b/x/application/types/genesis.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the application module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ApplicationList []Application `protobuf:"bytes,2,rep,name=application_list,json=applicationList,proto3" json:"application_list"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad2a010ae2744ea, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetApplicationList() []Application { + if m != nil { + return m.ApplicationList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.application.GenesisState") +} + +func init() { + proto.RegisterFile("poktroll/application/genesis.proto", fileDescriptor_7ad2a010ae2744ea) +} + +var fileDescriptor_7ad2a010ae2744ea = []byte{ + // 265 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, + 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x81, 0xa9, 0xd1, 0x43, 0x52, 0x23, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, + 0x0a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a, 0xaa, 0x88, 0xd5, + 0x8a, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x0d, 0x52, 0x0a, 0x58, 0x95, 0x94, 0x54, 0x16, 0xa4, + 0x42, 0x55, 0x28, 0x2d, 0x66, 0xe4, 0xe2, 0x71, 0x87, 0xb8, 0x2a, 0xb8, 0x24, 0xb1, 0x24, 0x55, + 0xc8, 0x9e, 0x8b, 0x0d, 0x62, 0x84, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x8c, 0x1e, 0x36, + 0x57, 0xea, 0x05, 0x80, 0xd5, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, + 0xc6, 0x20, 0xa8, 0x36, 0xa1, 0x20, 0x2e, 0x01, 0x24, 0x85, 0xf1, 0x39, 0x99, 0xc5, 0x25, 0x12, + 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x8a, 0xd8, 0x8d, 0x72, 0x44, 0xb0, 0x9d, 0x58, 0x40, 0xe6, + 0x05, 0xf1, 0x23, 0x49, 0xfb, 0x64, 0x16, 0x97, 0x38, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, + 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, + 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x1b, 0x74, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, + 0xe1, 0xbe, 0xaf, 0xc0, 0xf4, 0x7f, 0x12, 0x1b, 0x38, 0x00, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xc5, 0x7a, 0x1b, 0xd6, 0xaa, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ApplicationList) > 0 { + for iNdEx := len(m.ApplicationList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ApplicationList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.ApplicationList) > 0 { + for _, e := range m.ApplicationList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationList", 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.ApplicationList = append(m.ApplicationList, Application{}) + if err := m.ApplicationList[len(m.ApplicationList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/application/types/params.pb.go b/x/application/types/params.pb.go new file mode 100644 index 000000000..83ea72845 --- /dev/null +++ b/x/application/types/params.pb.go @@ -0,0 +1,330 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { + // max_delegated_gateways defines the maximum number of gateways that a single + // application can delegate to. This is used to prevent performance issues + // in case the relay ring signature becomes too large. + MaxDelegatedGateways uint64 `protobuf:"varint,1,opt,name=max_delegated_gateways,json=maxDelegatedGateways,proto3" json:"max_delegated_gateways" yaml:"max_delegated_gateways"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_16533d77d399ef60, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMaxDelegatedGateways() uint64 { + if m != nil { + return m.MaxDelegatedGateways + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.application.Params") +} + +func init() { proto.RegisterFile("poktroll/application/params.proto", fileDescriptor_16533d77d399ef60) } + +var fileDescriptor_16533d77d399ef60 = []byte{ + // 248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, + 0xd3, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, + 0x29, 0xd1, 0x43, 0x52, 0x22, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x0a, + 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x22, 0xaa, 0xb4, 0x98, 0x91, + 0x8b, 0x2d, 0x00, 0x6c, 0x9e, 0x50, 0x21, 0x97, 0x58, 0x6e, 0x62, 0x45, 0x7c, 0x4a, 0x6a, 0x4e, + 0x6a, 0x7a, 0x62, 0x49, 0x6a, 0x4a, 0x3c, 0x88, 0x2c, 0x4f, 0xac, 0x2c, 0x96, 0x60, 0x54, 0x60, + 0xd4, 0x60, 0x71, 0xb2, 0x7e, 0x75, 0x4f, 0x1e, 0x87, 0x8a, 0x4f, 0xf7, 0xe4, 0x65, 0x2b, 0x13, + 0x73, 0x73, 0xac, 0x94, 0xb0, 0xcb, 0x2b, 0x05, 0x89, 0xe4, 0x26, 0x56, 0xb8, 0xc0, 0xc4, 0xdd, + 0xa1, 0xc2, 0x56, 0x6a, 0x2f, 0x16, 0xc8, 0x33, 0x76, 0x3d, 0xdf, 0xa0, 0x25, 0x0b, 0xf7, 0x68, + 0x05, 0x8a, 0x57, 0x21, 0x4e, 0x73, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, + 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, + 0x73, 0xf5, 0x41, 0xe6, 0xe8, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xe3, 0x30, 0xb4, + 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x00, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xcb, 0xd1, 0x5a, 0xaa, 0x64, 0x01, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MaxDelegatedGateways != that1.MaxDelegatedGateways { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxDelegatedGateways != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxDelegatedGateways)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxDelegatedGateways != 0 { + n += 1 + sovParams(uint64(m.MaxDelegatedGateways)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDelegatedGateways", wireType) + } + m.MaxDelegatedGateways = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxDelegatedGateways |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/application/types/query.pb.go b/x/application/types/query.pb.go new file mode 100644 index 000000000..fa797343a --- /dev/null +++ b/x/application/types/query.pb.go @@ -0,0 +1,1366 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetApplicationRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetApplicationRequest) Reset() { *m = QueryGetApplicationRequest{} } +func (m *QueryGetApplicationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetApplicationRequest) ProtoMessage() {} +func (*QueryGetApplicationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{2} +} +func (m *QueryGetApplicationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetApplicationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetApplicationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetApplicationRequest.Merge(m, src) +} +func (m *QueryGetApplicationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetApplicationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetApplicationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetApplicationRequest proto.InternalMessageInfo + +func (m *QueryGetApplicationRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetApplicationResponse struct { + Application Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application"` +} + +func (m *QueryGetApplicationResponse) Reset() { *m = QueryGetApplicationResponse{} } +func (m *QueryGetApplicationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetApplicationResponse) ProtoMessage() {} +func (*QueryGetApplicationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{3} +} +func (m *QueryGetApplicationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetApplicationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetApplicationResponse.Merge(m, src) +} +func (m *QueryGetApplicationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetApplicationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetApplicationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetApplicationResponse proto.InternalMessageInfo + +func (m *QueryGetApplicationResponse) GetApplication() Application { + if m != nil { + return m.Application + } + return Application{} +} + +type QueryAllApplicationsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllApplicationsRequest) Reset() { *m = QueryAllApplicationsRequest{} } +func (m *QueryAllApplicationsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllApplicationsRequest) ProtoMessage() {} +func (*QueryAllApplicationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{4} +} +func (m *QueryAllApplicationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllApplicationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllApplicationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllApplicationsRequest.Merge(m, src) +} +func (m *QueryAllApplicationsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllApplicationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllApplicationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllApplicationsRequest proto.InternalMessageInfo + +func (m *QueryAllApplicationsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllApplicationsResponse struct { + Applications []Application `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllApplicationsResponse) Reset() { *m = QueryAllApplicationsResponse{} } +func (m *QueryAllApplicationsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllApplicationsResponse) ProtoMessage() {} +func (*QueryAllApplicationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cf77e4e046ed3a7, []int{5} +} +func (m *QueryAllApplicationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllApplicationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllApplicationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllApplicationsResponse.Merge(m, src) +} +func (m *QueryAllApplicationsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllApplicationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllApplicationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllApplicationsResponse proto.InternalMessageInfo + +func (m *QueryAllApplicationsResponse) GetApplications() []Application { + if m != nil { + return m.Applications + } + return nil +} + +func (m *QueryAllApplicationsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.application.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.application.QueryParamsResponse") + proto.RegisterType((*QueryGetApplicationRequest)(nil), "poktroll.application.QueryGetApplicationRequest") + proto.RegisterType((*QueryGetApplicationResponse)(nil), "poktroll.application.QueryGetApplicationResponse") + proto.RegisterType((*QueryAllApplicationsRequest)(nil), "poktroll.application.QueryAllApplicationsRequest") + proto.RegisterType((*QueryAllApplicationsResponse)(nil), "poktroll.application.QueryAllApplicationsResponse") +} + +func init() { proto.RegisterFile("poktroll/application/query.proto", fileDescriptor_5cf77e4e046ed3a7) } + +var fileDescriptor_5cf77e4e046ed3a7 = []byte{ + // 538 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x73, 0xa5, 0x04, 0xf5, 0x82, 0x84, 0x38, 0x32, 0x54, 0x26, 0x32, 0xad, 0x07, 0x68, + 0x8b, 0xb8, 0x6b, 0x02, 0xaa, 0x10, 0x0b, 0x34, 0x03, 0x15, 0x62, 0x29, 0x1e, 0x18, 0xd8, 0x2e, + 0xe9, 0xc9, 0xb5, 0xea, 0xf8, 0x75, 0xed, 0x0b, 0x50, 0x21, 0x16, 0xc4, 0x07, 0xa8, 0xc4, 0x97, + 0x60, 0xec, 0xd0, 0x0f, 0xd1, 0xb1, 0x12, 0x4b, 0x27, 0x84, 0x12, 0x24, 0xbe, 0x06, 0xf2, 0xdd, + 0x59, 0xbd, 0xd0, 0x23, 0x6d, 0x96, 0xe8, 0x62, 0x3f, 0xcf, 0x3d, 0xbf, 0xf7, 0x8f, 0x8c, 0x97, + 0x32, 0xd8, 0x93, 0x39, 0x24, 0x09, 0xe3, 0x59, 0x96, 0xc4, 0x7d, 0x2e, 0x63, 0x48, 0xd9, 0xfe, + 0x50, 0xe4, 0x07, 0x34, 0xcb, 0x41, 0x02, 0x69, 0x56, 0x0a, 0x6a, 0x29, 0xbc, 0xdb, 0x7c, 0x10, + 0xa7, 0xc0, 0xd4, 0xaf, 0x16, 0x7a, 0xcd, 0x08, 0x22, 0x50, 0x47, 0x56, 0x9e, 0xcc, 0xd3, 0x56, + 0x04, 0x10, 0x25, 0x82, 0xf1, 0x2c, 0x66, 0x3c, 0x4d, 0x41, 0x2a, 0x7f, 0x61, 0xde, 0xae, 0xf5, + 0xa1, 0x18, 0x40, 0xc1, 0x7a, 0xbc, 0x10, 0x3a, 0x95, 0xbd, 0x6f, 0xf7, 0x84, 0xe4, 0x6d, 0x96, + 0xf1, 0x28, 0x4e, 0x95, 0xd8, 0x68, 0x7d, 0x5b, 0x5b, 0xa9, 0xfa, 0x10, 0x57, 0xef, 0x97, 0x9d, + 0xa5, 0x64, 0x3c, 0xe7, 0x83, 0x2a, 0xce, 0x5d, 0xad, 0x3c, 0xc8, 0x84, 0x51, 0x04, 0x4d, 0x4c, + 0xde, 0x94, 0x18, 0xdb, 0xca, 0x16, 0x8a, 0xfd, 0xa1, 0x28, 0x64, 0xf0, 0x16, 0xdf, 0x99, 0x78, + 0x5a, 0x64, 0x90, 0x16, 0x82, 0x3c, 0xc7, 0x75, 0x7d, 0xfd, 0x22, 0x5a, 0x42, 0x2b, 0x8d, 0x4e, + 0x8b, 0xba, 0x7a, 0x45, 0xb5, 0xab, 0xbb, 0x70, 0xf2, 0xf3, 0x5e, 0xed, 0xfb, 0x9f, 0xa3, 0x35, + 0x14, 0x1a, 0x5b, 0xb0, 0x81, 0x3d, 0x75, 0xef, 0x96, 0x90, 0x9b, 0xe7, 0x06, 0x93, 0x4a, 0x16, + 0xf1, 0x0d, 0xbe, 0xb3, 0x93, 0x8b, 0x42, 0xdf, 0xbf, 0x10, 0x56, 0x7f, 0x83, 0x5d, 0x7c, 0xd7, + 0xe9, 0x33, 0x5c, 0xaf, 0x70, 0xc3, 0xca, 0x37, 0x70, 0xcb, 0x6e, 0x38, 0xcb, 0xdf, 0x9d, 0x2f, + 0x09, 0x43, 0xdb, 0x1b, 0x08, 0x93, 0xb4, 0x99, 0x24, 0x96, 0xb2, 0x6a, 0x0c, 0x79, 0x89, 0xf1, + 0xf9, 0x9c, 0x4c, 0xd0, 0x7d, 0xaa, 0x07, 0x45, 0xcb, 0x41, 0x51, 0xbd, 0x4a, 0x66, 0x5c, 0x74, + 0x9b, 0x47, 0xc2, 0x78, 0x43, 0xcb, 0x19, 0x1c, 0x23, 0xdc, 0x72, 0xe7, 0x98, 0x92, 0x5e, 0xe3, + 0x9b, 0x16, 0x56, 0xd9, 0x90, 0x6b, 0xb3, 0xd4, 0x34, 0x61, 0x26, 0x5b, 0x13, 0xd4, 0x73, 0x8a, + 0xfa, 0xc1, 0xa5, 0xd4, 0x9a, 0xc4, 0xc6, 0xee, 0x7c, 0x9d, 0xc7, 0xd7, 0x15, 0x36, 0x39, 0x44, + 0xb8, 0xae, 0xe7, 0x4c, 0x56, 0xdc, 0x50, 0x17, 0xd7, 0xca, 0x5b, 0xbd, 0x82, 0x52, 0xa7, 0x06, + 0xed, 0x2f, 0x3f, 0x7e, 0x7f, 0x9b, 0x7b, 0x48, 0x56, 0x59, 0x69, 0x79, 0x94, 0x0a, 0xf9, 0x01, + 0xf2, 0x3d, 0x36, 0x65, 0xe5, 0xc9, 0x31, 0xc2, 0x0d, 0xab, 0x13, 0x64, 0x7d, 0x4a, 0x9a, 0x73, + 0x01, 0xbd, 0xf6, 0x0c, 0x0e, 0xc3, 0xf9, 0x42, 0x71, 0x3e, 0x23, 0x4f, 0xaf, 0xc0, 0x69, 0x9f, + 0x3f, 0x99, 0xd5, 0xfe, 0x4c, 0x8e, 0x10, 0xbe, 0xf5, 0xcf, 0x16, 0x90, 0x69, 0x20, 0xee, 0xcd, + 0xf4, 0x3a, 0xb3, 0x58, 0x0c, 0xfc, 0x86, 0x82, 0x5f, 0x27, 0x74, 0x36, 0xf8, 0x6e, 0x78, 0x32, + 0xf2, 0xd1, 0xe9, 0xc8, 0x47, 0x67, 0x23, 0x1f, 0xfd, 0x1a, 0xf9, 0xe8, 0x70, 0xec, 0xd7, 0x4e, + 0xc7, 0x7e, 0xed, 0x6c, 0xec, 0xd7, 0xde, 0x3d, 0x89, 0x62, 0xb9, 0x3b, 0xec, 0xd1, 0x3e, 0x0c, + 0xfe, 0x73, 0xef, 0xc7, 0x8b, 0x9f, 0xa3, 0x5e, 0x5d, 0x7d, 0x8f, 0x1e, 0xff, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0xab, 0x23, 0x79, 0xa6, 0xa1, 0x05, 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 Application items. + Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) + AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.application.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Application(ctx context.Context, in *QueryGetApplicationRequest, opts ...grpc.CallOption) (*QueryGetApplicationResponse, error) { + out := new(QueryGetApplicationResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Query/Application", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllApplications(ctx context.Context, in *QueryAllApplicationsRequest, opts ...grpc.CallOption) (*QueryAllApplicationsResponse, error) { + out := new(QueryAllApplicationsResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Query/AllApplications", in, out, opts...) + 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 Application items. + Application(context.Context, *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) + AllApplications(context.Context, *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, 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) Application(ctx context.Context, req *QueryGetApplicationRequest) (*QueryGetApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Application not implemented") +} +func (*UnimplementedQueryServer) AllApplications(ctx context.Context, req *QueryAllApplicationsRequest) (*QueryAllApplicationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllApplications not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.application.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 _Query_Application_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetApplicationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Application(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Query/Application", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Application(ctx, req.(*QueryGetApplicationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllApplicationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllApplications(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Query/AllApplications", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllApplications(ctx, req.(*QueryAllApplicationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.application.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Application", + Handler: _Query_Application_Handler, + }, + { + MethodName: "AllApplications", + Handler: _Query_AllApplications_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/application/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetApplicationRequest) 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 *QueryGetApplicationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetApplicationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 len(dAtA) - i, nil +} + +func (m *QueryGetApplicationResponse) 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 *QueryGetApplicationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Application.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 *QueryAllApplicationsRequest) 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 *QueryAllApplicationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllApplicationsRequest) 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 *QueryAllApplicationsResponse) 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 *QueryAllApplicationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllApplicationsResponse) 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.Applications) > 0 { + for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Applications[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 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 *QueryGetApplicationRequest) 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)) + } + return n +} + +func (m *QueryGetApplicationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Application.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllApplicationsRequest) 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 *QueryAllApplicationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Applications) > 0 { + for _, e := range m.Applications { + 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 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 *QueryGetApplicationRequest) 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: QueryGetApplicationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetApplicationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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 *QueryGetApplicationResponse) 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: QueryGetApplicationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", 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.Application.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 *QueryAllApplicationsRequest) 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: QueryAllApplicationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllApplicationsRequest: 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 + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllApplicationsResponse) 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: QueryAllApplicationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllApplicationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Applications", 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.Applications = append(m.Applications, Application{}) + if err := m.Applications[len(m.Applications)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/application/types/query.pb.gw.go b/x/application/types/query.pb.gw.go new file mode 100644 index 000000000..362f63ea2 --- /dev/null +++ b/x/application/types/query.pb.gw.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/application/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Application_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetApplicationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.Application(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Application_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetApplicationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.Application(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllApplications_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllApplications_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllApplicationsRequest + 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_AllApplications_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllApplications(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllApplications_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllApplicationsRequest + 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_AllApplications_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllApplications(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Application_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_Application_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_Application_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllApplications_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_AllApplications_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_AllApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Application_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_Application_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_Application_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllApplications_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_AllApplications_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_AllApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "application", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Application_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "application", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllApplications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "application"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Application_0 = runtime.ForwardResponseMessage + + forward_Query_AllApplications_0 = runtime.ForwardResponseMessage +) diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go new file mode 100644 index 000000000..eb938d65d --- /dev/null +++ b/x/application/types/tx.pb.go @@ -0,0 +1,2103 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/pokt-network/poktroll/x/shared/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/application parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +type MsgStakeApplication struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*types1.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` +} + +func (m *MsgStakeApplication) Reset() { *m = MsgStakeApplication{} } +func (m *MsgStakeApplication) String() string { return proto.CompactTextString(m) } +func (*MsgStakeApplication) ProtoMessage() {} +func (*MsgStakeApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{2} +} +func (m *MsgStakeApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeApplication.Merge(m, src) +} +func (m *MsgStakeApplication) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeApplication proto.InternalMessageInfo + +func (m *MsgStakeApplication) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgStakeApplication) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +func (m *MsgStakeApplication) GetServices() []*types1.ApplicationServiceConfig { + if m != nil { + return m.Services + } + return nil +} + +type MsgStakeApplicationResponse struct { +} + +func (m *MsgStakeApplicationResponse) Reset() { *m = MsgStakeApplicationResponse{} } +func (m *MsgStakeApplicationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStakeApplicationResponse) ProtoMessage() {} +func (*MsgStakeApplicationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{3} +} +func (m *MsgStakeApplicationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeApplicationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeApplicationResponse.Merge(m, src) +} +func (m *MsgStakeApplicationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeApplicationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeApplicationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeApplicationResponse proto.InternalMessageInfo + +type MsgUnstakeApplication struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUnstakeApplication) Reset() { *m = MsgUnstakeApplication{} } +func (m *MsgUnstakeApplication) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeApplication) ProtoMessage() {} +func (*MsgUnstakeApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{4} +} +func (m *MsgUnstakeApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeApplication.Merge(m, src) +} +func (m *MsgUnstakeApplication) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeApplication proto.InternalMessageInfo + +func (m *MsgUnstakeApplication) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUnstakeApplicationResponse struct { +} + +func (m *MsgUnstakeApplicationResponse) Reset() { *m = MsgUnstakeApplicationResponse{} } +func (m *MsgUnstakeApplicationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeApplicationResponse) ProtoMessage() {} +func (*MsgUnstakeApplicationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{5} +} +func (m *MsgUnstakeApplicationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeApplicationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeApplicationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeApplicationResponse.Merge(m, src) +} +func (m *MsgUnstakeApplicationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeApplicationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeApplicationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeApplicationResponse proto.InternalMessageInfo + +type MsgDelegateToGateway struct { + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` +} + +func (m *MsgDelegateToGateway) Reset() { *m = MsgDelegateToGateway{} } +func (m *MsgDelegateToGateway) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateToGateway) ProtoMessage() {} +func (*MsgDelegateToGateway) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{6} +} +func (m *MsgDelegateToGateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateToGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgDelegateToGateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateToGateway.Merge(m, src) +} +func (m *MsgDelegateToGateway) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateToGateway) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateToGateway.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateToGateway proto.InternalMessageInfo + +func (m *MsgDelegateToGateway) GetAppAddress() string { + if m != nil { + return m.AppAddress + } + return "" +} + +func (m *MsgDelegateToGateway) GetGatewayAddress() string { + if m != nil { + return m.GatewayAddress + } + return "" +} + +type MsgDelegateToGatewayResponse struct { +} + +func (m *MsgDelegateToGatewayResponse) Reset() { *m = MsgDelegateToGatewayResponse{} } +func (m *MsgDelegateToGatewayResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateToGatewayResponse) ProtoMessage() {} +func (*MsgDelegateToGatewayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{7} +} +func (m *MsgDelegateToGatewayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateToGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgDelegateToGatewayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateToGatewayResponse.Merge(m, src) +} +func (m *MsgDelegateToGatewayResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateToGatewayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateToGatewayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateToGatewayResponse proto.InternalMessageInfo + +type MsgUndelegateFromGateway struct { + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` +} + +func (m *MsgUndelegateFromGateway) Reset() { *m = MsgUndelegateFromGateway{} } +func (m *MsgUndelegateFromGateway) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateFromGateway) ProtoMessage() {} +func (*MsgUndelegateFromGateway) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{8} +} +func (m *MsgUndelegateFromGateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateFromGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUndelegateFromGateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateFromGateway.Merge(m, src) +} +func (m *MsgUndelegateFromGateway) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateFromGateway) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateFromGateway.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateFromGateway proto.InternalMessageInfo + +func (m *MsgUndelegateFromGateway) GetAppAddress() string { + if m != nil { + return m.AppAddress + } + return "" +} + +func (m *MsgUndelegateFromGateway) GetGatewayAddress() string { + if m != nil { + return m.GatewayAddress + } + return "" +} + +type MsgUndelegateFromGatewayResponse struct { +} + +func (m *MsgUndelegateFromGatewayResponse) Reset() { *m = MsgUndelegateFromGatewayResponse{} } +func (m *MsgUndelegateFromGatewayResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateFromGatewayResponse) ProtoMessage() {} +func (*MsgUndelegateFromGatewayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{9} +} +func (m *MsgUndelegateFromGatewayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateFromGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUndelegateFromGatewayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateFromGatewayResponse.Merge(m, src) +} +func (m *MsgUndelegateFromGatewayResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateFromGatewayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateFromGatewayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateFromGatewayResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.application.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.application.MsgUpdateParamsResponse") + proto.RegisterType((*MsgStakeApplication)(nil), "poktroll.application.MsgStakeApplication") + proto.RegisterType((*MsgStakeApplicationResponse)(nil), "poktroll.application.MsgStakeApplicationResponse") + proto.RegisterType((*MsgUnstakeApplication)(nil), "poktroll.application.MsgUnstakeApplication") + proto.RegisterType((*MsgUnstakeApplicationResponse)(nil), "poktroll.application.MsgUnstakeApplicationResponse") + proto.RegisterType((*MsgDelegateToGateway)(nil), "poktroll.application.MsgDelegateToGateway") + proto.RegisterType((*MsgDelegateToGatewayResponse)(nil), "poktroll.application.MsgDelegateToGatewayResponse") + proto.RegisterType((*MsgUndelegateFromGateway)(nil), "poktroll.application.MsgUndelegateFromGateway") + proto.RegisterType((*MsgUndelegateFromGatewayResponse)(nil), "poktroll.application.MsgUndelegateFromGatewayResponse") +} + +func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } + +var fileDescriptor_bed224e38ab1cc6d = []byte{ + // 670 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x4f, 0x13, 0x41, + 0x14, 0xef, 0x82, 0xa0, 0x3c, 0x88, 0xc0, 0x5a, 0x42, 0x59, 0x61, 0xa9, 0x4d, 0x34, 0x50, 0xc3, + 0x4e, 0x5a, 0x0c, 0x09, 0x5c, 0x08, 0xe0, 0x9f, 0x53, 0x13, 0x53, 0xf4, 0xe2, 0x85, 0x4c, 0xdb, + 0x71, 0xd8, 0xd0, 0xee, 0x4c, 0x76, 0x86, 0x02, 0x27, 0x8d, 0x47, 0x4f, 0x7e, 0x0a, 0x63, 0x3c, + 0x71, 0xf0, 0x2b, 0x98, 0x70, 0x93, 0x70, 0xe2, 0x64, 0x4c, 0x39, 0xf0, 0x35, 0xcc, 0x76, 0x66, + 0xb7, 0xb0, 0xdd, 0x4a, 0xb9, 0x79, 0x69, 0xbb, 0xf3, 0x7e, 0xef, 0xf7, 0xe7, 0xcd, 0xcc, 0x16, + 0xe6, 0x38, 0xdb, 0x93, 0x3e, 0xab, 0xd7, 0x11, 0xe6, 0xbc, 0xee, 0x56, 0xb1, 0x74, 0x99, 0x87, + 0xe4, 0xa1, 0xc3, 0x7d, 0x26, 0x99, 0x99, 0x0e, 0xcb, 0xce, 0x95, 0xb2, 0x35, 0x89, 0x1b, 0xae, + 0xc7, 0x50, 0xfb, 0x53, 0x01, 0xad, 0x99, 0x2a, 0x13, 0x0d, 0x26, 0x76, 0xda, 0x4f, 0x48, 0x3d, + 0xe8, 0x92, 0xad, 0x9e, 0x50, 0x05, 0x0b, 0x82, 0x9a, 0x85, 0x0a, 0x91, 0xb8, 0x80, 0xaa, 0xcc, + 0xf5, 0x74, 0x7d, 0x5a, 0xd7, 0x1b, 0x82, 0xa2, 0x66, 0x21, 0xf8, 0xd2, 0x85, 0x34, 0x65, 0x94, + 0x29, 0xc2, 0xe0, 0x97, 0x5e, 0x7d, 0x94, 0xe8, 0x98, 0x63, 0x1f, 0x37, 0x42, 0xc5, 0x4e, 0x28, + 0xb1, 0x8b, 0x7d, 0x52, 0x43, 0x82, 0xf8, 0x4d, 0xb7, 0x4a, 0x54, 0x39, 0xf7, 0xd3, 0x80, 0xf1, + 0x92, 0xa0, 0x6f, 0x79, 0x0d, 0x4b, 0xf2, 0xba, 0xdd, 0x68, 0xae, 0xc0, 0x08, 0xde, 0x97, 0xbb, + 0xcc, 0x77, 0xe5, 0x51, 0xc6, 0xc8, 0x1a, 0x0b, 0x23, 0x9b, 0x99, 0xb3, 0x1f, 0x4b, 0x69, 0x9d, + 0x64, 0xa3, 0x56, 0xf3, 0x89, 0x10, 0xdb, 0xd2, 0x77, 0x3d, 0x5a, 0xee, 0x40, 0xcd, 0x75, 0x18, + 0x56, 0xd2, 0x99, 0x81, 0xac, 0xb1, 0x30, 0x5a, 0x9c, 0x75, 0x92, 0x26, 0xe6, 0x28, 0x95, 0xcd, + 0x91, 0x93, 0xdf, 0xf3, 0xa9, 0x6f, 0x97, 0xc7, 0x79, 0xa3, 0xac, 0xdb, 0xd6, 0x56, 0x3f, 0x5d, + 0x1e, 0xe7, 0x3b, 0x84, 0x9f, 0x2f, 0x8f, 0xf3, 0x4f, 0x22, 0xfb, 0x87, 0xd7, 0x32, 0xc6, 0x3c, + 0xe7, 0x66, 0x60, 0x3a, 0xb6, 0x54, 0x26, 0x82, 0x33, 0x4f, 0x90, 0xdc, 0x2f, 0x03, 0x1e, 0x94, + 0x04, 0xdd, 0x96, 0x78, 0x8f, 0x6c, 0x74, 0x28, 0xcc, 0x22, 0xdc, 0xc5, 0x2a, 0xca, 0x8d, 0x21, + 0x43, 0xa0, 0x89, 0x60, 0x48, 0x04, 0x3c, 0x3a, 0xe1, 0x8c, 0xa3, 0xe1, 0xc1, 0x7e, 0x3a, 0x7a, + 0x3f, 0x9d, 0x2d, 0xe6, 0x7a, 0x65, 0x85, 0x33, 0x5f, 0xc0, 0x3d, 0x3d, 0x70, 0x91, 0x19, 0xcc, + 0x0e, 0x2e, 0x8c, 0x16, 0x17, 0x3b, 0x53, 0x51, 0x3b, 0xe2, 0x5c, 0x31, 0xb5, 0xad, 0xb0, 0x5b, + 0xcc, 0x7b, 0xef, 0xd2, 0x72, 0xd4, 0xba, 0x36, 0x16, 0x4c, 0x26, 0x74, 0x91, 0x9b, 0x83, 0x87, + 0x09, 0x81, 0xa2, 0xc0, 0xeb, 0x30, 0x15, 0xcc, 0xc2, 0x13, 0xf1, 0xc4, 0x99, 0x58, 0xe2, 0x28, + 0x57, 0x8c, 0x7f, 0x1e, 0xe6, 0x12, 0x09, 0x22, 0x85, 0xaf, 0x06, 0xa4, 0x4b, 0x82, 0x3e, 0x27, + 0x75, 0x42, 0xb1, 0x24, 0x6f, 0xd8, 0x2b, 0x2c, 0xc9, 0x01, 0x3e, 0x32, 0x57, 0x61, 0x14, 0x73, + 0xbe, 0xd3, 0xef, 0x5c, 0x01, 0x73, 0xae, 0x57, 0xcc, 0x0d, 0x18, 0xa7, 0x8a, 0x25, 0x6a, 0x1f, + 0xb8, 0xa1, 0xfd, 0xbe, 0x6e, 0xd0, 0xab, 0x6b, 0x13, 0x41, 0x8a, 0xab, 0x06, 0x72, 0x36, 0xcc, + 0x26, 0xf9, 0x8c, 0x82, 0x7c, 0x37, 0x20, 0xd3, 0x8e, 0x5a, 0xd3, 0x90, 0x97, 0x3e, 0x6b, 0xfc, + 0xaf, 0x61, 0x72, 0x90, 0xed, 0xe5, 0x35, 0x0c, 0x54, 0x3c, 0xbb, 0x03, 0x83, 0x25, 0x41, 0xcd, + 0x1a, 0x8c, 0x5d, 0xbb, 0xd3, 0x8f, 0x93, 0xef, 0x62, 0xec, 0xce, 0x58, 0x4b, 0x7d, 0xc1, 0x42, + 0x35, 0x93, 0xc3, 0x44, 0xd7, 0xb5, 0x5a, 0xec, 0x49, 0x11, 0x87, 0x5a, 0x85, 0xbe, 0xa1, 0x91, + 0x62, 0x13, 0xcc, 0x84, 0x83, 0xfd, 0xb4, 0xb7, 0xed, 0x2e, 0xb0, 0xb5, 0x7c, 0x0b, 0x70, 0xa4, + 0x2b, 0x60, 0xb2, 0xfb, 0xb4, 0xe7, 0x7b, 0x32, 0x75, 0x61, 0xad, 0x62, 0xff, 0xd8, 0x48, 0xf4, + 0x03, 0x4c, 0x25, 0x9f, 0x4c, 0xe7, 0x1f, 0x11, 0x12, 0xf0, 0xd6, 0xca, 0xed, 0xf0, 0xa1, 0x01, + 0x6b, 0xe8, 0x63, 0xf0, 0x7e, 0xde, 0x2c, 0x9f, 0xb4, 0x6c, 0xe3, 0xb4, 0x65, 0x1b, 0xe7, 0x2d, + 0xdb, 0xf8, 0xd3, 0xb2, 0x8d, 0x2f, 0x17, 0x76, 0xea, 0xf4, 0xc2, 0x4e, 0x9d, 0x5f, 0xd8, 0xa9, + 0x77, 0xcf, 0xa8, 0x2b, 0x77, 0xf7, 0x2b, 0x4e, 0x95, 0x35, 0x50, 0x20, 0xb3, 0xe4, 0x11, 0x79, + 0xc0, 0xfc, 0x3d, 0xd4, 0xe3, 0xd5, 0x2d, 0x8f, 0x38, 0x11, 0x95, 0xe1, 0xf6, 0xff, 0xcf, 0xf2, + 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x43, 0x0b, 0x7e, 0x75, 0x07, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) + UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) + DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) + UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeApplication(ctx context.Context, in *MsgStakeApplication, opts ...grpc.CallOption) (*MsgStakeApplicationResponse, error) { + out := new(MsgStakeApplicationResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/StakeApplication", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) { + out := new(MsgUnstakeApplicationResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UnstakeApplication", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) { + out := new(MsgDelegateToGatewayResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/DelegateToGateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) { + out := new(MsgUndelegateFromGatewayResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/UndelegateFromGateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeApplication(context.Context, *MsgStakeApplication) (*MsgStakeApplicationResponse, error) + UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) + DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) + UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) StakeApplication(ctx context.Context, req *MsgStakeApplication) (*MsgStakeApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeApplication not implemented") +} +func (*UnimplementedMsgServer) UnstakeApplication(ctx context.Context, req *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeApplication not implemented") +} +func (*UnimplementedMsgServer) DelegateToGateway(ctx context.Context, req *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegateToGateway not implemented") +} +func (*UnimplementedMsgServer) UndelegateFromGateway(ctx context.Context, req *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/StakeApplication", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeApplication(ctx, req.(*MsgStakeApplication)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/UnstakeApplication", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeApplication(ctx, req.(*MsgUnstakeApplication)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DelegateToGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegateToGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelegateToGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/DelegateToGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DelegateToGateway(ctx, req.(*MsgDelegateToGateway)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegateFromGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UndelegateFromGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/UndelegateFromGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UndelegateFromGateway(ctx, req.(*MsgUndelegateFromGateway)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.application.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeApplication", + Handler: _Msg_StakeApplication_Handler, + }, + { + MethodName: "UnstakeApplication", + Handler: _Msg_UnstakeApplication_Handler, + }, + { + MethodName: "DelegateToGateway", + Handler: _Msg_DelegateToGateway_Handler, + }, + { + MethodName: "UndelegateFromGateway", + Handler: _Msg_UndelegateFromGateway_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/application/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgStakeApplication) 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 *MsgStakeApplication) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStakeApplicationResponse) 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 *MsgStakeApplicationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeApplication) 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 *MsgUnstakeApplication) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeApplicationResponse) 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 *MsgUnstakeApplicationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDelegateToGateway) 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 *MsgDelegateToGateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateToGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GatewayAddress) > 0 { + i -= len(m.GatewayAddress) + copy(dAtA[i:], m.GatewayAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.GatewayAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.AppAddress) > 0 { + i -= len(m.AppAddress) + copy(dAtA[i:], m.AppAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AppAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDelegateToGatewayResponse) 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 *MsgDelegateToGatewayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateToGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUndelegateFromGateway) 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 *MsgUndelegateFromGateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateFromGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GatewayAddress) > 0 { + i -= len(m.GatewayAddress) + copy(dAtA[i:], m.GatewayAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.GatewayAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.AppAddress) > 0 { + i -= len(m.AppAddress) + copy(dAtA[i:], m.AppAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AppAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUndelegateFromGatewayResponse) 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 *MsgUndelegateFromGatewayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateFromGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgStakeApplication) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Services) > 0 { + for _, e := range m.Services { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgStakeApplicationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUnstakeApplication) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnstakeApplicationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDelegateToGateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GatewayAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDelegateToGatewayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUndelegateFromGateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GatewayAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUndelegateFromGatewayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeApplication) 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 ErrIntOverflowTx + } + 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: MsgStakeApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Services = append(m.Services, &types1.ApplicationServiceConfig{}) + if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeApplicationResponse) 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 ErrIntOverflowTx + } + 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: MsgStakeApplicationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeApplication) 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 ErrIntOverflowTx + } + 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: MsgUnstakeApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeApplicationResponse) 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 ErrIntOverflowTx + } + 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: MsgUnstakeApplicationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegateToGateway) 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 ErrIntOverflowTx + } + 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: MsgDelegateToGateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateToGateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GatewayAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegateToGatewayResponse) 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 ErrIntOverflowTx + } + 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: MsgDelegateToGatewayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateToGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegateFromGateway) 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 ErrIntOverflowTx + } + 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: MsgUndelegateFromGateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateFromGateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GatewayAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegateFromGatewayResponse) 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 ErrIntOverflowTx + } + 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: MsgUndelegateFromGatewayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateFromGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/application/types/types.pb.go b/x/application/types/types.pb.go new file mode 100644 index 000000000..1b90dba76 --- /dev/null +++ b/x/application/types/types.pb.go @@ -0,0 +1,896 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/application/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" + types1 "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// Application defines the type used to store an on-chain definition and state for an application +type Application struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` + // TODO_BETA(@red-0ne, @olshansk): Limit this to one service_config. + // Remove `repeated`, drop the `s` from service_configs and document why + // this is the case in the app config (and here) per this discussion: + // https://github.com/pokt-network/poktroll/pull/750#discussion_r1735025033 + ServiceConfigs []*types1.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=service_configs,json=serviceConfigs,proto3" json:"service_configs,omitempty"` + // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. + // Ensure to rename all relevant configs, comments, variables, function names, etc as well. + DelegateeGatewayAddresses []string `protobuf:"bytes,4,rep,name=delegatee_gateway_addresses,json=delegateeGatewayAddresses,proto3" json:"delegatee_gateway_addresses,omitempty"` + // A map from sessionEndHeights to a list of Gateways. + // The key is the height of the last block of the session during which the + // respective undelegation was committed. + // The value is a list of gateways being undelegated from. + // TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment + // so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906. + PendingUndelegations map[uint64]UndelegatingGatewayList `protobuf:"bytes,5,rep,name=pending_undelegations,json=pendingUndelegations,proto3" json:"pending_undelegations" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The end height of the session at which an application initiated its unstaking process. + // If the application did not unstake, this value will be 0. + UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` +} + +func (m *Application) Reset() { *m = Application{} } +func (m *Application) String() string { return proto.CompactTextString(m) } +func (*Application) ProtoMessage() {} +func (*Application) Descriptor() ([]byte, []int) { + return fileDescriptor_1899440439257283, []int{0} +} +func (m *Application) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Application) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Application) XXX_Merge(src proto.Message) { + xxx_messageInfo_Application.Merge(m, src) +} +func (m *Application) XXX_Size() int { + return m.Size() +} +func (m *Application) XXX_DiscardUnknown() { + xxx_messageInfo_Application.DiscardUnknown(m) +} + +var xxx_messageInfo_Application proto.InternalMessageInfo + +func (m *Application) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Application) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +func (m *Application) GetServiceConfigs() []*types1.ApplicationServiceConfig { + if m != nil { + return m.ServiceConfigs + } + return nil +} + +func (m *Application) GetDelegateeGatewayAddresses() []string { + if m != nil { + return m.DelegateeGatewayAddresses + } + return nil +} + +func (m *Application) GetPendingUndelegations() map[uint64]UndelegatingGatewayList { + if m != nil { + return m.PendingUndelegations + } + return nil +} + +func (m *Application) GetUnstakeSessionEndHeight() uint64 { + if m != nil { + return m.UnstakeSessionEndHeight + } + return 0 +} + +// UndelegatingGatewayList is used as the Value of `pending_undelegations`. +// It is required to store a repeated list of strings as a map value. +type UndelegatingGatewayList struct { + GatewayAddresses []string `protobuf:"bytes,2,rep,name=gateway_addresses,json=gatewayAddresses,proto3" json:"gateway_addresses,omitempty"` +} + +func (m *UndelegatingGatewayList) Reset() { *m = UndelegatingGatewayList{} } +func (m *UndelegatingGatewayList) String() string { return proto.CompactTextString(m) } +func (*UndelegatingGatewayList) ProtoMessage() {} +func (*UndelegatingGatewayList) Descriptor() ([]byte, []int) { + return fileDescriptor_1899440439257283, []int{1} +} +func (m *UndelegatingGatewayList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegatingGatewayList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *UndelegatingGatewayList) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegatingGatewayList.Merge(m, src) +} +func (m *UndelegatingGatewayList) XXX_Size() int { + return m.Size() +} +func (m *UndelegatingGatewayList) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegatingGatewayList.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegatingGatewayList proto.InternalMessageInfo + +func (m *UndelegatingGatewayList) GetGatewayAddresses() []string { + if m != nil { + return m.GatewayAddresses + } + return nil +} + +func init() { + proto.RegisterType((*Application)(nil), "poktroll.application.Application") + proto.RegisterMapType((map[uint64]UndelegatingGatewayList)(nil), "poktroll.application.Application.PendingUndelegationsEntry") + proto.RegisterType((*UndelegatingGatewayList)(nil), "poktroll.application.UndelegatingGatewayList") +} + +func init() { proto.RegisterFile("poktroll/application/types.proto", fileDescriptor_1899440439257283) } + +var fileDescriptor_1899440439257283 = []byte{ + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4d, 0x6f, 0xd3, 0x30, + 0x1c, 0xc6, 0x9b, 0xbe, 0x0c, 0xcd, 0x95, 0x60, 0x58, 0x45, 0x4b, 0x0b, 0x84, 0x68, 0xa7, 0x72, + 0xa8, 0xad, 0x15, 0x0e, 0x88, 0x9d, 0xda, 0x6a, 0x02, 0x24, 0x0e, 0x28, 0x15, 0x17, 0x84, 0x14, + 0xb9, 0x89, 0x71, 0xad, 0x76, 0x76, 0x14, 0xbb, 0x19, 0xfd, 0x16, 0x7c, 0x18, 0x3e, 0xc4, 0x8e, + 0x83, 0xd3, 0x4e, 0x08, 0xb5, 0x5f, 0x04, 0x25, 0x76, 0xbb, 0x88, 0xb5, 0xd2, 0x2e, 0x51, 0xac, + 0xe7, 0xf7, 0xd8, 0x8f, 0xfd, 0xe8, 0x0f, 0xfc, 0x44, 0xce, 0x74, 0x2a, 0xe7, 0x73, 0x4c, 0x92, + 0x64, 0xce, 0x23, 0xa2, 0xb9, 0x14, 0x58, 0x2f, 0x13, 0xaa, 0x50, 0x92, 0x4a, 0x2d, 0x61, 0x6b, + 0x43, 0xa0, 0x12, 0xd1, 0x69, 0x31, 0xc9, 0x64, 0x01, 0xe0, 0xfc, 0xcf, 0xb0, 0x1d, 0x2f, 0x92, + 0xea, 0x42, 0x2a, 0x3c, 0x21, 0x8a, 0xe2, 0xec, 0x74, 0x42, 0x35, 0x39, 0xc5, 0x91, 0xe4, 0xc2, + 0xea, 0x6d, 0xa3, 0x87, 0xc6, 0x68, 0x16, 0x56, 0x7a, 0xbe, 0x0d, 0xa2, 0xa6, 0x24, 0xa5, 0x31, + 0x56, 0x34, 0xcd, 0x78, 0x44, 0x8d, 0x7c, 0xf2, 0xab, 0x0e, 0x9a, 0x83, 0xdb, 0xf3, 0x61, 0x1f, + 0x3c, 0x20, 0x71, 0x9c, 0x52, 0xa5, 0x5c, 0xc7, 0x77, 0xba, 0x87, 0x43, 0xf7, 0xf7, 0xcf, 0x5e, + 0xcb, 0xee, 0x38, 0x30, 0xca, 0x58, 0xa7, 0x5c, 0xb0, 0x60, 0x03, 0x42, 0x0c, 0x1a, 0x4a, 0x93, + 0x19, 0x75, 0xab, 0xbe, 0xd3, 0x6d, 0xf6, 0xdb, 0xc8, 0xe2, 0x79, 0x5a, 0x64, 0xd3, 0xa2, 0x91, + 0xe4, 0x22, 0x30, 0x1c, 0x0c, 0xc0, 0x23, 0x9b, 0x22, 0x8c, 0xa4, 0xf8, 0xc6, 0x99, 0x72, 0x6b, + 0x7e, 0xad, 0xdb, 0xec, 0xbf, 0x44, 0xdb, 0x47, 0x31, 0x69, 0x51, 0x29, 0xdb, 0xd8, 0x58, 0x46, + 0x85, 0x23, 0x78, 0xa8, 0xca, 0x4b, 0x05, 0xbf, 0x82, 0xa7, 0x31, 0x9d, 0x53, 0x46, 0x34, 0xa5, + 0x61, 0xfe, 0xbd, 0x24, 0xcb, 0xd0, 0x26, 0xa4, 0xca, 0xad, 0xfb, 0xb5, 0xee, 0xe1, 0xf0, 0xd9, + 0xd5, 0x9f, 0x17, 0x95, 0xbd, 0x17, 0x6a, 0x6f, 0x37, 0x78, 0x67, 0xfc, 0x83, 0x8d, 0x1d, 0x66, + 0xe0, 0x49, 0x42, 0x45, 0xcc, 0x05, 0x0b, 0x17, 0xc2, 0x62, 0x5c, 0x0a, 0xe5, 0x36, 0x8a, 0xdc, + 0x67, 0x68, 0x57, 0x99, 0xe5, 0xf0, 0xe8, 0x93, 0xb1, 0x7f, 0x2e, 0xbb, 0xcf, 0x85, 0x4e, 0x97, + 0xc3, 0x7a, 0x1e, 0x2a, 0x68, 0x25, 0x3b, 0x00, 0x78, 0x06, 0x3a, 0x0b, 0x51, 0x3c, 0x5a, 0xa8, + 0xa8, 0x52, 0x5c, 0x8a, 0x90, 0x8a, 0x38, 0x9c, 0x52, 0xce, 0xa6, 0xda, 0x3d, 0xf0, 0x9d, 0x6e, + 0x3d, 0x38, 0xb6, 0xc4, 0xd8, 0x00, 0xe7, 0x22, 0x7e, 0x5f, 0xc8, 0x9d, 0x0c, 0xb4, 0xf7, 0x9e, + 0x0a, 0x8f, 0x40, 0x6d, 0x46, 0x97, 0x45, 0xc9, 0xf5, 0x20, 0xff, 0x85, 0x23, 0xd0, 0xc8, 0xc8, + 0x7c, 0xb1, 0xa9, 0xb1, 0xb7, 0xfb, 0x4e, 0xb7, 0x5b, 0x09, 0x66, 0x9f, 0xe9, 0x23, 0x57, 0x3a, + 0x30, 0xde, 0xb7, 0xd5, 0x37, 0xce, 0x49, 0x0c, 0x8e, 0xf7, 0x50, 0xf0, 0x03, 0x78, 0x7c, 0xb7, + 0x9b, 0xea, 0x3d, 0xba, 0x39, 0x62, 0xff, 0x55, 0x32, 0x0c, 0xae, 0x56, 0x9e, 0x73, 0xbd, 0xf2, + 0x9c, 0x9b, 0x95, 0xe7, 0xfc, 0x5d, 0x79, 0xce, 0x8f, 0xb5, 0x57, 0xb9, 0x5e, 0x7b, 0x95, 0x9b, + 0xb5, 0x57, 0xf9, 0xf2, 0x9a, 0x71, 0x3d, 0x5d, 0x4c, 0x50, 0x24, 0x2f, 0x70, 0x7e, 0x8f, 0x9e, + 0xa0, 0xfa, 0x52, 0xa6, 0x33, 0xbc, 0x1d, 0x87, 0xef, 0x77, 0x27, 0x73, 0x72, 0x50, 0x0c, 0xc5, + 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, 0x59, 0x36, 0xdf, 0xbe, 0x03, 0x00, 0x00, +} + +func (m *Application) 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 *Application) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Application) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnstakeSessionEndHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.UnstakeSessionEndHeight)) + i-- + dAtA[i] = 0x30 + } + if len(m.PendingUndelegations) > 0 { + keysForPendingUndelegations := make([]uint64, 0, len(m.PendingUndelegations)) + for k := range m.PendingUndelegations { + keysForPendingUndelegations = append(keysForPendingUndelegations, uint64(k)) + } + github_com_cosmos_gogoproto_sortkeys.Uint64s(keysForPendingUndelegations) + for iNdEx := len(keysForPendingUndelegations) - 1; iNdEx >= 0; iNdEx-- { + v := m.PendingUndelegations[uint64(keysForPendingUndelegations[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i = encodeVarintTypes(dAtA, i, uint64(keysForPendingUndelegations[iNdEx])) + i-- + dAtA[i] = 0x8 + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.DelegateeGatewayAddresses) > 0 { + for iNdEx := len(m.DelegateeGatewayAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DelegateeGatewayAddresses[iNdEx]) + copy(dAtA[i:], m.DelegateeGatewayAddresses[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.DelegateeGatewayAddresses[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ServiceConfigs) > 0 { + for iNdEx := len(m.ServiceConfigs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ServiceConfigs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegatingGatewayList) 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 *UndelegatingGatewayList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegatingGatewayList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GatewayAddresses) > 0 { + for iNdEx := len(m.GatewayAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GatewayAddresses[iNdEx]) + copy(dAtA[i:], m.GatewayAddresses[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.GatewayAddresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Application) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.ServiceConfigs) > 0 { + for _, e := range m.ServiceConfigs { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.DelegateeGatewayAddresses) > 0 { + for _, s := range m.DelegateeGatewayAddresses { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.PendingUndelegations) > 0 { + for k, v := range m.PendingUndelegations { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l)) + n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) + } + } + if m.UnstakeSessionEndHeight != 0 { + n += 1 + sovTypes(uint64(m.UnstakeSessionEndHeight)) + } + return n +} + +func (m *UndelegatingGatewayList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GatewayAddresses) > 0 { + for _, s := range m.GatewayAddresses { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Application) 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 ErrIntOverflowTypes + } + 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: Application: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Application: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceConfigs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceConfigs = append(m.ServiceConfigs, &types1.ApplicationServiceConfig{}) + if err := m.ServiceConfigs[len(m.ServiceConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegateeGatewayAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegateeGatewayAddresses = append(m.DelegateeGatewayAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingUndelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PendingUndelegations == nil { + m.PendingUndelegations = make(map[uint64]UndelegatingGatewayList) + } + var mapkey uint64 + mapvalue := &UndelegatingGatewayList{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthTypes + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthTypes + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &UndelegatingGatewayList{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PendingUndelegations[mapkey] = *mapvalue + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) + } + m.UnstakeSessionEndHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnstakeSessionEndHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegatingGatewayList) 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 ErrIntOverflowTypes + } + 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: UndelegatingGatewayList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegatingGatewayList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GatewayAddresses = append(m.GatewayAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/event.pb.go b/x/gateway/types/event.pb.go new file mode 100644 index 000000000..552e0306a --- /dev/null +++ b/x/gateway/types/event.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GatewayStaked defines the event emitted when a gateway has been unstaked. +type EventGatewayUnstaked struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *EventGatewayUnstaked) Reset() { *m = EventGatewayUnstaked{} } +func (m *EventGatewayUnstaked) String() string { return proto.CompactTextString(m) } +func (*EventGatewayUnstaked) ProtoMessage() {} +func (*EventGatewayUnstaked) Descriptor() ([]byte, []int) { + return fileDescriptor_34212b93ec812e7c, []int{0} +} +func (m *EventGatewayUnstaked) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventGatewayUnstaked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventGatewayUnstaked) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventGatewayUnstaked.Merge(m, src) +} +func (m *EventGatewayUnstaked) XXX_Size() int { + return m.Size() +} +func (m *EventGatewayUnstaked) XXX_DiscardUnknown() { + xxx_messageInfo_EventGatewayUnstaked.DiscardUnknown(m) +} + +var xxx_messageInfo_EventGatewayUnstaked proto.InternalMessageInfo + +func (m *EventGatewayUnstaked) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*EventGatewayUnstaked)(nil), "poktroll.gateway.EventGatewayUnstaked") +} + +func init() { proto.RegisterFile("poktroll/gateway/event.proto", fileDescriptor_34212b93ec812e7c) } + +var fileDescriptor_34212b93ec812e7c = []byte{ + // 215 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x4f, 0x2d, 0x4b, + 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xea, 0x41, 0x65, 0xa5, + 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0xf2, 0xfa, 0x10, 0x0e, 0x44, 0xb1, 0x94, + 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x44, 0x1c, 0xc4, 0x82, 0x88, 0x2a, 0x79, 0x71, 0x89, 0xb8, 0x82, + 0x4c, 0x74, 0x87, 0x18, 0x10, 0x9a, 0x57, 0x5c, 0x92, 0x98, 0x9d, 0x9a, 0x22, 0x64, 0xc4, 0xc5, + 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, + 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x40, 0x47, 0x88, 0x4c, 0x70, 0x49, 0x51, 0x66, 0x5e, 0x7a, 0x10, + 0x4c, 0xa1, 0x93, 0xdf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, 0x24, 0xc7, + 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, + 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x72, + 0xb7, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xdc, 0x8b, 0x15, 0x70, 0x4f, 0x96, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x8f, + 0xf3, 0xab, 0x98, 0x05, 0x01, 0x00, 0x00, +} + +func (m *EventGatewayUnstaked) 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 *EventGatewayUnstaked) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventGatewayUnstaked) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventGatewayUnstaked) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventGatewayUnstaked) 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 ErrIntOverflowEvent + } + 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: EventGatewayUnstaked: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventGatewayUnstaked: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/genesis.pb.go b/x/gateway/types/genesis.pb.go new file mode 100644 index 000000000..73c4e72c9 --- /dev/null +++ b/x/gateway/types/genesis.pb.go @@ -0,0 +1,385 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the gateway module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + GatewayList []Gateway `protobuf:"bytes,2,rep,name=gateway_list,json=gatewayList,proto3" json:"gateway_list"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_df7fba938e36955d, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetGatewayList() []Gateway { + if m != nil { + return m.GatewayList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.gateway.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/gateway/genesis.proto", fileDescriptor_df7fba938e36955d) } + +var fileDescriptor_df7fba938e36955d = []byte{ + // 259 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x4f, 0x4f, 0xcd, + 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, + 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, + 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, + 0xcc, 0x85, 0x9a, 0x2c, 0x25, 0x83, 0x21, 0x5d, 0x52, 0x59, 0x90, 0x0a, 0x95, 0x55, 0xea, 0x67, + 0xe4, 0xe2, 0x71, 0x87, 0xb8, 0x24, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x9a, 0x8b, 0x0d, 0xa2, + 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x42, 0x0f, 0xdd, 0x65, 0x7a, 0x01, 0x60, 0x79, + 0x27, 0xce, 0x13, 0xf7, 0xe4, 0x19, 0x56, 0x3c, 0xdf, 0xa0, 0xc5, 0x18, 0x04, 0xd5, 0x22, 0xe4, + 0xc4, 0xc5, 0x03, 0x55, 0x14, 0x9f, 0x93, 0x59, 0x5c, 0x22, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x6d, + 0x24, 0x89, 0x69, 0x84, 0x3b, 0x84, 0x76, 0x62, 0x01, 0x99, 0x11, 0xc4, 0x0d, 0x15, 0xf6, 0xc9, + 0x2c, 0x2e, 0x71, 0xf2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, + 0xa6, 0xea, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x7d, 0x59, 0x81, 0xea, 0xcf, + 0x24, 0x36, 0xb0, 0x47, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x2b, 0x21, 0x5c, 0x82, + 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GatewayList) > 0 { + for iNdEx := len(m.GatewayList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GatewayList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.GatewayList) > 0 { + for _, e := range m.GatewayList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GatewayList", 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.GatewayList = append(m.GatewayList, Gateway{}) + if err := m.GatewayList[len(m.GatewayList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/params.pb.go b/x/gateway/types/params.pb.go new file mode 100644 index 000000000..ceb9f5ead --- /dev/null +++ b/x/gateway/types/params.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_23ed52a392489486, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.gateway.Params") +} + +func init() { proto.RegisterFile("poktroll/gateway/params.proto", fileDescriptor_23ed52a392489486) } + +var fileDescriptor_23ed52a392489486 = []byte{ + // 180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, + 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, + 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb8, 0xd8, 0x02, 0xc0, 0x46, 0x59, + 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xb2, 0x0a, 0xb8, 0x75, + 0x10, 0x35, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, + 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, + 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, + 0x0c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x2c, 0x06, 0x96, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xe9, 0x34, 0xfe, + 0xe0, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/query.pb.go b/x/gateway/types/query.pb.go new file mode 100644 index 000000000..79c6ebb53 --- /dev/null +++ b/x/gateway/types/query.pb.go @@ -0,0 +1,1367 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetGatewayRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetGatewayRequest) Reset() { *m = QueryGetGatewayRequest{} } +func (m *QueryGetGatewayRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetGatewayRequest) ProtoMessage() {} +func (*QueryGetGatewayRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{2} +} +func (m *QueryGetGatewayRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetGatewayRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetGatewayRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetGatewayRequest.Merge(m, src) +} +func (m *QueryGetGatewayRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetGatewayRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetGatewayRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetGatewayRequest proto.InternalMessageInfo + +func (m *QueryGetGatewayRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetGatewayResponse struct { + Gateway Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway"` +} + +func (m *QueryGetGatewayResponse) Reset() { *m = QueryGetGatewayResponse{} } +func (m *QueryGetGatewayResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetGatewayResponse) ProtoMessage() {} +func (*QueryGetGatewayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{3} +} +func (m *QueryGetGatewayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetGatewayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetGatewayResponse.Merge(m, src) +} +func (m *QueryGetGatewayResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetGatewayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetGatewayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetGatewayResponse proto.InternalMessageInfo + +func (m *QueryGetGatewayResponse) GetGateway() Gateway { + if m != nil { + return m.Gateway + } + return Gateway{} +} + +type QueryAllGatewaysRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllGatewaysRequest) Reset() { *m = QueryAllGatewaysRequest{} } +func (m *QueryAllGatewaysRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllGatewaysRequest) ProtoMessage() {} +func (*QueryAllGatewaysRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{4} +} +func (m *QueryAllGatewaysRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllGatewaysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllGatewaysRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllGatewaysRequest.Merge(m, src) +} +func (m *QueryAllGatewaysRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllGatewaysRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllGatewaysRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllGatewaysRequest proto.InternalMessageInfo + +func (m *QueryAllGatewaysRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllGatewaysResponse struct { + Gateways []Gateway `protobuf:"bytes,1,rep,name=gateways,proto3" json:"gateways"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllGatewaysResponse) Reset() { *m = QueryAllGatewaysResponse{} } +func (m *QueryAllGatewaysResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllGatewaysResponse) ProtoMessage() {} +func (*QueryAllGatewaysResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_60df9a8709a45d29, []int{5} +} +func (m *QueryAllGatewaysResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllGatewaysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllGatewaysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllGatewaysResponse.Merge(m, src) +} +func (m *QueryAllGatewaysResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllGatewaysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllGatewaysResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllGatewaysResponse proto.InternalMessageInfo + +func (m *QueryAllGatewaysResponse) GetGateways() []Gateway { + if m != nil { + return m.Gateways + } + return nil +} + +func (m *QueryAllGatewaysResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.gateway.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.gateway.QueryParamsResponse") + proto.RegisterType((*QueryGetGatewayRequest)(nil), "poktroll.gateway.QueryGetGatewayRequest") + proto.RegisterType((*QueryGetGatewayResponse)(nil), "poktroll.gateway.QueryGetGatewayResponse") + proto.RegisterType((*QueryAllGatewaysRequest)(nil), "poktroll.gateway.QueryAllGatewaysRequest") + proto.RegisterType((*QueryAllGatewaysResponse)(nil), "poktroll.gateway.QueryAllGatewaysResponse") +} + +func init() { proto.RegisterFile("poktroll/gateway/query.proto", fileDescriptor_60df9a8709a45d29) } + +var fileDescriptor_60df9a8709a45d29 = []byte{ + // 539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0xe3, 0x16, 0x12, 0xea, 0x2e, 0x60, 0x2a, 0x48, 0x4f, 0xe5, 0x40, 0x27, 0xda, 0x86, + 0x48, 0xb5, 0xdb, 0xb0, 0x80, 0x98, 0xc8, 0x40, 0x36, 0x54, 0x4e, 0x4c, 0x2c, 0xc8, 0x49, 0xad, + 0xe3, 0xd4, 0xcb, 0xf9, 0x7a, 0xe7, 0x50, 0x22, 0xc4, 0x82, 0xf8, 0x00, 0x48, 0x30, 0x30, 0x32, + 0x32, 0xf2, 0x11, 0x18, 0x3b, 0x56, 0x62, 0xe9, 0x84, 0x50, 0x82, 0xc4, 0xd7, 0x40, 0x67, 0x3f, + 0x97, 0xa4, 0x56, 0x94, 0x2c, 0x6d, 0xec, 0xf7, 0x7f, 0xef, 0xff, 0x7b, 0x7e, 0x4f, 0x87, 0x37, + 0x32, 0x79, 0xa8, 0x72, 0x99, 0x24, 0x2c, 0xe2, 0x4a, 0x1c, 0xf3, 0x21, 0x3b, 0x1a, 0x88, 0x7c, + 0x48, 0xb3, 0x5c, 0x2a, 0x49, 0xae, 0xda, 0x28, 0x85, 0xa8, 0x77, 0x8d, 0xf7, 0xe3, 0x54, 0x32, + 0xfd, 0xd7, 0x88, 0xbc, 0xf5, 0x9e, 0x2c, 0xfa, 0xb2, 0x78, 0xa9, 0x4f, 0xcc, 0x1c, 0x20, 0xb4, + 0x16, 0xc9, 0x48, 0x9a, 0xfb, 0xf2, 0x17, 0xdc, 0x6e, 0x44, 0x52, 0x46, 0x89, 0x60, 0x3c, 0x8b, + 0x19, 0x4f, 0x53, 0xa9, 0xb8, 0x8a, 0x65, 0x6a, 0x73, 0x9a, 0xa6, 0x02, 0xeb, 0xf2, 0x42, 0x18, + 0x18, 0xf6, 0x7a, 0xaf, 0x2b, 0x14, 0xdf, 0x63, 0x19, 0x8f, 0xe2, 0x54, 0x8b, 0x41, 0xeb, 0x4f, + 0x6a, 0xad, 0xaa, 0x27, 0x63, 0x1b, 0xbf, 0xe5, 0x74, 0x97, 0xf1, 0x9c, 0xf7, 0xad, 0x95, 0xdb, + 0xbc, 0x1a, 0x66, 0x02, 0xa2, 0xc1, 0x1a, 0x26, 0xcf, 0x4a, 0xfb, 0x7d, 0x9d, 0x12, 0x8a, 0xa3, + 0x81, 0x28, 0x54, 0x10, 0xe2, 0xeb, 0x53, 0xb7, 0x45, 0x26, 0xd3, 0x42, 0x90, 0x47, 0xb8, 0x6a, + 0x4a, 0xd7, 0xd1, 0x1d, 0xd4, 0x58, 0x6d, 0xd5, 0xe9, 0xc5, 0xa7, 0xa3, 0x26, 0xa3, 0xbd, 0x72, + 0xf2, 0xeb, 0x76, 0xe5, 0xdb, 0xdf, 0xef, 0x4d, 0x14, 0x42, 0x4a, 0xd0, 0xc2, 0x37, 0x74, 0xcd, + 0x8e, 0x50, 0x1d, 0x23, 0x06, 0x37, 0x52, 0xc7, 0x35, 0x7e, 0x70, 0x90, 0x8b, 0xc2, 0xd4, 0x5d, + 0x09, 0xed, 0x31, 0x78, 0x8e, 0x6f, 0x3a, 0x39, 0xc0, 0xf2, 0x10, 0xd7, 0xc0, 0x13, 0x60, 0xd6, + 0x5d, 0x18, 0xc8, 0x69, 0x5f, 0x2a, 0x69, 0x42, 0xab, 0x0f, 0x38, 0x54, 0x7d, 0x9c, 0x24, 0xa0, + 0xb0, 0x8d, 0x93, 0x27, 0x18, 0xff, 0x7f, 0x7f, 0x28, 0xbc, 0x45, 0x61, 0xdc, 0xe5, 0x00, 0xa8, + 0xd9, 0x1c, 0x18, 0x03, 0xdd, 0xe7, 0x91, 0x80, 0xdc, 0x70, 0x22, 0x33, 0xf8, 0x8a, 0x70, 0xdd, + 0xf5, 0x38, 0x7f, 0xc6, 0x2b, 0x80, 0x52, 0x36, 0xbc, 0xbc, 0x08, 0xfb, 0x79, 0x02, 0xe9, 0x4c, + 0x11, 0x2e, 0x69, 0xc2, 0xed, 0xb9, 0x84, 0xc6, 0x79, 0x12, 0xb1, 0xf5, 0x63, 0x19, 0x5f, 0xd6, + 0x88, 0xe4, 0x03, 0xc2, 0x55, 0x33, 0x37, 0x72, 0xd7, 0x05, 0x71, 0xd7, 0xc3, 0xdb, 0x9c, 0xa3, + 0x32, 0x6e, 0xc1, 0xce, 0xfb, 0x9f, 0x7f, 0x3e, 0x2d, 0x6d, 0x93, 0x4d, 0x56, 0xca, 0x77, 0x52, + 0xa1, 0x8e, 0x65, 0x7e, 0xc8, 0x66, 0xac, 0x2b, 0xf9, 0x82, 0x70, 0x0d, 0xba, 0x26, 0x8d, 0x19, + 0x0e, 0xce, 0xf2, 0x78, 0xf7, 0x16, 0x50, 0x02, 0xcf, 0x03, 0xcd, 0xd3, 0x22, 0xbb, 0x73, 0x78, + 0xec, 0xff, 0xb7, 0xb0, 0x86, 0xef, 0xc8, 0x67, 0x84, 0x57, 0x27, 0x26, 0x49, 0x66, 0x99, 0xba, + 0x1b, 0xe5, 0x35, 0x17, 0x91, 0x02, 0x20, 0xd5, 0x80, 0x0d, 0xb2, 0xb5, 0x18, 0x60, 0xfb, 0xe9, + 0xc9, 0xc8, 0x47, 0xa7, 0x23, 0x1f, 0x9d, 0x8d, 0x7c, 0xf4, 0x7b, 0xe4, 0xa3, 0x8f, 0x63, 0xbf, + 0x72, 0x3a, 0xf6, 0x2b, 0x67, 0x63, 0xbf, 0xf2, 0x62, 0x37, 0x8a, 0xd5, 0xab, 0x41, 0x97, 0xf6, + 0x64, 0x7f, 0x46, 0xbd, 0x37, 0xd3, 0x9f, 0x84, 0x6e, 0x55, 0x7f, 0x13, 0xee, 0xff, 0x0b, 0x00, + 0x00, 0xff, 0xff, 0xaa, 0x8d, 0xbf, 0xd7, 0x30, 0x05, 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 Gateway items. + Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) + AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.gateway.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Gateway(ctx context.Context, in *QueryGetGatewayRequest, opts ...grpc.CallOption) (*QueryGetGatewayResponse, error) { + out := new(QueryGetGatewayResponse) + err := c.cc.Invoke(ctx, "/poktroll.gateway.Query/Gateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllGateways(ctx context.Context, in *QueryAllGatewaysRequest, opts ...grpc.CallOption) (*QueryAllGatewaysResponse, error) { + out := new(QueryAllGatewaysResponse) + err := c.cc.Invoke(ctx, "/poktroll.gateway.Query/AllGateways", in, out, opts...) + 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 Gateway items. + Gateway(context.Context, *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) + AllGateways(context.Context, *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, 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) Gateway(ctx context.Context, req *QueryGetGatewayRequest) (*QueryGetGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Gateway not implemented") +} +func (*UnimplementedQueryServer) AllGateways(ctx context.Context, req *QueryAllGatewaysRequest) (*QueryAllGatewaysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllGateways not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.gateway.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 _Query_Gateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetGatewayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Gateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.gateway.Query/Gateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Gateway(ctx, req.(*QueryGetGatewayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllGatewaysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllGateways(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.gateway.Query/AllGateways", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllGateways(ctx, req.(*QueryAllGatewaysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.gateway.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Gateway", + Handler: _Query_Gateway_Handler, + }, + { + MethodName: "AllGateways", + Handler: _Query_AllGateways_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/gateway/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetGatewayRequest) 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 *QueryGetGatewayRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetGatewayRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 len(dAtA) - i, nil +} + +func (m *QueryGetGatewayResponse) 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 *QueryGetGatewayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Gateway.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 *QueryAllGatewaysRequest) 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 *QueryAllGatewaysRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllGatewaysRequest) 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 *QueryAllGatewaysResponse) 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 *QueryAllGatewaysResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllGatewaysResponse) 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.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Gateways[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 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 *QueryGetGatewayRequest) 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)) + } + return n +} + +func (m *QueryGetGatewayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Gateway.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllGatewaysRequest) 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 *QueryAllGatewaysResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Gateways) > 0 { + for _, e := range m.Gateways { + 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 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 *QueryGetGatewayRequest) 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: QueryGetGatewayRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetGatewayRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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 *QueryGetGatewayResponse) 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: QueryGetGatewayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateway", 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.Gateway.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 *QueryAllGatewaysRequest) 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: QueryAllGatewaysRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllGatewaysRequest: 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 + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllGatewaysResponse) 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: QueryAllGatewaysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllGatewaysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateways", 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.Gateways = append(m.Gateways, Gateway{}) + if err := m.Gateways[len(m.Gateways)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/query.pb.gw.go b/x/gateway/types/query.pb.gw.go new file mode 100644 index 000000000..ddabb8637 --- /dev/null +++ b/x/gateway/types/query.pb.gw.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/gateway/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Gateway_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetGatewayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.Gateway(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Gateway_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetGatewayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.Gateway(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllGateways_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllGateways_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllGatewaysRequest + 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_AllGateways_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllGateways(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllGateways_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllGatewaysRequest + 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_AllGateways_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllGateways(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Gateway_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_Gateway_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_Gateway_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllGateways_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_AllGateways_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_AllGateways_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Gateway_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_Gateway_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_Gateway_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllGateways_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_AllGateways_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_AllGateways_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "gateway", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Gateway_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "gateway", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllGateways_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "gateway"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Gateway_0 = runtime.ForwardResponseMessage + + forward_Query_AllGateways_0 = runtime.ForwardResponseMessage +) diff --git a/x/gateway/types/tx.pb.go b/x/gateway/types/tx.pb.go new file mode 100644 index 000000000..1ed9ad63d --- /dev/null +++ b/x/gateway/types/tx.pb.go @@ -0,0 +1,1293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/gateway parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +type MsgStakeGateway struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` +} + +func (m *MsgStakeGateway) Reset() { *m = MsgStakeGateway{} } +func (m *MsgStakeGateway) String() string { return proto.CompactTextString(m) } +func (*MsgStakeGateway) ProtoMessage() {} +func (*MsgStakeGateway) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{2} +} +func (m *MsgStakeGateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeGateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeGateway.Merge(m, src) +} +func (m *MsgStakeGateway) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeGateway) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeGateway.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeGateway proto.InternalMessageInfo + +func (m *MsgStakeGateway) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgStakeGateway) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +type MsgStakeGatewayResponse struct { +} + +func (m *MsgStakeGatewayResponse) Reset() { *m = MsgStakeGatewayResponse{} } +func (m *MsgStakeGatewayResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStakeGatewayResponse) ProtoMessage() {} +func (*MsgStakeGatewayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{3} +} +func (m *MsgStakeGatewayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeGatewayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeGatewayResponse.Merge(m, src) +} +func (m *MsgStakeGatewayResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeGatewayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeGatewayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeGatewayResponse proto.InternalMessageInfo + +type MsgUnstakeGateway struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUnstakeGateway) Reset() { *m = MsgUnstakeGateway{} } +func (m *MsgUnstakeGateway) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeGateway) ProtoMessage() {} +func (*MsgUnstakeGateway) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{4} +} +func (m *MsgUnstakeGateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeGateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeGateway.Merge(m, src) +} +func (m *MsgUnstakeGateway) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeGateway) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeGateway.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeGateway proto.InternalMessageInfo + +func (m *MsgUnstakeGateway) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUnstakeGatewayResponse struct { +} + +func (m *MsgUnstakeGatewayResponse) Reset() { *m = MsgUnstakeGatewayResponse{} } +func (m *MsgUnstakeGatewayResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeGatewayResponse) ProtoMessage() {} +func (*MsgUnstakeGatewayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7ad4b0c5e3b59f23, []int{5} +} +func (m *MsgUnstakeGatewayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeGatewayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeGatewayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeGatewayResponse.Merge(m, src) +} +func (m *MsgUnstakeGatewayResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeGatewayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeGatewayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeGatewayResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.gateway.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.gateway.MsgUpdateParamsResponse") + proto.RegisterType((*MsgStakeGateway)(nil), "poktroll.gateway.MsgStakeGateway") + proto.RegisterType((*MsgStakeGatewayResponse)(nil), "poktroll.gateway.MsgStakeGatewayResponse") + proto.RegisterType((*MsgUnstakeGateway)(nil), "poktroll.gateway.MsgUnstakeGateway") + proto.RegisterType((*MsgUnstakeGatewayResponse)(nil), "poktroll.gateway.MsgUnstakeGatewayResponse") +} + +func init() { proto.RegisterFile("poktroll/gateway/tx.proto", fileDescriptor_7ad4b0c5e3b59f23) } + +var fileDescriptor_7ad4b0c5e3b59f23 = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0x15, 0xb5, 0x28, 0x47, 0x05, 0xd4, 0xaa, 0xd4, 0xd8, 0x88, 0xa3, 0x84, 0xa5, 0x04, + 0xf5, 0x8e, 0x04, 0xc1, 0x50, 0x26, 0xc2, 0xc0, 0x54, 0x84, 0x5c, 0x75, 0x41, 0x48, 0xe8, 0x9c, + 0x9c, 0xae, 0x56, 0x6a, 0x9f, 0xe5, 0xbb, 0xfe, 0xc8, 0x86, 0x10, 0x13, 0x13, 0x7f, 0x06, 0x03, + 0x43, 0x06, 0x56, 0xf6, 0x8e, 0x15, 0x53, 0x27, 0x84, 0x9c, 0x21, 0xff, 0x06, 0x3a, 0xdf, 0x39, + 0x6d, 0x1c, 0xa3, 0x20, 0xb1, 0xd8, 0xbe, 0x7b, 0xef, 0x7b, 0xdf, 0xfb, 0xde, 0x9d, 0xa1, 0x9b, + 0x88, 0x81, 0x4a, 0xc5, 0xe1, 0x21, 0xe1, 0x54, 0xb1, 0x13, 0x3a, 0x24, 0xea, 0x14, 0x27, 0xa9, + 0x50, 0xc2, 0xb9, 0x5d, 0x40, 0xd8, 0x42, 0xde, 0x1a, 0x8d, 0xc2, 0x58, 0x90, 0xfc, 0x69, 0x48, + 0xde, 0x46, 0x4f, 0xc8, 0x48, 0x48, 0x12, 0x49, 0x4e, 0x8e, 0xdb, 0xfa, 0x65, 0x01, 0xd7, 0x00, + 0xef, 0xf3, 0x15, 0x31, 0x0b, 0x0b, 0xad, 0x73, 0xc1, 0x85, 0xd9, 0xd7, 0x5f, 0x76, 0x17, 0x59, + 0xa5, 0x80, 0x4a, 0x46, 0x8e, 0xdb, 0x01, 0x53, 0xb4, 0x4d, 0x7a, 0x22, 0x8c, 0x2d, 0x7e, 0x77, + 0xce, 0x69, 0x42, 0x53, 0x1a, 0x59, 0xd1, 0xe6, 0x0f, 0x00, 0x6f, 0xed, 0x4a, 0xbe, 0x9f, 0xf4, + 0xa9, 0x62, 0x6f, 0x72, 0xc4, 0x79, 0x06, 0xeb, 0xf4, 0x48, 0x1d, 0x88, 0x34, 0x54, 0xc3, 0x06, + 0xd8, 0x04, 0x5b, 0xf5, 0x6e, 0xe3, 0xe7, 0xf7, 0xed, 0x75, 0xeb, 0xe6, 0x45, 0xbf, 0x9f, 0x32, + 0x29, 0xf7, 0x54, 0x1a, 0xc6, 0xdc, 0xbf, 0xa4, 0x3a, 0xcf, 0xe1, 0x8a, 0xd1, 0x6e, 0x2c, 0x6d, + 0x82, 0xad, 0x1b, 0x9d, 0x06, 0x2e, 0x47, 0x81, 0x4d, 0x87, 0x6e, 0xfd, 0xec, 0xd7, 0xbd, 0xda, + 0xd7, 0xc9, 0xa8, 0x05, 0x7c, 0x5b, 0xb2, 0xf3, 0xf4, 0xe3, 0x64, 0xd4, 0xba, 0x14, 0xfb, 0x3c, + 0x19, 0xb5, 0x9a, 0x53, 0xeb, 0xa7, 0x53, 0xf3, 0x25, 0xaf, 0x4d, 0x17, 0x6e, 0x94, 0xb6, 0x7c, + 0x26, 0x13, 0x11, 0x4b, 0xd6, 0xfc, 0x64, 0x46, 0xdb, 0x53, 0x74, 0xc0, 0x5e, 0x99, 0x72, 0xa7, + 0x03, 0xaf, 0x53, 0x63, 0x7f, 0xe1, 0x60, 0x05, 0xd1, 0x21, 0x70, 0x59, 0x6a, 0x0d, 0x3b, 0x95, + 0x8b, 0x2d, 0x5d, 0x27, 0x8e, 0x6d, 0xe2, 0xf8, 0xa5, 0x08, 0x63, 0xdf, 0xf0, 0x76, 0x56, 0xf5, + 0x28, 0x45, 0xb9, 0x75, 0x78, 0xd5, 0xc5, 0xd4, 0xe1, 0x3e, 0x5c, 0xd3, 0xe6, 0x63, 0xf9, 0x9f, + 0x16, 0x4b, 0x1d, 0xef, 0x40, 0x77, 0x4e, 0xb6, 0xe8, 0xd9, 0xf9, 0xb6, 0x04, 0xaf, 0xed, 0x4a, + 0xee, 0xbc, 0x83, 0xab, 0x33, 0x87, 0x7e, 0x7f, 0xfe, 0xb0, 0x4a, 0xc1, 0x7a, 0x0f, 0x17, 0x52, + 0x8a, 0x2e, 0x5a, 0x7d, 0x26, 0xf7, 0x6a, 0xf5, 0xab, 0x94, 0xbf, 0xa8, 0x57, 0xe5, 0xe6, 0x04, + 0xf0, 0x66, 0x29, 0xb4, 0x07, 0xd5, 0xd6, 0x66, 0x48, 0xde, 0xa3, 0x7f, 0x20, 0x15, 0x3d, 0xbc, + 0xe5, 0x0f, 0xfa, 0x7a, 0x76, 0x5f, 0x9f, 0x65, 0x08, 0x9c, 0x67, 0x08, 0x5c, 0x64, 0x08, 0xfc, + 0xce, 0x10, 0xf8, 0x32, 0x46, 0xb5, 0xf3, 0x31, 0xaa, 0x5d, 0x8c, 0x51, 0xed, 0xed, 0x63, 0x1e, + 0xaa, 0x83, 0xa3, 0x00, 0xf7, 0x44, 0x44, 0xb4, 0xf6, 0x76, 0xcc, 0xd4, 0x89, 0x48, 0x07, 0xa4, + 0xe2, 0xe6, 0xaa, 0x61, 0xc2, 0x64, 0xb0, 0x92, 0xff, 0x76, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, + 0xff, 0xe9, 0x90, 0xe7, 0x8f, 0x41, 0x04, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) + UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeGateway(ctx context.Context, in *MsgStakeGateway, opts ...grpc.CallOption) (*MsgStakeGatewayResponse, error) { + out := new(MsgStakeGatewayResponse) + err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/StakeGateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeGateway(ctx context.Context, in *MsgUnstakeGateway, opts ...grpc.CallOption) (*MsgUnstakeGatewayResponse, error) { + out := new(MsgUnstakeGatewayResponse) + err := c.cc.Invoke(ctx, "/poktroll.gateway.Msg/UnstakeGateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeGateway(context.Context, *MsgStakeGateway) (*MsgStakeGatewayResponse, error) + UnstakeGateway(context.Context, *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) StakeGateway(ctx context.Context, req *MsgStakeGateway) (*MsgStakeGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeGateway not implemented") +} +func (*UnimplementedMsgServer) UnstakeGateway(ctx context.Context, req *MsgUnstakeGateway) (*MsgUnstakeGatewayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeGateway not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.gateway.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.gateway.Msg/StakeGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeGateway(ctx, req.(*MsgStakeGateway)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeGateway) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.gateway.Msg/UnstakeGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeGateway(ctx, req.(*MsgUnstakeGateway)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.gateway.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeGateway", + Handler: _Msg_StakeGateway_Handler, + }, + { + MethodName: "UnstakeGateway", + Handler: _Msg_UnstakeGateway_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/gateway/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgStakeGateway) 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 *MsgStakeGateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStakeGatewayResponse) 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 *MsgStakeGatewayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeGateway) 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 *MsgUnstakeGateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeGatewayResponse) 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 *MsgUnstakeGatewayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgStakeGateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgStakeGatewayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUnstakeGateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnstakeGatewayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeGateway) 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 ErrIntOverflowTx + } + 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: MsgStakeGateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeGateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeGatewayResponse) 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 ErrIntOverflowTx + } + 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: MsgStakeGatewayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeGateway) 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 ErrIntOverflowTx + } + 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: MsgUnstakeGateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeGateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeGatewayResponse) 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 ErrIntOverflowTx + } + 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: MsgUnstakeGatewayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gateway/types/types.pb.go b/x/gateway/types/types.pb.go new file mode 100644 index 000000000..f91d243f3 --- /dev/null +++ b/x/gateway/types/types.pb.go @@ -0,0 +1,379 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/gateway/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +type Gateway struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` +} + +func (m *Gateway) Reset() { *m = Gateway{} } +func (m *Gateway) String() string { return proto.CompactTextString(m) } +func (*Gateway) ProtoMessage() {} +func (*Gateway) Descriptor() ([]byte, []int) { + return fileDescriptor_8e457ba71add809d, []int{0} +} +func (m *Gateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Gateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Gateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_Gateway.Merge(m, src) +} +func (m *Gateway) XXX_Size() int { + return m.Size() +} +func (m *Gateway) XXX_DiscardUnknown() { + xxx_messageInfo_Gateway.DiscardUnknown(m) +} + +var xxx_messageInfo_Gateway proto.InternalMessageInfo + +func (m *Gateway) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Gateway) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +func init() { + proto.RegisterType((*Gateway)(nil), "poktroll.gateway.Gateway") +} + +func init() { proto.RegisterFile("poktroll/gateway/types.proto", fileDescriptor_8e457ba71add809d) } + +var fileDescriptor_8e457ba71add809d = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0xd4, 0x2f, 0xa9, 0x2c, + 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xea, 0x41, 0x65, 0xa5, + 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0xf2, 0xfa, 0x10, 0x0e, 0x44, 0xb1, 0x94, + 0x1c, 0x84, 0xa7, 0x9f, 0x94, 0x58, 0x9c, 0xaa, 0x5f, 0x66, 0x98, 0x94, 0x5a, 0x92, 0x68, 0xa8, + 0x9f, 0x9c, 0x9f, 0x99, 0x07, 0x95, 0x17, 0x49, 0xcf, 0x4f, 0xcf, 0x87, 0xe8, 0x03, 0xb1, 0x20, + 0xa2, 0x4a, 0x79, 0x5c, 0xec, 0xee, 0x10, 0xb3, 0x85, 0x8c, 0xb8, 0xd8, 0x13, 0x53, 0x52, 0x8a, + 0x52, 0x8b, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, + 0xda, 0xe1, 0x08, 0x91, 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x82, 0x29, 0x14, 0xd2, 0xe7, + 0x62, 0x2d, 0x2e, 0x49, 0xcc, 0x4e, 0x95, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd4, 0x83, + 0x2a, 0x07, 0x39, 0x42, 0x0f, 0xea, 0x08, 0x3d, 0xe7, 0xfc, 0xcc, 0xbc, 0x20, 0x88, 0x3a, 0x27, + 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0xbc, 0xf1, 0x48, 0x8e, 0xf1, 0xc1, 0x23, + 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, + 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe4, 0x77, 0xdd, 0xbc, + 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x78, 0x30, 0x55, 0xa0, 0x06, 0x54, 0x12, 0x1b, 0xd8, + 0x1b, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x4f, 0xc7, 0x17, 0x49, 0x01, 0x00, 0x00, +} + +func (m *Gateway) 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 *Gateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Gateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Gateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Gateway) 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 ErrIntOverflowTypes + } + 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: Gateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Gateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/event.pb.go b/x/proof/types/event.pb.go new file mode 100644 index 000000000..2ef856138 --- /dev/null +++ b/x/proof/types/event.pb.go @@ -0,0 +1,1259 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +type EventClaimCreated struct { + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` +} + +func (m *EventClaimCreated) Reset() { *m = EventClaimCreated{} } +func (m *EventClaimCreated) String() string { return proto.CompactTextString(m) } +func (*EventClaimCreated) ProtoMessage() {} +func (*EventClaimCreated) Descriptor() ([]byte, []int) { + return fileDescriptor_dd4c19e04487fbec, []int{0} +} +func (m *EventClaimCreated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventClaimCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventClaimCreated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventClaimCreated.Merge(m, src) +} +func (m *EventClaimCreated) XXX_Size() int { + return m.Size() +} +func (m *EventClaimCreated) XXX_DiscardUnknown() { + xxx_messageInfo_EventClaimCreated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventClaimCreated proto.InternalMessageInfo + +func (m *EventClaimCreated) GetClaim() *Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventClaimCreated) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventClaimCreated) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +// TODO_TEST: Add coverage for claim updates. +type EventClaimUpdated struct { + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` +} + +func (m *EventClaimUpdated) Reset() { *m = EventClaimUpdated{} } +func (m *EventClaimUpdated) String() string { return proto.CompactTextString(m) } +func (*EventClaimUpdated) ProtoMessage() {} +func (*EventClaimUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_dd4c19e04487fbec, []int{1} +} +func (m *EventClaimUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventClaimUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventClaimUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventClaimUpdated.Merge(m, src) +} +func (m *EventClaimUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventClaimUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventClaimUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventClaimUpdated proto.InternalMessageInfo + +func (m *EventClaimUpdated) GetClaim() *Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventClaimUpdated) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventClaimUpdated) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +type EventProofSubmitted struct { + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` +} + +func (m *EventProofSubmitted) Reset() { *m = EventProofSubmitted{} } +func (m *EventProofSubmitted) String() string { return proto.CompactTextString(m) } +func (*EventProofSubmitted) ProtoMessage() {} +func (*EventProofSubmitted) Descriptor() ([]byte, []int) { + return fileDescriptor_dd4c19e04487fbec, []int{2} +} +func (m *EventProofSubmitted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventProofSubmitted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventProofSubmitted) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventProofSubmitted.Merge(m, src) +} +func (m *EventProofSubmitted) XXX_Size() int { + return m.Size() +} +func (m *EventProofSubmitted) XXX_DiscardUnknown() { + xxx_messageInfo_EventProofSubmitted.DiscardUnknown(m) +} + +var xxx_messageInfo_EventProofSubmitted proto.InternalMessageInfo + +func (m *EventProofSubmitted) GetClaim() *Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventProofSubmitted) GetProof() *Proof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *EventProofSubmitted) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventProofSubmitted) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +// TODO_TEST: Add coverage for proof updates. +type EventProofUpdated struct { + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` +} + +func (m *EventProofUpdated) Reset() { *m = EventProofUpdated{} } +func (m *EventProofUpdated) String() string { return proto.CompactTextString(m) } +func (*EventProofUpdated) ProtoMessage() {} +func (*EventProofUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_dd4c19e04487fbec, []int{3} +} +func (m *EventProofUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventProofUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventProofUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventProofUpdated.Merge(m, src) +} +func (m *EventProofUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventProofUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventProofUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventProofUpdated proto.InternalMessageInfo + +func (m *EventProofUpdated) GetClaim() *Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventProofUpdated) GetProof() *Proof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *EventProofUpdated) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventProofUpdated) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +func init() { + proto.RegisterType((*EventClaimCreated)(nil), "poktroll.proof.EventClaimCreated") + proto.RegisterType((*EventClaimUpdated)(nil), "poktroll.proof.EventClaimUpdated") + proto.RegisterType((*EventProofSubmitted)(nil), "poktroll.proof.EventProofSubmitted") + proto.RegisterType((*EventProofUpdated)(nil), "poktroll.proof.EventProofUpdated") +} + +func init() { proto.RegisterFile("poktroll/proof/event.proto", fileDescriptor_dd4c19e04487fbec) } + +var fileDescriptor_dd4c19e04487fbec = []byte{ + // 341 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, + 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xe9, 0x81, 0xe5, 0xa4, 0x44, 0xd2, + 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x14, 0xba, 0x09, 0x25, 0x95, 0x05, + 0xa9, 0xc5, 0x10, 0x39, 0xa5, 0xbd, 0x8c, 0x5c, 0x82, 0xae, 0x20, 0x13, 0x9d, 0x73, 0x12, 0x33, + 0x73, 0x9d, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x53, 0x84, 0xcc, 0xb8, 0x58, 0x93, 0x41, 0x7c, 0x09, + 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x54, 0x7b, 0xf4, 0xc0, 0x8a, 0x9d, 0x38, 0x5f, + 0xdd, 0x93, 0x87, 0xa8, 0x0b, 0x82, 0x50, 0x42, 0xba, 0x5c, 0x5c, 0x79, 0xa5, 0xb9, 0xf1, 0x45, + 0xa9, 0x39, 0x89, 0x95, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0x7c, 0xaf, 0xee, 0xc9, + 0x23, 0x89, 0x06, 0x71, 0xe6, 0x95, 0xe6, 0x06, 0x81, 0x99, 0x42, 0x8e, 0x5c, 0x82, 0x20, 0x89, + 0xe4, 0xfc, 0xdc, 0x82, 0xd2, 0x92, 0xd4, 0xf8, 0xd2, 0xbc, 0xcc, 0x92, 0x62, 0x09, 0x66, 0xb0, + 0x2e, 0xd1, 0x57, 0xf7, 0xe4, 0x31, 0x25, 0x83, 0xf8, 0xf3, 0x4a, 0x73, 0x9d, 0x21, 0x22, 0xa1, + 0x20, 0x01, 0x34, 0xf7, 0x87, 0x16, 0xa4, 0x0c, 0x31, 0xf7, 0x7f, 0x67, 0xe4, 0x12, 0x06, 0xbb, + 0x3f, 0x00, 0xe4, 0xb0, 0xe0, 0xd2, 0xa4, 0xdc, 0xcc, 0x12, 0x4a, 0x7c, 0x60, 0xc6, 0xc5, 0x0a, + 0x56, 0x00, 0x76, 0x3c, 0x16, 0x7d, 0x60, 0x6b, 0x20, 0xfa, 0xc0, 0x02, 0x41, 0x10, 0x0a, 0xcd, + 0xe7, 0xcc, 0x64, 0xf9, 0x9c, 0x85, 0x24, 0x9f, 0x7f, 0x85, 0xc5, 0x1c, 0xd8, 0x49, 0x94, 0xc6, + 0xdc, 0x90, 0xf1, 0xb7, 0x93, 0xcf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, + 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, + 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, + 0x0f, 0xf2, 0x82, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0x3c, 0x0f, 0x57, 0x20, + 0xe7, 0xe2, 0x24, 0x36, 0x70, 0x36, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x84, 0x01, + 0x75, 0x26, 0x04, 0x00, 0x00, +} + +func (m *EventClaimCreated) 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 *EventClaimCreated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventClaimCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x18 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x10 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventClaimUpdated) 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 *EventClaimUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventClaimUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x18 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x10 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventProofSubmitted) 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 *EventProofSubmitted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventProofSubmitted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x20 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x18 + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventProofUpdated) 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 *EventProofUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventProofUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x20 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x18 + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventClaimCreated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + return n +} + +func (m *EventClaimUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + return n +} + +func (m *EventProofSubmitted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + return n +} + +func (m *EventProofUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventClaimCreated) 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 ErrIntOverflowEvent + } + 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: EventClaimCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventClaimCreated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventClaimUpdated) 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 ErrIntOverflowEvent + } + 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: EventClaimUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventClaimUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventProofSubmitted) 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 ErrIntOverflowEvent + } + 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: EventProofSubmitted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventProofSubmitted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &Proof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventProofUpdated) 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 ErrIntOverflowEvent + } + 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: EventProofUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventProofUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &Proof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/genesis.pb.go b/x/proof/types/genesis.pb.go new file mode 100644 index 000000000..0b7160a14 --- /dev/null +++ b/x/proof/types/genesis.pb.go @@ -0,0 +1,448 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the proof module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ClaimList []Claim `protobuf:"bytes,2,rep,name=claim_list,json=claimList,proto3" json:"claim_list"` + ProofList []Proof `protobuf:"bytes,3,rep,name=proof_list,json=proofList,proto3" json:"proof_list"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_2da3e253d01f195c, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetClaimList() []Claim { + if m != nil { + return m.ClaimList + } + return nil +} + +func (m *GenesisState) GetProofList() []Proof { + if m != nil { + return m.ProofList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.proof.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/proof/genesis.proto", fileDescriptor_2da3e253d01f195c) } + +var fileDescriptor_2da3e253d01f195c = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, + 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xea, 0x81, 0x65, 0xa5, + 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x48, 0x7a, 0x7e, 0x7a, + 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xa5, 0xd1, 0x8c, 0x2d, 0x48, 0x2c, 0x4a, 0xcc, 0x85, + 0x9a, 0x2a, 0x25, 0x85, 0x26, 0x59, 0x52, 0x59, 0x90, 0x0a, 0x95, 0x53, 0x3a, 0xc8, 0xc8, 0xc5, + 0xe3, 0x0e, 0x71, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x25, 0x17, 0x1b, 0x44, 0xb3, 0x04, + 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x98, 0x1e, 0xaa, 0x9b, 0xf4, 0x02, 0xc0, 0xb2, 0x4e, 0x9c, + 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0x41, 0xc8, 0x8a, 0x8b, + 0x2b, 0x39, 0x27, 0x31, 0x33, 0x37, 0x3e, 0x27, 0xb3, 0xb8, 0x44, 0x82, 0x49, 0x81, 0x59, 0x83, + 0xdb, 0x48, 0x14, 0x5d, 0xbb, 0x33, 0x48, 0x85, 0x13, 0x0b, 0x48, 0x77, 0x10, 0x27, 0x58, 0xb9, + 0x4f, 0x66, 0x71, 0x09, 0x48, 0x2f, 0x58, 0x1e, 0xa2, 0x97, 0x19, 0xbb, 0xde, 0x00, 0x10, 0x09, + 0xd3, 0x0b, 0x16, 0x02, 0xe9, 0x75, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, + 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, + 0x73, 0xf5, 0x41, 0xe6, 0xe9, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x43, 0xa5, + 0x02, 0x39, 0x5c, 0x92, 0xd8, 0xc0, 0x01, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x99, + 0x4c, 0x7b, 0xaa, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProofList) > 0 { + for iNdEx := len(m.ProofList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProofList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.ClaimList) > 0 { + for iNdEx := len(m.ClaimList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClaimList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.ClaimList) > 0 { + for _, e := range m.ClaimList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ProofList) > 0 { + for _, e := range m.ProofList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimList", 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.ClaimList = append(m.ClaimList, Claim{}) + if err := m.ClaimList[len(m.ClaimList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofList", 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.ProofList = append(m.ProofList, Proof{}) + if err := m.ProofList[len(m.ProofList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/params.pb.go b/x/proof/types/params.pb.go new file mode 100644 index 000000000..6302cfa71 --- /dev/null +++ b/x/proof/types/params.pb.go @@ -0,0 +1,599 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/params.proto + +package types + +import ( + bytes "bytes" + encoding_binary "encoding/binary" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { + // TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" + // relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. + RelayDifficultyTargetHash []byte `protobuf:"bytes,1,opt,name=relay_difficulty_target_hash,json=relayDifficultyTargetHash,proto3" json:"relay_difficulty_target_hash"` + // proof_request_probability is the probability of a session requiring a proof + // if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. + ProofRequestProbability float32 `protobuf:"fixed32,2,opt,name=proof_request_probability,json=proofRequestProbability,proto3" json:"proof_request_probability"` + // proof_requirement_threshold is the session cost (i.e. compute unit consumption) + // threshold which asserts that a session MUST have a corresponding proof when its cost + // is equal to or above the threshold. This is in contrast to the this requirement + // being determined probabilistically via ProofRequestProbability. + // + // TODO_MAINNET: Consider renaming this to `proof_requirement_threshold_upokt`. + ProofRequirementThreshold *types.Coin `protobuf:"bytes,3,opt,name=proof_requirement_threshold,json=proofRequirementThreshold,proto3" json:"proof_requirement_threshold"` + // proof_missing_penalty is the number of tokens (uPOKT) which should be slashed from a supplier + // when a proof is required (either via proof_requirement_threshold or proof_missing_penalty) + // but is not provided. + // TODO_MAINNET: Consider renaming this to `proof_missing_penalty_upokt`. + ProofMissingPenalty *types.Coin `protobuf:"bytes,4,opt,name=proof_missing_penalty,json=proofMissingPenalty,proto3" json:"proof_missing_penalty"` + // proof_submission_fee is the number of tokens (uPOKT) which should be paid by + // the supplier operator when submitting a proof. + // This is needed to account for the cost of storing proofs on-chain and prevent + // spamming (i.e. sybil bloat attacks) the network with non-required proofs. + // TODO_MAINNET: Consider renaming this to `proof_submission_fee_upokt`. + ProofSubmissionFee *types.Coin `protobuf:"bytes,5,opt,name=proof_submission_fee,json=proofSubmissionFee,proto3" json:"proof_submission_fee"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_2ad689ad5bf3a2d7, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetRelayDifficultyTargetHash() []byte { + if m != nil { + return m.RelayDifficultyTargetHash + } + return nil +} + +func (m *Params) GetProofRequestProbability() float32 { + if m != nil { + return m.ProofRequestProbability + } + return 0 +} + +func (m *Params) GetProofRequirementThreshold() *types.Coin { + if m != nil { + return m.ProofRequirementThreshold + } + return nil +} + +func (m *Params) GetProofMissingPenalty() *types.Coin { + if m != nil { + return m.ProofMissingPenalty + } + return nil +} + +func (m *Params) GetProofSubmissionFee() *types.Coin { + if m != nil { + return m.ProofSubmissionFee + } + return nil +} + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.proof.Params") +} + +func init() { proto.RegisterFile("poktroll/proof/params.proto", fileDescriptor_2ad689ad5bf3a2d7) } + +var fileDescriptor_2ad689ad5bf3a2d7 = []byte{ + // 439 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x6e, 0xd4, 0x40, + 0x14, 0x86, 0x77, 0x42, 0x48, 0x61, 0x10, 0x12, 0x26, 0x28, 0x76, 0x02, 0xb6, 0x45, 0xb5, 0x42, + 0xc2, 0xa3, 0x40, 0x47, 0xb9, 0x20, 0x44, 0x01, 0xd2, 0xca, 0xa4, 0x81, 0x66, 0x34, 0xde, 0xbc, + 0xb5, 0x47, 0xb1, 0xe7, 0x99, 0x99, 0x59, 0xc0, 0x1c, 0x81, 0x8a, 0x23, 0x70, 0x04, 0x1a, 0xee, + 0x40, 0x99, 0x32, 0x95, 0x85, 0x76, 0x0b, 0x90, 0x4f, 0x81, 0x76, 0x66, 0xb3, 0x29, 0x08, 0xd9, + 0xc6, 0x1a, 0xfd, 0xdf, 0xfb, 0xdf, 0x6f, 0x3d, 0xfd, 0xde, 0x41, 0x83, 0x27, 0x46, 0x61, 0x55, + 0xd1, 0x46, 0x21, 0x4e, 0x69, 0xc3, 0x15, 0xaf, 0x75, 0xda, 0x28, 0x34, 0xe8, 0xdf, 0x3a, 0x87, + 0xa9, 0x85, 0xfb, 0xb7, 0x79, 0x2d, 0x24, 0x52, 0xfb, 0x75, 0x23, 0xfb, 0xbb, 0x05, 0x16, 0x68, + 0x9f, 0x74, 0xf9, 0x5a, 0xa9, 0xd1, 0x04, 0x75, 0x8d, 0x9a, 0xe6, 0x5c, 0x03, 0xfd, 0x70, 0x98, + 0x83, 0xe1, 0x87, 0x74, 0x82, 0x42, 0x3a, 0xfe, 0xe0, 0xc7, 0xb6, 0xb7, 0x33, 0xb6, 0x49, 0x3e, + 0xf7, 0xee, 0x29, 0xa8, 0x78, 0xcb, 0x8e, 0xc5, 0x74, 0x2a, 0x26, 0xb3, 0xca, 0xb4, 0xcc, 0x70, + 0x55, 0x80, 0x61, 0x25, 0xd7, 0x65, 0x40, 0x12, 0x32, 0xbc, 0x39, 0x4a, 0xfa, 0x2e, 0xbe, 0x72, + 0x2e, 0x0b, 0x2d, 0x7d, 0xbe, 0x86, 0x47, 0x96, 0xbd, 0xe4, 0xba, 0xf4, 0xdf, 0x7a, 0xa1, 0xfd, + 0x7f, 0xa6, 0xe0, 0xfd, 0x0c, 0xb4, 0x61, 0x8d, 0xc2, 0x9c, 0xe7, 0xa2, 0x12, 0xa6, 0x0d, 0xb6, + 0x12, 0x32, 0xdc, 0x1a, 0xdd, 0xef, 0xbb, 0xf8, 0xff, 0x43, 0xd9, 0x9e, 0x45, 0x99, 0x23, 0xe3, + 0x0b, 0xe0, 0x7f, 0xf6, 0x0e, 0x2e, 0x5c, 0x42, 0x41, 0x0d, 0xd2, 0x30, 0x53, 0x2a, 0xd0, 0x25, + 0x56, 0xc7, 0xc1, 0xb5, 0x84, 0x0c, 0x6f, 0x3c, 0x0e, 0x53, 0x77, 0x8e, 0x74, 0x79, 0x8e, 0x74, + 0x75, 0x8e, 0xf4, 0x19, 0x0a, 0x39, 0x8a, 0xfb, 0x2e, 0xbe, 0x6a, 0x43, 0x16, 0xae, 0x93, 0x57, + 0xec, 0xe8, 0x1c, 0xf9, 0xa5, 0x77, 0xd7, 0x39, 0x6b, 0xa1, 0xb5, 0x90, 0x05, 0x6b, 0x40, 0xf2, + 0xca, 0xb4, 0xc1, 0xf6, 0xa6, 0xd4, 0xb0, 0xef, 0xe2, 0xcb, 0xbd, 0xd9, 0x1d, 0x2b, 0xbf, 0x76, + 0xea, 0xd8, 0x89, 0x3e, 0x78, 0xbb, 0x6e, 0x5a, 0xcf, 0x72, 0x6b, 0x40, 0xc9, 0xa6, 0x00, 0xc1, + 0xf5, 0x4d, 0x41, 0x41, 0xdf, 0xc5, 0x97, 0x5a, 0x33, 0xdf, 0xaa, 0x6f, 0xd6, 0xe2, 0x0b, 0x80, + 0xa7, 0xc9, 0x9f, 0x6f, 0x31, 0xf9, 0xf2, 0xfb, 0xfb, 0xc3, 0xbd, 0x75, 0x29, 0x3f, 0xad, 0x6a, + 0xe9, 0xca, 0x32, 0x7a, 0xf5, 0x73, 0x1e, 0x91, 0xd3, 0x79, 0x44, 0xce, 0xe6, 0x11, 0xf9, 0x35, + 0x8f, 0xc8, 0xd7, 0x45, 0x34, 0x38, 0x5d, 0x44, 0x83, 0xb3, 0x45, 0x34, 0x78, 0x97, 0x16, 0xc2, + 0x94, 0xb3, 0x3c, 0x9d, 0x60, 0x4d, 0x97, 0x1b, 0x1e, 0x49, 0x30, 0x1f, 0x51, 0x9d, 0xd0, 0x7f, + 0xd6, 0x99, 0xb6, 0x01, 0x9d, 0xef, 0xd8, 0x32, 0x3e, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x63, + 0xa4, 0x76, 0xd5, 0x04, 0x03, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.RelayDifficultyTargetHash, that1.RelayDifficultyTargetHash) { + return false + } + if this.ProofRequestProbability != that1.ProofRequestProbability { + return false + } + if !this.ProofRequirementThreshold.Equal(that1.ProofRequirementThreshold) { + return false + } + if !this.ProofMissingPenalty.Equal(that1.ProofMissingPenalty) { + return false + } + if !this.ProofSubmissionFee.Equal(that1.ProofSubmissionFee) { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProofSubmissionFee != nil { + { + size, err := m.ProofSubmissionFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ProofMissingPenalty != nil { + { + size, err := m.ProofMissingPenalty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ProofRequirementThreshold != nil { + { + size, err := m.ProofRequirementThreshold.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ProofRequestProbability != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.ProofRequestProbability)))) + i-- + dAtA[i] = 0x15 + } + if len(m.RelayDifficultyTargetHash) > 0 { + i -= len(m.RelayDifficultyTargetHash) + copy(dAtA[i:], m.RelayDifficultyTargetHash) + i = encodeVarintParams(dAtA, i, uint64(len(m.RelayDifficultyTargetHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RelayDifficultyTargetHash) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + if m.ProofRequestProbability != 0 { + n += 5 + } + if m.ProofRequirementThreshold != nil { + l = m.ProofRequirementThreshold.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.ProofMissingPenalty != nil { + l = m.ProofMissingPenalty.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.ProofSubmissionFee != nil { + l = m.ProofSubmissionFee.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayDifficultyTargetHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RelayDifficultyTargetHash = append(m.RelayDifficultyTargetHash[:0], dAtA[iNdEx:postIndex]...) + if m.RelayDifficultyTargetHash == nil { + m.RelayDifficultyTargetHash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofRequestProbability", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.ProofRequestProbability = float32(math.Float32frombits(v)) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofRequirementThreshold", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProofRequirementThreshold == nil { + m.ProofRequirementThreshold = &types.Coin{} + } + if err := m.ProofRequirementThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofMissingPenalty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProofMissingPenalty == nil { + m.ProofMissingPenalty = &types.Coin{} + } + if err := m.ProofMissingPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofSubmissionFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProofSubmissionFee == nil { + m.ProofSubmissionFee = &types.Coin{} + } + if err := m.ProofSubmissionFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/query.pb.go b/x/proof/types/query.pb.go new file mode 100644 index 000000000..ebe21a473 --- /dev/null +++ b/x/proof/types/query.pb.go @@ -0,0 +1,2756 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetClaimRequest struct { + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` +} + +func (m *QueryGetClaimRequest) Reset() { *m = QueryGetClaimRequest{} } +func (m *QueryGetClaimRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetClaimRequest) ProtoMessage() {} +func (*QueryGetClaimRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{2} +} +func (m *QueryGetClaimRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetClaimRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClaimRequest.Merge(m, src) +} +func (m *QueryGetClaimRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClaimRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClaimRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClaimRequest proto.InternalMessageInfo + +func (m *QueryGetClaimRequest) GetSessionId() string { + if m != nil { + return m.SessionId + } + return "" +} + +func (m *QueryGetClaimRequest) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +type QueryGetClaimResponse struct { + Claim Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` +} + +func (m *QueryGetClaimResponse) Reset() { *m = QueryGetClaimResponse{} } +func (m *QueryGetClaimResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetClaimResponse) ProtoMessage() {} +func (*QueryGetClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{3} +} +func (m *QueryGetClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClaimResponse.Merge(m, src) +} +func (m *QueryGetClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClaimResponse proto.InternalMessageInfo + +func (m *QueryGetClaimResponse) GetClaim() Claim { + if m != nil { + return m.Claim + } + return Claim{} +} + +type QueryAllClaimsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // Types that are valid to be assigned to Filter: + // *QueryAllClaimsRequest_SupplierOperatorAddress + // *QueryAllClaimsRequest_SessionId + // *QueryAllClaimsRequest_SessionEndHeight + Filter isQueryAllClaimsRequest_Filter `protobuf_oneof:"filter"` +} + +func (m *QueryAllClaimsRequest) Reset() { *m = QueryAllClaimsRequest{} } +func (m *QueryAllClaimsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllClaimsRequest) ProtoMessage() {} +func (*QueryAllClaimsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{4} +} +func (m *QueryAllClaimsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllClaimsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllClaimsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllClaimsRequest.Merge(m, src) +} +func (m *QueryAllClaimsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllClaimsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllClaimsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllClaimsRequest proto.InternalMessageInfo + +type isQueryAllClaimsRequest_Filter interface { + isQueryAllClaimsRequest_Filter() + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryAllClaimsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` +} +type QueryAllClaimsRequest_SessionId struct { + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` +} +type QueryAllClaimsRequest_SessionEndHeight struct { + SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` +} + +func (*QueryAllClaimsRequest_SupplierOperatorAddress) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SessionId) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SessionEndHeight) isQueryAllClaimsRequest_Filter() {} + +func (m *QueryAllClaimsRequest) GetFilter() isQueryAllClaimsRequest_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *QueryAllClaimsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryAllClaimsRequest) GetSupplierOperatorAddress() string { + if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress + } + return "" +} + +func (m *QueryAllClaimsRequest) GetSessionId() string { + if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SessionId); ok { + return x.SessionId + } + return "" +} + +func (m *QueryAllClaimsRequest) GetSessionEndHeight() uint64 { + if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SessionEndHeight); ok { + return x.SessionEndHeight + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryAllClaimsRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryAllClaimsRequest_SupplierOperatorAddress)(nil), + (*QueryAllClaimsRequest_SessionId)(nil), + (*QueryAllClaimsRequest_SessionEndHeight)(nil), + } +} + +type QueryAllClaimsResponse struct { + Claims []Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllClaimsResponse) Reset() { *m = QueryAllClaimsResponse{} } +func (m *QueryAllClaimsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllClaimsResponse) ProtoMessage() {} +func (*QueryAllClaimsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{5} +} +func (m *QueryAllClaimsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllClaimsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllClaimsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllClaimsResponse.Merge(m, src) +} +func (m *QueryAllClaimsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllClaimsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllClaimsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllClaimsResponse proto.InternalMessageInfo + +func (m *QueryAllClaimsResponse) GetClaims() []Claim { + if m != nil { + return m.Claims + } + return nil +} + +func (m *QueryAllClaimsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetProofRequest struct { + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` +} + +func (m *QueryGetProofRequest) Reset() { *m = QueryGetProofRequest{} } +func (m *QueryGetProofRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetProofRequest) ProtoMessage() {} +func (*QueryGetProofRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{6} +} +func (m *QueryGetProofRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetProofRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProofRequest.Merge(m, src) +} +func (m *QueryGetProofRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProofRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProofRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProofRequest proto.InternalMessageInfo + +func (m *QueryGetProofRequest) GetSessionId() string { + if m != nil { + return m.SessionId + } + return "" +} + +func (m *QueryGetProofRequest) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +type QueryGetProofResponse struct { + Proof Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof"` +} + +func (m *QueryGetProofResponse) Reset() { *m = QueryGetProofResponse{} } +func (m *QueryGetProofResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetProofResponse) ProtoMessage() {} +func (*QueryGetProofResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{7} +} +func (m *QueryGetProofResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetProofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProofResponse.Merge(m, src) +} +func (m *QueryGetProofResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProofResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProofResponse proto.InternalMessageInfo + +func (m *QueryGetProofResponse) GetProof() Proof { + if m != nil { + return m.Proof + } + return Proof{} +} + +type QueryAllProofsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // Types that are valid to be assigned to Filter: + // + // *QueryAllProofsRequest_SupplierOperatorAddress + // *QueryAllProofsRequest_SessionId + // *QueryAllProofsRequest_SessionEndHeight + Filter isQueryAllProofsRequest_Filter `protobuf_oneof:"filter"` +} + +func (m *QueryAllProofsRequest) Reset() { *m = QueryAllProofsRequest{} } +func (m *QueryAllProofsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllProofsRequest) ProtoMessage() {} +func (*QueryAllProofsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{8} +} +func (m *QueryAllProofsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllProofsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllProofsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllProofsRequest.Merge(m, src) +} +func (m *QueryAllProofsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllProofsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllProofsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllProofsRequest proto.InternalMessageInfo + +type isQueryAllProofsRequest_Filter interface { + isQueryAllProofsRequest_Filter() + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryAllProofsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` +} +type QueryAllProofsRequest_SessionId struct { + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` +} +type QueryAllProofsRequest_SessionEndHeight struct { + SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` +} + +func (*QueryAllProofsRequest_SupplierOperatorAddress) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SessionId) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SessionEndHeight) isQueryAllProofsRequest_Filter() {} + +func (m *QueryAllProofsRequest) GetFilter() isQueryAllProofsRequest_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *QueryAllProofsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryAllProofsRequest) GetSupplierOperatorAddress() string { + if x, ok := m.GetFilter().(*QueryAllProofsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress + } + return "" +} + +func (m *QueryAllProofsRequest) GetSessionId() string { + if x, ok := m.GetFilter().(*QueryAllProofsRequest_SessionId); ok { + return x.SessionId + } + return "" +} + +func (m *QueryAllProofsRequest) GetSessionEndHeight() uint64 { + if x, ok := m.GetFilter().(*QueryAllProofsRequest_SessionEndHeight); ok { + return x.SessionEndHeight + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryAllProofsRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryAllProofsRequest_SupplierOperatorAddress)(nil), + (*QueryAllProofsRequest_SessionId)(nil), + (*QueryAllProofsRequest_SessionEndHeight)(nil), + } +} + +type QueryAllProofsResponse struct { + Proofs []Proof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllProofsResponse) Reset() { *m = QueryAllProofsResponse{} } +func (m *QueryAllProofsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllProofsResponse) ProtoMessage() {} +func (*QueryAllProofsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_452adc3cc4abc239, []int{9} +} +func (m *QueryAllProofsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllProofsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllProofsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllProofsResponse.Merge(m, src) +} +func (m *QueryAllProofsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllProofsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllProofsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllProofsResponse proto.InternalMessageInfo + +func (m *QueryAllProofsResponse) GetProofs() []Proof { + if m != nil { + return m.Proofs + } + return nil +} + +func (m *QueryAllProofsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.proof.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.proof.QueryParamsResponse") + proto.RegisterType((*QueryGetClaimRequest)(nil), "poktroll.proof.QueryGetClaimRequest") + proto.RegisterType((*QueryGetClaimResponse)(nil), "poktroll.proof.QueryGetClaimResponse") + proto.RegisterType((*QueryAllClaimsRequest)(nil), "poktroll.proof.QueryAllClaimsRequest") + proto.RegisterType((*QueryAllClaimsResponse)(nil), "poktroll.proof.QueryAllClaimsResponse") + proto.RegisterType((*QueryGetProofRequest)(nil), "poktroll.proof.QueryGetProofRequest") + proto.RegisterType((*QueryGetProofResponse)(nil), "poktroll.proof.QueryGetProofResponse") + proto.RegisterType((*QueryAllProofsRequest)(nil), "poktroll.proof.QueryAllProofsRequest") + proto.RegisterType((*QueryAllProofsResponse)(nil), "poktroll.proof.QueryAllProofsResponse") +} + +func init() { proto.RegisterFile("poktroll/proof/query.proto", fileDescriptor_452adc3cc4abc239) } + +var fileDescriptor_452adc3cc4abc239 = []byte{ + // 747 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xbf, 0x6f, 0xd3, 0x4e, + 0x14, 0x8f, 0xdb, 0x26, 0xfa, 0xe6, 0xbe, 0x12, 0x82, 0x23, 0x2d, 0x69, 0x00, 0xb7, 0x72, 0x7f, + 0x50, 0x15, 0xd5, 0x56, 0xdb, 0x09, 0x89, 0xa5, 0x41, 0xd0, 0xf2, 0x4b, 0x04, 0x97, 0x89, 0x25, + 0x72, 0x9a, 0xab, 0x6b, 0xd5, 0xf1, 0xb9, 0xf6, 0x05, 0xa8, 0xaa, 0x32, 0x30, 0xb0, 0xb0, 0x20, + 0x21, 0xf1, 0x37, 0xc0, 0xc6, 0xc0, 0x1f, 0xd1, 0xb1, 0x82, 0xa5, 0x13, 0x42, 0x29, 0x12, 0x33, + 0x1b, 0x23, 0xf2, 0xbb, 0x67, 0x12, 0x9b, 0xba, 0x29, 0x12, 0x03, 0x12, 0x8b, 0x65, 0xdf, 0xfb, + 0xbc, 0x77, 0x9f, 0xf7, 0xb9, 0xcf, 0x3d, 0x99, 0x54, 0x7c, 0xbe, 0x29, 0x02, 0xee, 0xba, 0x86, + 0x1f, 0x70, 0xbe, 0x6e, 0x6c, 0xb5, 0x59, 0xb0, 0xad, 0xfb, 0x01, 0x17, 0x9c, 0x9e, 0x8a, 0x63, + 0x3a, 0xc4, 0x2a, 0x67, 0xac, 0x96, 0xe3, 0x71, 0x03, 0x9e, 0x12, 0x52, 0x29, 0xd9, 0xdc, 0xe6, + 0xf0, 0x6a, 0x44, 0x6f, 0xb8, 0x7a, 0xc1, 0xe6, 0xdc, 0x76, 0x99, 0x61, 0xf9, 0x8e, 0x61, 0x79, + 0x1e, 0x17, 0x96, 0x70, 0xb8, 0x17, 0x62, 0x74, 0x74, 0x8d, 0x87, 0x2d, 0x1e, 0xd6, 0x65, 0x9a, + 0xfc, 0xc0, 0xd0, 0xac, 0xfc, 0x32, 0x1a, 0x56, 0xc8, 0x24, 0x15, 0xe3, 0xd1, 0x7c, 0x83, 0x09, + 0x6b, 0xde, 0xf0, 0x2d, 0xdb, 0xf1, 0xa0, 0x0e, 0x62, 0xcf, 0xa7, 0x98, 0xfb, 0x56, 0x60, 0xb5, + 0xe2, 0x42, 0xe9, 0xb6, 0xc4, 0xb6, 0xcf, 0x30, 0xa6, 0x95, 0x08, 0xbd, 0x1f, 0x95, 0xae, 0x41, + 0x82, 0xc9, 0xb6, 0xda, 0x2c, 0x14, 0x5a, 0x8d, 0x9c, 0x4d, 0xac, 0x86, 0x3e, 0xf7, 0x42, 0x46, + 0xaf, 0x90, 0x82, 0x2c, 0x5c, 0x56, 0xc6, 0x95, 0x99, 0xff, 0x17, 0x46, 0xf4, 0xa4, 0x28, 0xba, + 0xc4, 0x57, 0x8b, 0x7b, 0x9f, 0xc6, 0x72, 0x6f, 0xbe, 0xbe, 0x9b, 0x55, 0x4c, 0x4c, 0xd0, 0x5e, + 0x28, 0xa4, 0x04, 0x25, 0x97, 0x99, 0xb8, 0xe6, 0x5a, 0x4e, 0x0b, 0xb7, 0xa2, 0x17, 0x09, 0x09, + 0x59, 0x18, 0x3a, 0xdc, 0xab, 0x3b, 0x4d, 0xa8, 0x5b, 0x34, 0x8b, 0xb8, 0x72, 0xb3, 0x49, 0x1f, + 0x90, 0xd1, 0xb0, 0xed, 0xfb, 0xae, 0xc3, 0x82, 0x3a, 0xf7, 0x59, 0x60, 0x09, 0x1e, 0xd4, 0xad, + 0x66, 0x33, 0x60, 0x61, 0x58, 0x1e, 0x88, 0xd0, 0xd5, 0xf2, 0x87, 0xf7, 0x73, 0x25, 0x54, 0x6e, + 0x49, 0x46, 0x56, 0x45, 0xe0, 0x78, 0xb6, 0x79, 0x2e, 0x4e, 0xbd, 0x87, 0x99, 0x18, 0xd6, 0x6e, + 0x91, 0xe1, 0x14, 0x19, 0xec, 0x70, 0x9e, 0xe4, 0xd7, 0xa2, 0x05, 0x6c, 0x70, 0x38, 0xdd, 0x20, + 0xa0, 0xab, 0x43, 0x51, 0x7f, 0xa6, 0x44, 0x6a, 0xdf, 0x15, 0x2c, 0xb6, 0xe4, 0xba, 0x10, 0x8e, + 0x55, 0xa4, 0x37, 0x08, 0xe9, 0x1e, 0x14, 0x56, 0x9c, 0xd6, 0x91, 0x69, 0x74, 0xaa, 0xba, 0x34, + 0x18, 0x9e, 0xaa, 0x5e, 0xb3, 0x6c, 0x86, 0xb9, 0x66, 0x4f, 0x26, 0xbd, 0xda, 0x57, 0x83, 0x95, + 0x5c, 0x66, 0xaf, 0x74, 0x2c, 0x21, 0xf0, 0x20, 0xc2, 0x7b, 0x24, 0xd6, 0x09, 0x8d, 0x01, 0xcc, + 0x6b, 0xd6, 0x37, 0x98, 0x63, 0x6f, 0x88, 0xf2, 0xd0, 0xb8, 0x32, 0x33, 0xb4, 0x92, 0x33, 0x4f, + 0x63, 0xec, 0xba, 0xd7, 0x5c, 0x81, 0x48, 0xf5, 0x3f, 0x52, 0x58, 0x77, 0x5c, 0xc1, 0x02, 0xed, + 0xb5, 0x42, 0x46, 0xd2, 0xad, 0xa3, 0x90, 0x8b, 0xa4, 0x00, 0xf2, 0x44, 0x56, 0x19, 0xec, 0xa7, + 0x24, 0x42, 0xe9, 0x72, 0x42, 0xb0, 0x01, 0x10, 0xec, 0x52, 0x5f, 0xc1, 0xe4, 0x8e, 0xbd, 0x8a, + 0x25, 0xdc, 0x56, 0x8b, 0xb6, 0xfb, 0x5b, 0xdc, 0x86, 0x64, 0xba, 0x6e, 0x03, 0x31, 0xb2, 0xdc, + 0x06, 0xe8, 0xd8, 0x6d, 0xb0, 0x94, 0x70, 0x1b, 0x84, 0xff, 0x4d, 0xb7, 0xc5, 0xad, 0x77, 0xdd, + 0x06, 0xf2, 0x64, 0xba, 0xad, 0x57, 0x49, 0x84, 0xfe, 0x31, 0xb7, 0x2d, 0x7c, 0xcb, 0x93, 0x3c, + 0x10, 0xa3, 0x4f, 0x49, 0x41, 0x8e, 0x40, 0xaa, 0xa5, 0x19, 0xfc, 0x3a, 0x65, 0x2b, 0x13, 0xc7, + 0x62, 0xe4, 0x46, 0xda, 0xe5, 0x67, 0x1f, 0xbf, 0xbc, 0x1a, 0x98, 0xa2, 0x13, 0x46, 0x04, 0x9e, + 0xf3, 0x98, 0x78, 0xcc, 0x83, 0x4d, 0xe3, 0xc8, 0x79, 0x4f, 0xdf, 0x2a, 0x24, 0x0f, 0x17, 0x8b, + 0x4e, 0x1e, 0x59, 0x3b, 0x35, 0x7c, 0x2b, 0x53, 0x7d, 0x50, 0xc8, 0x61, 0x15, 0x38, 0xdc, 0xa5, + 0xb7, 0x8f, 0xe5, 0x00, 0x97, 0xd8, 0xd8, 0xe9, 0x1e, 0xff, 0xae, 0xb1, 0x93, 0xe9, 0xa4, 0x5d, + 0xfa, 0x5c, 0x21, 0xc5, 0x9f, 0x73, 0x83, 0x1e, 0xcd, 0x24, 0x3d, 0x52, 0x2b, 0xd3, 0xfd, 0x60, + 0xc8, 0x78, 0x16, 0x18, 0x4f, 0x52, 0xad, 0x3f, 0x63, 0x10, 0x0d, 0xfc, 0x91, 0x2d, 0x5a, 0xef, + 0x0c, 0xc9, 0x16, 0x2d, 0x71, 0xb9, 0x4f, 0x28, 0x9a, 0x7c, 0xfe, 0xae, 0x68, 0xd2, 0xfe, 0xd9, + 0xa2, 0x25, 0x26, 0x43, 0xb6, 0x68, 0xc9, 0x5b, 0x74, 0x42, 0xd1, 0xe0, 0x59, 0xbd, 0xb3, 0xd7, + 0x51, 0x95, 0xfd, 0x8e, 0xaa, 0x1c, 0x74, 0x54, 0xe5, 0x73, 0x47, 0x55, 0x5e, 0x1e, 0xaa, 0xb9, + 0xfd, 0x43, 0x35, 0x77, 0x70, 0xa8, 0xe6, 0x1e, 0xea, 0xb6, 0x23, 0x36, 0xda, 0x0d, 0x7d, 0x8d, + 0xb7, 0x32, 0x6a, 0x3d, 0xe9, 0xfd, 0x17, 0x69, 0x14, 0xe0, 0x67, 0x64, 0xf1, 0x47, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd9, 0x4d, 0xb5, 0x56, 0x81, 0x09, 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 Claim items. + Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) + AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) + // Queries a list of Proof items. + Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) + AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.proof.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Claim(ctx context.Context, in *QueryGetClaimRequest, opts ...grpc.CallOption) (*QueryGetClaimResponse, error) { + out := new(QueryGetClaimResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Query/Claim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllClaims(ctx context.Context, in *QueryAllClaimsRequest, opts ...grpc.CallOption) (*QueryAllClaimsResponse, error) { + out := new(QueryAllClaimsResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Query/AllClaims", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Proof(ctx context.Context, in *QueryGetProofRequest, opts ...grpc.CallOption) (*QueryGetProofResponse, error) { + out := new(QueryGetProofResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Query/Proof", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllProofs(ctx context.Context, in *QueryAllProofsRequest, opts ...grpc.CallOption) (*QueryAllProofsResponse, error) { + out := new(QueryAllProofsResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Query/AllProofs", in, out, opts...) + 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 Claim items. + Claim(context.Context, *QueryGetClaimRequest) (*QueryGetClaimResponse, error) + AllClaims(context.Context, *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) + // Queries a list of Proof items. + Proof(context.Context, *QueryGetProofRequest) (*QueryGetProofResponse, error) + AllProofs(context.Context, *QueryAllProofsRequest) (*QueryAllProofsResponse, 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) Claim(ctx context.Context, req *QueryGetClaimRequest) (*QueryGetClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") +} +func (*UnimplementedQueryServer) AllClaims(ctx context.Context, req *QueryAllClaimsRequest) (*QueryAllClaimsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllClaims not implemented") +} +func (*UnimplementedQueryServer) Proof(ctx context.Context, req *QueryGetProofRequest) (*QueryGetProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") +} +func (*UnimplementedQueryServer) AllProofs(ctx context.Context, req *QueryAllProofsRequest) (*QueryAllProofsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllProofs not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.proof.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 _Query_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetClaimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Claim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Query/Claim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Claim(ctx, req.(*QueryGetClaimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllClaims_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllClaimsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllClaims(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Query/AllClaims", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllClaims(ctx, req.(*QueryAllClaimsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetProofRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Query/Proof", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proof(ctx, req.(*QueryGetProofRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllProofs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllProofsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllProofs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Query/AllProofs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllProofs(ctx, req.(*QueryAllProofsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.proof.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Claim", + Handler: _Query_Claim_Handler, + }, + { + MethodName: "AllClaims", + Handler: _Query_AllClaims_Handler, + }, + { + MethodName: "Proof", + Handler: _Query_Proof_Handler, + }, + { + MethodName: "AllProofs", + Handler: _Query_AllProofs_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/proof/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetClaimRequest) 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 *QueryGetClaimRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SessionId) > 0 { + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetClaimResponse) 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 *QueryGetClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Claim.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 *QueryAllClaimsRequest) 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 *QueryAllClaimsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClaimsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size := m.Filter.Size() + i -= size + if _, err := m.Filter.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + 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 *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *QueryAllClaimsRequest_SessionId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClaimsRequest_SessionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *QueryAllClaimsRequest_SessionEndHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClaimsRequest_SessionEndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintQuery(dAtA, i, uint64(m.SessionEndHeight)) + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *QueryAllClaimsResponse) 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 *QueryAllClaimsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClaimsResponse) 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.Claims) > 0 { + for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Claims[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 (m *QueryGetProofRequest) 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 *QueryGetProofRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SessionId) > 0 { + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetProofResponse) 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 *QueryGetProofResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Proof.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 *QueryAllProofsRequest) 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 *QueryAllProofsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProofsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size := m.Filter.Size() + i -= size + if _, err := m.Filter.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + 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 *QueryAllProofsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProofsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *QueryAllProofsRequest_SessionId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProofsRequest_SessionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *QueryAllProofsRequest_SessionEndHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProofsRequest_SessionEndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintQuery(dAtA, i, uint64(m.SessionEndHeight)) + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *QueryAllProofsResponse) 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 *QueryAllProofsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProofsResponse) 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.Proofs) > 0 { + for iNdEx := len(m.Proofs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proofs[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 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 *QueryGetClaimRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SessionId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Claim.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllClaimsRequest) 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)) + } + if m.Filter != nil { + n += m.Filter.Size() + } + return n +} + +func (m *QueryAllClaimsRequest_SupplierOperatorAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryAllClaimsRequest_SessionId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SessionId) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryAllClaimsRequest_SessionEndHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovQuery(uint64(m.SessionEndHeight)) + return n +} +func (m *QueryAllClaimsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Claims) > 0 { + for _, e := range m.Claims { + 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 *QueryGetProofRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SessionId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetProofResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Proof.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllProofsRequest) 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)) + } + if m.Filter != nil { + n += m.Filter.Size() + } + return n +} + +func (m *QueryAllProofsRequest_SupplierOperatorAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryAllProofsRequest_SessionId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SessionId) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryAllProofsRequest_SessionEndHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovQuery(uint64(m.SessionEndHeight)) + return n +} +func (m *QueryAllProofsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proofs) > 0 { + for _, e := range m.Proofs { + 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 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 *QueryGetClaimRequest) 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: QueryGetClaimRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.SessionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.SupplierOperatorAddress = 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 *QueryGetClaimResponse) 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: QueryGetClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", 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.Claim.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 *QueryAllClaimsRequest) 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: QueryAllClaimsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllClaimsRequest: 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.Filter = &QueryAllClaimsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.Filter = &QueryAllClaimsRequest_SessionId{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Filter = &QueryAllClaimsRequest_SessionEndHeight{v} + 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 *QueryAllClaimsResponse) 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: QueryAllClaimsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllClaimsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claims", 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.Claims = append(m.Claims, Claim{}) + if err := m.Claims[len(m.Claims)-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:]) + 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 *QueryGetProofRequest) 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: QueryGetProofRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.SessionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.SupplierOperatorAddress = 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 *QueryGetProofResponse) 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: QueryGetProofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", 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.Proof.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 *QueryAllProofsRequest) 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: QueryAllProofsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllProofsRequest: 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", 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.Filter = &QueryAllProofsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", 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.Filter = &QueryAllProofsRequest_SessionId{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Filter = &QueryAllProofsRequest_SessionEndHeight{v} + 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 *QueryAllProofsResponse) 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: QueryAllProofsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllProofsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proofs", 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.Proofs = append(m.Proofs, Proof{}) + if err := m.Proofs[len(m.Proofs)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/query.pb.gw.go b/x/proof/types/query.pb.gw.go new file mode 100644 index 000000000..28b7efa33 --- /dev/null +++ b/x/proof/types/query.pb.gw.go @@ -0,0 +1,565 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/proof/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClaimRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["session_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") + } + + protoReq.SessionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) + } + + val, ok = pathParams["supplier_operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") + } + + protoReq.SupplierOperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) + } + + msg, err := client.Claim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClaimRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["session_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") + } + + protoReq.SessionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) + } + + val, ok = pathParams["supplier_operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") + } + + protoReq.SupplierOperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) + } + + msg, err := server.Claim(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllClaims_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllClaims_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllClaimsRequest + 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_AllClaims_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllClaims(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllClaims_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllClaimsRequest + 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_AllClaims_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllClaims(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetProofRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["session_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") + } + + protoReq.SessionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) + } + + val, ok = pathParams["supplier_operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") + } + + protoReq.SupplierOperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) + } + + msg, err := client.Proof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetProofRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["session_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "session_id") + } + + protoReq.SessionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) + } + + val, ok = pathParams["supplier_operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") + } + + protoReq.SupplierOperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) + } + + msg, err := server.Proof(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllProofs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllProofs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllProofsRequest + 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_AllProofs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllProofs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllProofs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllProofsRequest + 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_AllProofs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllProofs(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Claim_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_Claim_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_Claim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllClaims_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_AllClaims_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_AllClaims_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proof_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_Proof_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_Proof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllProofs_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_AllProofs_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_AllProofs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Claim_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_Claim_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_Claim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllClaims_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_AllClaims_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_AllClaims_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proof_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_Proof_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_Proof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllProofs_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_AllProofs_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_AllProofs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Claim_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{"pokt-network", "poktroll", "proof", "claim", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllClaims_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "claim"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Proof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "proof", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllProofs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "proof"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Claim_0 = runtime.ForwardResponseMessage + + forward_Query_AllClaims_0 = runtime.ForwardResponseMessage + + forward_Query_Proof_0 = runtime.ForwardResponseMessage + + forward_Query_AllProofs_0 = runtime.ForwardResponseMessage +) diff --git a/x/proof/types/tx.pb.go b/x/proof/types/tx.pb.go new file mode 100644 index 000000000..a98755961 --- /dev/null +++ b/x/proof/types/tx.pb.go @@ -0,0 +1,2396 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/tx.proto + +package types + +import ( + context "context" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/pokt-network/poktroll/x/session/types" + _ "github.com/pokt-network/poktroll/x/shared/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type to update all params at once. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/proof parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. +type MsgUpdateParam struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // The (name, as_type) tuple must match the corresponding name and type as + // specified in the `Params`` message in `proof/params.proto.` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Types that are valid to be assigned to AsType: + // *MsgUpdateParam_AsString + // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsBytes + // *MsgUpdateParam_AsFloat + // *MsgUpdateParam_AsCoin + AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` +} + +func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } +func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParam) ProtoMessage() {} +func (*MsgUpdateParam) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{2} +} +func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParam.Merge(m, src) +} +func (m *MsgUpdateParam) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParam) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo + +type isMsgUpdateParam_AsType interface { + isMsgUpdateParam_AsType() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateParam_AsString struct { + AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` +} +type MsgUpdateParam_AsInt64 struct { + AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` +} +type MsgUpdateParam_AsBytes struct { + AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` +} +type MsgUpdateParam_AsFloat struct { + AsFloat float32 `protobuf:"fixed32,8,opt,name=as_float,json=asFloat,proto3,oneof" json:"as_float"` +} +type MsgUpdateParam_AsCoin struct { + AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` +} + +func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} + +func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { + if m != nil { + return m.AsType + } + return nil +} + +func (m *MsgUpdateParam) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParam) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpdateParam) GetAsString() string { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { + return x.AsString + } + return "" +} + +func (m *MsgUpdateParam) GetAsInt64() int64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { + return x.AsInt64 + } + return 0 +} + +func (m *MsgUpdateParam) GetAsBytes() []byte { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { + return x.AsBytes + } + return nil +} + +func (m *MsgUpdateParam) GetAsFloat() float32 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsFloat); ok { + return x.AsFloat + } + return 0 +} + +func (m *MsgUpdateParam) GetAsCoin() *types.Coin { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsCoin); ok { + return x.AsCoin + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateParam_AsString)(nil), + (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsBytes)(nil), + (*MsgUpdateParam_AsFloat)(nil), + (*MsgUpdateParam_AsCoin)(nil), + } +} + +// MsgUpdateParamResponse defines the response structure for executing a +// MsgUpdateParam message after a single param update. +type MsgUpdateParamResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } +func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamResponse) ProtoMessage() {} +func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{3} +} +func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) +} +func (m *MsgUpdateParamResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo + +func (m *MsgUpdateParamResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +type MsgCreateClaim struct { + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + // root returned from smt.SMST#Root() + RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` +} + +func (m *MsgCreateClaim) Reset() { *m = MsgCreateClaim{} } +func (m *MsgCreateClaim) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClaim) ProtoMessage() {} +func (*MsgCreateClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{4} +} +func (m *MsgCreateClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgCreateClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClaim.Merge(m, src) +} +func (m *MsgCreateClaim) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClaim) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClaim proto.InternalMessageInfo + +func (m *MsgCreateClaim) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +func (m *MsgCreateClaim) GetSessionHeader() *types1.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *MsgCreateClaim) GetRootHash() []byte { + if m != nil { + return m.RootHash + } + return nil +} + +type MsgCreateClaimResponse struct { + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` +} + +func (m *MsgCreateClaimResponse) Reset() { *m = MsgCreateClaimResponse{} } +func (m *MsgCreateClaimResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClaimResponse) ProtoMessage() {} +func (*MsgCreateClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{5} +} +func (m *MsgCreateClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgCreateClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClaimResponse.Merge(m, src) +} +func (m *MsgCreateClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClaimResponse proto.InternalMessageInfo + +func (m *MsgCreateClaimResponse) GetClaim() *Claim { + if m != nil { + return m.Claim + } + return nil +} + +type MsgSubmitProof struct { + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + // serialized version of *smt.SparseMerkleClosestProof + Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *MsgSubmitProof) Reset() { *m = MsgSubmitProof{} } +func (m *MsgSubmitProof) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProof) ProtoMessage() {} +func (*MsgSubmitProof) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{6} +} +func (m *MsgSubmitProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgSubmitProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProof.Merge(m, src) +} +func (m *MsgSubmitProof) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProof) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProof.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProof proto.InternalMessageInfo + +func (m *MsgSubmitProof) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +func (m *MsgSubmitProof) GetSessionHeader() *types1.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *MsgSubmitProof) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +type MsgSubmitProofResponse struct { + Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *MsgSubmitProofResponse) Reset() { *m = MsgSubmitProofResponse{} } +func (m *MsgSubmitProofResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProofResponse) ProtoMessage() {} +func (*MsgSubmitProofResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_345e95e87511f6a6, []int{7} +} +func (m *MsgSubmitProofResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgSubmitProofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProofResponse.Merge(m, src) +} +func (m *MsgSubmitProofResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProofResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProofResponse proto.InternalMessageInfo + +func (m *MsgSubmitProofResponse) GetProof() *Proof { + if m != nil { + return m.Proof + } + return nil +} + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.proof.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.proof.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.proof.MsgUpdateParam") + proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.proof.MsgUpdateParamResponse") + proto.RegisterType((*MsgCreateClaim)(nil), "poktroll.proof.MsgCreateClaim") + proto.RegisterType((*MsgCreateClaimResponse)(nil), "poktroll.proof.MsgCreateClaimResponse") + proto.RegisterType((*MsgSubmitProof)(nil), "poktroll.proof.MsgSubmitProof") + proto.RegisterType((*MsgSubmitProofResponse)(nil), "poktroll.proof.MsgSubmitProofResponse") +} + +func init() { proto.RegisterFile("poktroll/proof/tx.proto", fileDescriptor_345e95e87511f6a6) } + +var fileDescriptor_345e95e87511f6a6 = []byte{ + // 792 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x41, 0x4f, 0xdb, 0x48, + 0x14, 0x8e, 0xc3, 0x12, 0xe2, 0x49, 0xc8, 0x6a, 0x2d, 0x96, 0x38, 0x61, 0xd7, 0x89, 0x72, 0xd8, + 0xcd, 0xb2, 0x8b, 0x2d, 0x60, 0x85, 0xb4, 0xdc, 0x08, 0x5a, 0x94, 0x4a, 0x45, 0x45, 0xa6, 0x48, + 0x55, 0x2f, 0xd6, 0x24, 0x19, 0x12, 0x8b, 0xd8, 0x63, 0xcd, 0x4c, 0x28, 0xdc, 0xaa, 0x1e, 0x7b, + 0xea, 0xcf, 0xe8, 0x91, 0x43, 0x2f, 0xfd, 0x07, 0x1c, 0x51, 0x4f, 0x9c, 0xa2, 0x2a, 0x54, 0x42, + 0x85, 0x3f, 0x51, 0x79, 0x66, 0xe2, 0x38, 0x69, 0x80, 0xaa, 0xa7, 0x5e, 0xe2, 0x99, 0xf7, 0x7d, + 0xf3, 0xe5, 0xbd, 0xef, 0x3d, 0x8f, 0x41, 0x3e, 0xc0, 0x47, 0x8c, 0xe0, 0x6e, 0xd7, 0x0a, 0x08, + 0xc6, 0x87, 0x16, 0x3b, 0x31, 0x03, 0x82, 0x19, 0xd6, 0x72, 0x43, 0xc0, 0xe4, 0x40, 0xf1, 0x17, + 0xe8, 0xb9, 0x3e, 0xb6, 0xf8, 0xaf, 0xa0, 0x14, 0x8d, 0x26, 0xa6, 0x1e, 0xa6, 0x56, 0x03, 0x52, + 0x64, 0x1d, 0xaf, 0x36, 0x10, 0x83, 0xab, 0x56, 0x13, 0xbb, 0xbe, 0xc4, 0xf3, 0x12, 0xf7, 0x68, + 0xdb, 0x3a, 0x5e, 0x0d, 0x1f, 0x12, 0x28, 0x08, 0xc0, 0xe1, 0x3b, 0x4b, 0x6c, 0x24, 0xb4, 0xd0, + 0xc6, 0x6d, 0x2c, 0xe2, 0xe1, 0x4a, 0x46, 0x97, 0x26, 0xb2, 0x0c, 0x20, 0x81, 0xde, 0xf0, 0x48, + 0x71, 0xb2, 0x84, 0xd3, 0x00, 0x0d, 0xb1, 0xdf, 0x22, 0x8c, 0x22, 0x4a, 0x5d, 0xec, 0x8f, 0xa1, + 0xbf, 0x8f, 0xd0, 0x0e, 0x24, 0xa8, 0x65, 0x51, 0x44, 0x8e, 0xdd, 0x26, 0x12, 0x70, 0xe5, 0xbd, + 0x02, 0x7e, 0xde, 0xa5, 0xed, 0x83, 0xa0, 0x05, 0x19, 0xda, 0xe3, 0x7f, 0xa9, 0x6d, 0x00, 0x15, + 0xf6, 0x58, 0x07, 0x13, 0x97, 0x9d, 0xea, 0x4a, 0x59, 0xa9, 0xaa, 0x35, 0xfd, 0xc3, 0xbb, 0x95, + 0x05, 0x59, 0xc4, 0x56, 0xab, 0x45, 0x10, 0xa5, 0xfb, 0x8c, 0xb8, 0x7e, 0xdb, 0x1e, 0x51, 0xb5, + 0xff, 0x40, 0x4a, 0x24, 0xad, 0x27, 0xcb, 0x4a, 0x35, 0xb3, 0xb6, 0x68, 0x8e, 0xfb, 0x6b, 0x0a, + 0xfd, 0x9a, 0x7a, 0xde, 0x2f, 0x25, 0xde, 0x5e, 0x9f, 0x2d, 0x2b, 0xb6, 0x3c, 0xb0, 0xb9, 0xfe, + 0xea, 0xfa, 0x6c, 0x79, 0x24, 0xf5, 0xfa, 0xfa, 0x6c, 0xb9, 0x1c, 0x25, 0x7e, 0x22, 0x8b, 0x9e, + 0xc8, 0xb3, 0x52, 0x00, 0xf9, 0x89, 0x90, 0x8d, 0x68, 0x80, 0x7d, 0x8a, 0x2a, 0x9f, 0x93, 0x20, + 0x37, 0x8e, 0x7d, 0x77, 0x55, 0x1a, 0xf8, 0xc9, 0x87, 0x1e, 0xe2, 0x35, 0xa9, 0x36, 0x5f, 0x6b, + 0xff, 0x00, 0x15, 0x52, 0x87, 0x72, 0xae, 0x3e, 0xc3, 0xb5, 0xe6, 0x6f, 0xfa, 0xa5, 0x51, 0xb0, + 0x9e, 0xb0, 0xd3, 0x50, 0x8a, 0x69, 0x7f, 0x81, 0x34, 0xa4, 0x8e, 0xeb, 0xb3, 0x8d, 0x7f, 0xf5, + 0x54, 0x59, 0xa9, 0xce, 0xd4, 0xb2, 0x37, 0xfd, 0x52, 0x14, 0xab, 0x27, 0xec, 0x39, 0x48, 0x1f, + 0x85, 0x4b, 0x49, 0x6d, 0x9c, 0x32, 0x44, 0xf5, 0xb9, 0xb2, 0x52, 0xcd, 0x46, 0x54, 0x1e, 0x13, + 0xd4, 0x5a, 0xb8, 0x94, 0xd4, 0xc3, 0x2e, 0x86, 0x4c, 0x4f, 0x97, 0x95, 0x6a, 0x32, 0xa2, 0xf2, + 0x98, 0xa0, 0xee, 0x84, 0x4b, 0x6d, 0x0b, 0xcc, 0x41, 0xea, 0x84, 0x53, 0xab, 0xab, 0xbc, 0x33, + 0x05, 0x53, 0x56, 0x1d, 0x8e, 0xb5, 0x29, 0xc7, 0xda, 0xdc, 0xc6, 0xae, 0x5f, 0xcb, 0xdc, 0xf4, + 0x4b, 0x43, 0x76, 0x3d, 0x61, 0xa7, 0x20, 0x0d, 0xc3, 0x9b, 0xb9, 0xf1, 0x06, 0xd5, 0x54, 0x2e, + 0x19, 0x0e, 0x5a, 0xa5, 0x0e, 0x16, 0xc7, 0xad, 0x1e, 0x76, 0x41, 0x33, 0xa3, 0x81, 0x50, 0xee, + 0x1b, 0x88, 0xe1, 0x14, 0x54, 0x6e, 0x15, 0xde, 0xb5, 0x6d, 0x82, 0x20, 0x43, 0xdb, 0x5d, 0xe8, + 0x7a, 0xda, 0x53, 0x50, 0xa0, 0xbd, 0x20, 0xe8, 0xba, 0x88, 0x38, 0x38, 0x40, 0x04, 0x32, 0x4c, + 0x1c, 0x28, 0x7a, 0xf5, 0x60, 0x17, 0xf3, 0xc3, 0xa3, 0x4f, 0xe4, 0x49, 0x09, 0x6b, 0x3b, 0x20, + 0x27, 0xdf, 0x15, 0xa7, 0x83, 0x60, 0x0b, 0x11, 0x39, 0xb1, 0xa5, 0x51, 0x82, 0x12, 0x37, 0xf7, + 0xc5, 0xb3, 0xce, 0x69, 0xf6, 0x3c, 0x8d, 0x6f, 0xb5, 0x25, 0xa0, 0x12, 0x8c, 0x99, 0xd3, 0x81, + 0xb4, 0xc3, 0xe7, 0x20, 0x6b, 0xa7, 0xc3, 0x40, 0x1d, 0xd2, 0xce, 0xa6, 0x11, 0x5a, 0x76, 0x77, + 0xf6, 0x95, 0xff, 0xb9, 0x6f, 0xb1, 0x62, 0x23, 0xdf, 0xfe, 0x06, 0xb3, 0xcd, 0x30, 0x20, 0x6d, + 0xfb, 0x75, 0xd2, 0x36, 0xc1, 0x16, 0x9c, 0xca, 0x27, 0x61, 0xda, 0x7e, 0xaf, 0xe1, 0xb9, 0x6c, + 0x2f, 0xc4, 0x7f, 0x70, 0xd3, 0x16, 0xc0, 0x2c, 0x2f, 0x43, 0x1a, 0x26, 0x36, 0xdf, 0xe8, 0x56, + 0xac, 0xca, 0xb8, 0x5b, 0x42, 0xef, 0x0e, 0xb7, 0x04, 0x5b, 0x70, 0xd6, 0x6e, 0x93, 0x60, 0x66, + 0x97, 0xb6, 0xb5, 0x67, 0x20, 0x3b, 0x76, 0xe7, 0x95, 0x26, 0x4f, 0x4d, 0xdc, 0x2c, 0xc5, 0x3f, + 0x1f, 0x20, 0x44, 0xe9, 0x1c, 0x80, 0x4c, 0x7c, 0x80, 0x8d, 0x29, 0xe7, 0x62, 0x78, 0xf1, 0x8f, + 0xfb, 0xf1, 0xb8, 0x6c, 0xbc, 0xc5, 0xd3, 0x64, 0x63, 0xf8, 0x54, 0xd9, 0x69, 0xe6, 0x1d, 0x80, + 0x4c, 0xfc, 0x92, 0x34, 0xee, 0xaf, 0x72, 0xaa, 0xec, 0x94, 0x37, 0xbf, 0x38, 0xfb, 0x32, 0xbc, + 0xde, 0x6b, 0x8f, 0xcf, 0x07, 0x86, 0x72, 0x31, 0x30, 0x94, 0xcb, 0x81, 0xa1, 0x7c, 0x1c, 0x18, + 0xca, 0x9b, 0x2b, 0x23, 0x71, 0x71, 0x65, 0x24, 0x2e, 0xaf, 0x8c, 0xc4, 0x73, 0xb3, 0xed, 0xb2, + 0x4e, 0xaf, 0x61, 0x36, 0xb1, 0x67, 0x85, 0xb2, 0x2b, 0x3e, 0x62, 0x2f, 0x30, 0x39, 0xb2, 0xbe, + 0xba, 0xf9, 0xf9, 0x07, 0xad, 0x91, 0xe2, 0x9f, 0xac, 0xf5, 0x2f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xea, 0x29, 0x29, 0xa7, 0xd0, 0x07, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) + SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateClaim(ctx context.Context, in *MsgCreateClaim, opts ...grpc.CallOption) (*MsgCreateClaimResponse, error) { + out := new(MsgCreateClaimResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/CreateClaim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SubmitProof(ctx context.Context, in *MsgSubmitProof, opts ...grpc.CallOption) (*MsgSubmitProofResponse, error) { + out := new(MsgSubmitProofResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/SubmitProof", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, "/poktroll.proof.Msg/UpdateParam", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + CreateClaim(context.Context, *MsgCreateClaim) (*MsgCreateClaimResponse, error) + SubmitProof(context.Context, *MsgSubmitProof) (*MsgSubmitProofResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) CreateClaim(ctx context.Context, req *MsgCreateClaim) (*MsgCreateClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClaim not implemented") +} +func (*UnimplementedMsgServer) SubmitProof(ctx context.Context, req *MsgSubmitProof) (*MsgSubmitProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProof not implemented") +} +func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Msg/CreateClaim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClaim(ctx, req.(*MsgCreateClaim)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SubmitProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Msg/SubmitProof", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProof(ctx, req.(*MsgSubmitProof)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.proof.Msg/UpdateParam", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.proof.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "CreateClaim", + Handler: _Msg_CreateClaim_Handler, + }, + { + MethodName: "SubmitProof", + Handler: _Msg_SubmitProof_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/proof/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AsType != nil { + { + size := m.AsType.Size() + i -= size + if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.AsString) + copy(dAtA[i:], m.AsString) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AsBytes != nil { + i -= len(m.AsBytes) + copy(dAtA[i:], m.AsBytes) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsFloat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsFloat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.AsFloat)))) + i-- + dAtA[i] = 0x45 + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsCoin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AsCoin != nil { + { + size, err := m.AsCoin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateClaim) 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 *MsgCreateClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RootHash) > 0 { + i -= len(m.RootHash) + copy(dAtA[i:], m.RootHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.RootHash))) + i-- + dAtA[i] = 0x1a + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateClaimResponse) 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 *MsgCreateClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitProof) 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 *MsgSubmitProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x1a + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitProofResponse) 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 *MsgSubmitProofResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AsType != nil { + n += m.AsType.Size() + } + return n +} + +func (m *MsgUpdateParam_AsString) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AsString) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgUpdateParam_AsInt64) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.AsInt64)) + return n +} +func (m *MsgUpdateParam_AsBytes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsBytes != nil { + l = len(m.AsBytes) + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUpdateParam_AsFloat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 5 + return n +} +func (m *MsgUpdateParam_AsCoin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsCoin != nil { + l = m.AsCoin.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUpdateParamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RootHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitProofResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParam) 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 ErrIntOverflowTx + } + 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: MsgUpdateParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AsType = &MsgUpdateParam_AsInt64{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.AsType = &MsgUpdateParam_AsBytes{v} + iNdEx = postIndex + case 8: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field AsFloat", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.AsType = &MsgUpdateParam_AsFloat{float32(math.Float32frombits(v))} + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.Coin{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.AsType = &MsgUpdateParam_AsCoin{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClaim) 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 ErrIntOverflowTx + } + 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: MsgCreateClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types1.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) + if m.RootHash == nil { + m.RootHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClaimResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitProof) 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 ErrIntOverflowTx + } + 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: MsgSubmitProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types1.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitProofResponse) 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 ErrIntOverflowTx + } + 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: MsgSubmitProofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &Proof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/proof/types/types.pb.go b/x/proof/types/types.pb.go new file mode 100644 index 000000000..52230cff6 --- /dev/null +++ b/x/proof/types/types.pb.go @@ -0,0 +1,791 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/proof/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/session/types" + 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 + +type ProofRequirementReason int32 + +const ( + ProofRequirementReason_NOT_REQUIRED ProofRequirementReason = 0 + ProofRequirementReason_PROBABILISTIC ProofRequirementReason = 1 + ProofRequirementReason_THRESHOLD ProofRequirementReason = 2 +) + +var ProofRequirementReason_name = map[int32]string{ + 0: "NOT_REQUIRED", + 1: "PROBABILISTIC", + 2: "THRESHOLD", +} + +var ProofRequirementReason_value = map[string]int32{ + "NOT_REQUIRED": 0, + "PROBABILISTIC": 1, + "THRESHOLD": 2, +} + +func (x ProofRequirementReason) String() string { + return proto.EnumName(ProofRequirementReason_name, int32(x)) +} + +func (ProofRequirementReason) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b75ef15dfd4d6998, []int{0} +} + +type ClaimProofStage int32 + +const ( + ClaimProofStage_CLAIMED ClaimProofStage = 0 + ClaimProofStage_PROVEN ClaimProofStage = 1 + ClaimProofStage_SETTLED ClaimProofStage = 2 + ClaimProofStage_EXPIRED ClaimProofStage = 3 +) + +var ClaimProofStage_name = map[int32]string{ + 0: "CLAIMED", + 1: "PROVEN", + 2: "SETTLED", + 3: "EXPIRED", +} + +var ClaimProofStage_value = map[string]int32{ + "CLAIMED": 0, + "PROVEN": 1, + "SETTLED": 2, + "EXPIRED": 3, +} + +func (x ClaimProofStage) String() string { + return proto.EnumName(ClaimProofStage_name, int32(x)) +} + +func (ClaimProofStage) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b75ef15dfd4d6998, []int{1} +} + +type Proof struct { + // Address of the supplier's operator that submitted this proof. + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + // The session header of the session that this claim is for. + SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + // The serialized SMST proof from the `#ClosestProof()` method. + ClosestMerkleProof []byte `protobuf:"bytes,3,opt,name=closest_merkle_proof,json=closestMerkleProof,proto3" json:"closest_merkle_proof,omitempty"` +} + +func (m *Proof) Reset() { *m = Proof{} } +func (m *Proof) String() string { return proto.CompactTextString(m) } +func (*Proof) ProtoMessage() {} +func (*Proof) Descriptor() ([]byte, []int) { + return fileDescriptor_b75ef15dfd4d6998, []int{0} +} +func (m *Proof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Proof) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proof.Merge(m, src) +} +func (m *Proof) XXX_Size() int { + return m.Size() +} +func (m *Proof) XXX_DiscardUnknown() { + xxx_messageInfo_Proof.DiscardUnknown(m) +} + +var xxx_messageInfo_Proof proto.InternalMessageInfo + +func (m *Proof) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +func (m *Proof) GetSessionHeader() *types.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *Proof) GetClosestMerkleProof() []byte { + if m != nil { + return m.ClosestMerkleProof + } + return nil +} + +// Claim is the serialized object stored on-chain for claims pending to be proven +type Claim struct { + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + // The session header of the session that this claim is for. + SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + // Root hash returned from smt.SMST#Root(). + RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` +} + +func (m *Claim) Reset() { *m = Claim{} } +func (m *Claim) String() string { return proto.CompactTextString(m) } +func (*Claim) ProtoMessage() {} +func (*Claim) Descriptor() ([]byte, []int) { + return fileDescriptor_b75ef15dfd4d6998, []int{1} +} +func (m *Claim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Claim) XXX_Merge(src proto.Message) { + xxx_messageInfo_Claim.Merge(m, src) +} +func (m *Claim) XXX_Size() int { + return m.Size() +} +func (m *Claim) XXX_DiscardUnknown() { + xxx_messageInfo_Claim.DiscardUnknown(m) +} + +var xxx_messageInfo_Claim proto.InternalMessageInfo + +func (m *Claim) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +func (m *Claim) GetSessionHeader() *types.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *Claim) GetRootHash() []byte { + if m != nil { + return m.RootHash + } + return nil +} + +func init() { + proto.RegisterEnum("poktroll.proof.ProofRequirementReason", ProofRequirementReason_name, ProofRequirementReason_value) + proto.RegisterEnum("poktroll.proof.ClaimProofStage", ClaimProofStage_name, ClaimProofStage_value) + proto.RegisterType((*Proof)(nil), "poktroll.proof.Proof") + proto.RegisterType((*Claim)(nil), "poktroll.proof.Claim") +} + +func init() { proto.RegisterFile("poktroll/proof/types.proto", fileDescriptor_b75ef15dfd4d6998) } + +var fileDescriptor_b75ef15dfd4d6998 = []byte{ + // 452 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xb3, 0xa9, 0x5a, 0xc8, 0xb6, 0x29, 0x66, 0x15, 0x41, 0x1a, 0x90, 0x89, 0x7a, 0x8a, + 0x2a, 0xd5, 0x46, 0xf0, 0x04, 0xf9, 0x63, 0x14, 0x4b, 0x6e, 0x1d, 0xd6, 0x06, 0x21, 0x2e, 0x96, + 0x9b, 0x2c, 0xb6, 0x15, 0xdb, 0x63, 0x76, 0x37, 0x02, 0xde, 0x82, 0x87, 0xe1, 0x09, 0x38, 0x71, + 0xac, 0xb8, 0xd0, 0x23, 0x72, 0x5e, 0x04, 0x79, 0xed, 0x46, 0x79, 0x04, 0x4e, 0xf6, 0xcc, 0x6f, + 0xe6, 0x9b, 0xfd, 0x46, 0x83, 0x07, 0x05, 0xac, 0x25, 0x87, 0x34, 0x35, 0x0b, 0x0e, 0xf0, 0xc9, + 0x94, 0xdf, 0x0a, 0x26, 0x8c, 0x82, 0x83, 0x04, 0x72, 0x7a, 0xcf, 0x0c, 0xc5, 0x06, 0x67, 0x4b, + 0x10, 0x19, 0x88, 0x40, 0x51, 0xb3, 0x0e, 0xea, 0xd2, 0xc1, 0xf3, 0x9d, 0x8c, 0x60, 0x42, 0x24, + 0x90, 0xef, 0x0b, 0x0d, 0x7a, 0x11, 0x44, 0x50, 0x77, 0x55, 0x7f, 0x75, 0xf6, 0xfc, 0x0f, 0xc2, + 0x87, 0x8b, 0x4a, 0x98, 0xf8, 0xf8, 0x4c, 0x6c, 0x8a, 0x22, 0x4d, 0x18, 0x0f, 0xa0, 0x60, 0x3c, + 0x94, 0xc0, 0x83, 0x70, 0xb5, 0xe2, 0x4c, 0x88, 0x3e, 0x1a, 0xa2, 0x51, 0x67, 0xd2, 0xff, 0xfd, + 0xe3, 0xb2, 0xd7, 0x8c, 0x1c, 0xd7, 0xc4, 0x93, 0x3c, 0xc9, 0x23, 0xfa, 0xf4, 0xbe, 0xd5, 0x6d, + 0x3a, 0x1b, 0x4c, 0xde, 0xe0, 0xd3, 0xe6, 0x31, 0x41, 0xcc, 0xc2, 0x15, 0xe3, 0xfd, 0xf6, 0x10, + 0x8d, 0x8e, 0x5f, 0xbd, 0x30, 0x76, 0xbe, 0x1a, 0x6e, 0x78, 0xf5, 0x77, 0xae, 0xca, 0x68, 0x57, + 0xec, 0x87, 0xe4, 0x25, 0xee, 0x2d, 0x53, 0x10, 0x4c, 0xc8, 0x20, 0x63, 0x7c, 0x9d, 0xb2, 0x40, + 0xad, 0xa3, 0x7f, 0x30, 0x44, 0xa3, 0x13, 0x4a, 0x1a, 0x76, 0xa5, 0x90, 0xf2, 0x73, 0xfe, 0x13, + 0xe1, 0xc3, 0x69, 0x1a, 0x26, 0xd9, 0x7f, 0xee, 0xec, 0x19, 0xee, 0x70, 0x00, 0x19, 0xc4, 0xa1, + 0x88, 0x1b, 0x3b, 0x0f, 0xab, 0xc4, 0x3c, 0x14, 0xf1, 0x85, 0x83, 0x9f, 0x28, 0x37, 0x94, 0x7d, + 0xde, 0x24, 0x9c, 0x65, 0x2c, 0x97, 0x94, 0x85, 0x02, 0x72, 0xa2, 0xe1, 0x93, 0x6b, 0xd7, 0x0f, + 0xa8, 0xf5, 0xf6, 0x9d, 0x4d, 0xad, 0x99, 0xd6, 0x22, 0x8f, 0x71, 0x77, 0x41, 0xdd, 0xc9, 0x78, + 0x62, 0x3b, 0xb6, 0xe7, 0xdb, 0x53, 0x0d, 0x91, 0x2e, 0xee, 0xf8, 0x73, 0x6a, 0x79, 0x73, 0xd7, + 0x99, 0x69, 0xed, 0x8b, 0x19, 0x7e, 0xa4, 0x36, 0xa2, 0x24, 0x3d, 0x19, 0x46, 0x8c, 0x1c, 0xe3, + 0x07, 0x53, 0x67, 0x6c, 0x5f, 0x29, 0x05, 0x8c, 0x8f, 0x16, 0xd4, 0x7d, 0x6f, 0x5d, 0x6b, 0xa8, + 0x02, 0x9e, 0xe5, 0xfb, 0x8e, 0x35, 0xd3, 0xda, 0x55, 0x60, 0x7d, 0x58, 0xa8, 0x39, 0x07, 0x13, + 0xe7, 0x57, 0xa9, 0xa3, 0xdb, 0x52, 0x47, 0x77, 0xa5, 0x8e, 0xfe, 0x96, 0x3a, 0xfa, 0xbe, 0xd5, + 0x5b, 0xb7, 0x5b, 0xbd, 0x75, 0xb7, 0xd5, 0x5b, 0x1f, 0x8d, 0x28, 0x91, 0xf1, 0xe6, 0xc6, 0x58, + 0x42, 0x66, 0x56, 0x8b, 0xb8, 0xcc, 0x99, 0xfc, 0x02, 0x7c, 0x6d, 0xee, 0x8e, 0xf3, 0xeb, 0xfe, + 0x95, 0xdf, 0x1c, 0xa9, 0x3b, 0x7c, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x74, 0x9b, 0x7a, 0x80, + 0x04, 0x03, 0x00, 0x00, +} + +func (m *Proof) 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 *Proof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClosestMerkleProof) > 0 { + i -= len(m.ClosestMerkleProof) + copy(dAtA[i:], m.ClosestMerkleProof) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClosestMerkleProof))) + i-- + dAtA[i] = 0x1a + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Claim) 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 *Claim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RootHash) > 0 { + i -= len(m.RootHash) + copy(dAtA[i:], m.RootHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RootHash))) + i-- + dAtA[i] = 0x1a + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Proof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ClosestMerkleProof) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Claim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.RootHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Proof) 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 ErrIntOverflowTypes + } + 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: Proof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClosestMerkleProof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClosestMerkleProof = append(m.ClosestMerkleProof[:0], dAtA[iNdEx:postIndex]...) + if m.ClosestMerkleProof == nil { + m.ClosestMerkleProof = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Claim) 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 ErrIntOverflowTypes + } + 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: Claim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) + if m.RootHash == nil { + m.RootHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/genesis.pb.go b/x/service/types/genesis.pb.go new file mode 100644 index 000000000..1385a8f50 --- /dev/null +++ b/x/service/types/genesis.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// GenesisState defines the service module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ServiceList []types.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_b6c2ff81e712a1a4, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetServiceList() []types.Service { + if m != nil { + return m.ServiceList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.service.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/service/genesis.proto", fileDescriptor_b6c2ff81e712a1a4) } + +var fileDescriptor_b6c2ff81e712a1a4 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x4f, 0x4f, 0xcd, + 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, + 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, + 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, + 0xcc, 0x2d, 0xc6, 0x94, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0xa9, 0x82, 0x48, 0x2b, 0xf5, 0x31, + 0x72, 0xf1, 0xb8, 0x43, 0x9c, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcd, 0xc5, 0x06, 0xd1, + 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0xee, 0x34, 0xbd, 0x00, 0xb0, 0xbc, + 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0x6a, 0x11, 0x72, + 0xe4, 0xe2, 0x81, 0x2a, 0x8a, 0xcf, 0xc9, 0x2c, 0x2e, 0x91, 0x60, 0x52, 0x60, 0x46, 0x33, 0x02, + 0xec, 0x06, 0xbd, 0x60, 0x88, 0x22, 0x27, 0x16, 0x90, 0x11, 0x41, 0xdc, 0x50, 0x3d, 0x3e, 0x99, + 0xc5, 0x25, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, + 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, + 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, + 0x50, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0xb8, 0x2f, 0x2b, 0xe0, 0xc1, 0x50, + 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xa7, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xcb, + 0x1e, 0x0f, 0xf5, 0x82, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ServiceList) > 0 { + for iNdEx := len(m.ServiceList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ServiceList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.ServiceList) > 0 { + for _, e := range m.ServiceList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceList", 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.ServiceList = append(m.ServiceList, types.Service{}) + if err := m.ServiceList[len(m.ServiceList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/params.pb.go b/x/service/types/params.pb.go new file mode 100644 index 000000000..8a12bc9f0 --- /dev/null +++ b/x/service/types/params.pb.go @@ -0,0 +1,358 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/params.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { + // The amount of uPOKT required to add a new service. + // This will be deducted from the signer's account balance, + // and transferred to the pocket network foundation. + AddServiceFee *types.Coin `protobuf:"bytes,1,opt,name=add_service_fee,json=addServiceFee,proto3" json:"add_service_fee" yaml:"add_service_fee"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_69b5d0104478b383, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetAddServiceFee() *types.Coin { + if m != nil { + return m.AddServiceFee + } + return nil +} + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.service.Params") +} + +func init() { proto.RegisterFile("poktroll/service/params.proto", fileDescriptor_69b5d0104478b383) } + +var fileDescriptor_69b5d0104478b383 = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, + 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, + 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, + 0x93, 0x12, 0x8b, 0x53, 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, 0x12, 0x0d, 0xf5, 0x93, 0xf3, 0x33, + 0xf3, 0x20, 0xf2, 0x4a, 0xf3, 0x18, 0xb9, 0xd8, 0x02, 0xc0, 0x76, 0x09, 0x15, 0x70, 0xf1, 0x27, + 0xa6, 0xa4, 0xc4, 0x43, 0xad, 0x88, 0x4f, 0x4b, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, + 0x92, 0xd4, 0x83, 0x18, 0xa2, 0x07, 0x32, 0x44, 0x0f, 0x6a, 0x88, 0x9e, 0x73, 0x7e, 0x66, 0x9e, + 0x93, 0xee, 0xab, 0x7b, 0xf2, 0xe8, 0xba, 0x3e, 0xdd, 0x93, 0x17, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, + 0x52, 0x42, 0x93, 0x50, 0x0a, 0xe2, 0x4d, 0x4c, 0x49, 0x09, 0x86, 0x08, 0xb8, 0xa5, 0xa6, 0x5a, + 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xff, 0x15, 0xf0, 0x10, + 0x80, 0xb8, 0xca, 0xc9, 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, + 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, + 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, + 0x99, 0xa1, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0xc5, 0xc0, 0x92, 0xca, 0x82, + 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xbf, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x60, 0xd1, + 0x42, 0x73, 0x01, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.AddServiceFee.Equal(that1.AddServiceFee) { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddServiceFee != nil { + { + size, err := m.AddServiceFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddServiceFee != nil { + l = m.AddServiceFee.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddServiceFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddServiceFee == nil { + m.AddServiceFee = &types.Coin{} + } + if err := m.AddServiceFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/query.pb.go b/x/service/types/query.pb.go new file mode 100644 index 000000000..15c598d4e --- /dev/null +++ b/x/service/types/query.pb.go @@ -0,0 +1,1366 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetServiceRequest struct { + // TODO_IMPROVE: We could support getting services by name. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryGetServiceRequest) Reset() { *m = QueryGetServiceRequest{} } +func (m *QueryGetServiceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetServiceRequest) ProtoMessage() {} +func (*QueryGetServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{2} +} +func (m *QueryGetServiceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetServiceRequest.Merge(m, src) +} +func (m *QueryGetServiceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetServiceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetServiceRequest proto.InternalMessageInfo + +func (m *QueryGetServiceRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryGetServiceResponse struct { + Service types.Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service"` +} + +func (m *QueryGetServiceResponse) Reset() { *m = QueryGetServiceResponse{} } +func (m *QueryGetServiceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetServiceResponse) ProtoMessage() {} +func (*QueryGetServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{3} +} +func (m *QueryGetServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetServiceResponse.Merge(m, src) +} +func (m *QueryGetServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetServiceResponse proto.InternalMessageInfo + +func (m *QueryGetServiceResponse) GetService() types.Service { + if m != nil { + return m.Service + } + return types.Service{} +} + +type QueryAllServicesRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllServicesRequest) Reset() { *m = QueryAllServicesRequest{} } +func (m *QueryAllServicesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllServicesRequest) ProtoMessage() {} +func (*QueryAllServicesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{4} +} +func (m *QueryAllServicesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllServicesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllServicesRequest.Merge(m, src) +} +func (m *QueryAllServicesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllServicesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllServicesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllServicesRequest proto.InternalMessageInfo + +func (m *QueryAllServicesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllServicesResponse struct { + Service []types.Service `protobuf:"bytes,1,rep,name=service,proto3" json:"service"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllServicesResponse) Reset() { *m = QueryAllServicesResponse{} } +func (m *QueryAllServicesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllServicesResponse) ProtoMessage() {} +func (*QueryAllServicesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{5} +} +func (m *QueryAllServicesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllServicesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllServicesResponse.Merge(m, src) +} +func (m *QueryAllServicesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllServicesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllServicesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllServicesResponse proto.InternalMessageInfo + +func (m *QueryAllServicesResponse) GetService() []types.Service { + if m != nil { + return m.Service + } + return nil +} + +func (m *QueryAllServicesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.service.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.service.QueryParamsResponse") + proto.RegisterType((*QueryGetServiceRequest)(nil), "poktroll.service.QueryGetServiceRequest") + proto.RegisterType((*QueryGetServiceResponse)(nil), "poktroll.service.QueryGetServiceResponse") + proto.RegisterType((*QueryAllServicesRequest)(nil), "poktroll.service.QueryAllServicesRequest") + proto.RegisterType((*QueryAllServicesResponse)(nil), "poktroll.service.QueryAllServicesResponse") +} + +func init() { proto.RegisterFile("poktroll/service/query.proto", fileDescriptor_cc8a7bc9eee3e426) } + +var fileDescriptor_cc8a7bc9eee3e426 = []byte{ + // 517 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x29, 0xa4, 0xea, 0x55, 0x42, 0x70, 0x54, 0x10, 0x59, 0xc5, 0x20, 0x8b, 0xb6, + 0x21, 0x28, 0x77, 0xb4, 0x5d, 0x90, 0x98, 0xc8, 0x40, 0x37, 0x54, 0xdc, 0x8d, 0xed, 0x92, 0x9c, + 0xdc, 0x53, 0x1d, 0x9f, 0xeb, 0xbb, 0x14, 0x2a, 0xc4, 0x82, 0xf8, 0x00, 0x48, 0x65, 0x65, 0x67, + 0x64, 0xe7, 0x0b, 0x74, 0xac, 0xc4, 0xd2, 0x09, 0xa1, 0x04, 0x89, 0xaf, 0x81, 0x7c, 0xf7, 0x0c, + 0x29, 0xae, 0x95, 0xb0, 0x24, 0x96, 0xdf, 0xff, 0xfd, 0xff, 0xbf, 0xbb, 0xf7, 0x64, 0xbc, 0x9a, + 0xaa, 0x03, 0x93, 0xa9, 0x38, 0x66, 0x5a, 0x64, 0x47, 0xb2, 0x2f, 0xd8, 0xe1, 0x48, 0x64, 0xc7, + 0x34, 0xcd, 0x94, 0x51, 0xe4, 0x7a, 0x51, 0xa5, 0x50, 0xf5, 0x6e, 0xf0, 0xa1, 0x4c, 0x14, 0xb3, + 0xbf, 0x4e, 0xe4, 0xad, 0x44, 0x2a, 0x52, 0xf6, 0x91, 0xe5, 0x4f, 0xf0, 0x76, 0x35, 0x52, 0x2a, + 0x8a, 0x05, 0xe3, 0xa9, 0x64, 0x3c, 0x49, 0x94, 0xe1, 0x46, 0xaa, 0x44, 0x43, 0xb5, 0xdd, 0x57, + 0x7a, 0xa8, 0x34, 0xeb, 0x71, 0x0d, 0x89, 0xec, 0x68, 0xb3, 0x27, 0x0c, 0xdf, 0x64, 0x29, 0x8f, + 0x64, 0x62, 0xc5, 0xa0, 0xbd, 0x53, 0x42, 0x4c, 0x79, 0xc6, 0x87, 0xba, 0x5c, 0xde, 0xe7, 0x99, + 0x18, 0x14, 0x2a, 0x57, 0x0e, 0x56, 0x30, 0x79, 0x91, 0xfb, 0xef, 0xda, 0x9e, 0x50, 0x1c, 0x8e, + 0x84, 0x36, 0x41, 0x88, 0x6f, 0x5e, 0x78, 0xab, 0x53, 0x95, 0x68, 0x41, 0x9e, 0xe0, 0x86, 0xf3, + 0x6e, 0xa2, 0x7b, 0xa8, 0xb5, 0xbc, 0xd5, 0xa4, 0xff, 0x5e, 0x00, 0x75, 0x1d, 0xdd, 0xa5, 0xd3, + 0xef, 0x77, 0x6b, 0x9f, 0x7f, 0x7d, 0x69, 0xa3, 0x10, 0x5a, 0x82, 0x16, 0xbe, 0x65, 0x3d, 0x77, + 0x84, 0xd9, 0x73, 0x62, 0x48, 0x23, 0xd7, 0x70, 0x5d, 0x0e, 0xac, 0xe5, 0x52, 0x58, 0x97, 0x83, + 0x60, 0x0f, 0xdf, 0x2e, 0x29, 0x81, 0xe0, 0x31, 0x5e, 0x84, 0xa4, 0x4b, 0x10, 0xec, 0xf9, 0x28, + 0xb4, 0x74, 0xaf, 0xe4, 0x08, 0x61, 0x21, 0x0f, 0x38, 0x98, 0x3e, 0x8d, 0x63, 0x50, 0x14, 0xa7, + 0x25, 0xcf, 0x30, 0xfe, 0x7b, 0xab, 0xe0, 0xbb, 0x4e, 0xdd, 0x08, 0x68, 0x3e, 0x02, 0xea, 0x86, + 0x0e, 0x23, 0xa0, 0xbb, 0x3c, 0x2a, 0xd8, 0xc3, 0xa9, 0xce, 0xe0, 0x13, 0xc2, 0xcd, 0x72, 0xc6, + 0x65, 0xe4, 0x0b, 0xff, 0x41, 0x4e, 0x76, 0x2e, 0xe0, 0xd5, 0x2d, 0xde, 0xc6, 0x4c, 0x3c, 0x17, + 0x3b, 0xcd, 0xb7, 0xf5, 0x75, 0x01, 0x5f, 0xb5, 0x7c, 0xe4, 0x3d, 0xc2, 0x0d, 0x37, 0x29, 0x72, + 0xbf, 0x3c, 0xc3, 0xf2, 0x42, 0x78, 0x6b, 0x33, 0x54, 0x2e, 0x2d, 0xe8, 0xbc, 0xfb, 0xf6, 0xf3, + 0xa4, 0xbe, 0x41, 0xd6, 0x58, 0x2e, 0xef, 0x24, 0xc2, 0xbc, 0x52, 0xd9, 0x01, 0xab, 0xd8, 0x50, + 0x72, 0x82, 0xf0, 0x22, 0x1c, 0x9a, 0xb4, 0x2a, 0x12, 0x4a, 0xeb, 0xe2, 0x3d, 0x98, 0x43, 0x09, + 0x3c, 0xdb, 0x96, 0xa7, 0x43, 0x1e, 0xce, 0xe0, 0x29, 0xfe, 0xdf, 0xc8, 0xc1, 0x5b, 0xf2, 0x11, + 0xe1, 0xe5, 0xa9, 0x09, 0x92, 0xaa, 0xbc, 0xf2, 0x26, 0x79, 0xed, 0x79, 0xa4, 0xc0, 0x46, 0x2d, + 0x5b, 0x8b, 0xac, 0xcf, 0xc7, 0xd6, 0x7d, 0x7e, 0x3a, 0xf6, 0xd1, 0xd9, 0xd8, 0x47, 0xe7, 0x63, + 0x1f, 0xfd, 0x18, 0xfb, 0xe8, 0xc3, 0xc4, 0xaf, 0x9d, 0x4d, 0xfc, 0xda, 0xf9, 0xc4, 0xaf, 0xbd, + 0x7c, 0x14, 0x49, 0xb3, 0x3f, 0xea, 0xd1, 0xbe, 0x1a, 0x56, 0xf8, 0xbd, 0xfe, 0xe3, 0x68, 0x8e, + 0x53, 0xa1, 0x7b, 0x0d, 0xfb, 0x01, 0xd8, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x22, 0x58, 0x15, + 0xda, 0xe3, 0x04, 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 Service items. + Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) + AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.service.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) { + out := new(QueryGetServiceResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Query/Service", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) { + out := new(QueryAllServicesResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Query/AllServices", in, out, opts...) + 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 Service items. + Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) + AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, 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) Service(ctx context.Context, req *QueryGetServiceRequest) (*QueryGetServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") +} +func (*UnimplementedQueryServer) AllServices(ctx context.Context, req *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.service.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 _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Service(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Query/Service", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Service(ctx, req.(*QueryGetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Query/AllServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllServices(ctx, req.(*QueryAllServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.service.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Service", + Handler: _Query_Service_Handler, + }, + { + MethodName: "AllServices", + Handler: _Query_AllServices_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/service/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetServiceRequest) 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 *QueryGetServiceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetServiceResponse) 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 *QueryGetServiceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Service.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 *QueryAllServicesRequest) 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 *QueryAllServicesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllServicesRequest) 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 *QueryAllServicesResponse) 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 *QueryAllServicesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllServicesResponse) 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.Service) > 0 { + for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Service[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 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 *QueryGetServiceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetServiceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Service.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllServicesRequest) 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 *QueryAllServicesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Service) > 0 { + for _, e := range m.Service { + 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 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 *QueryGetServiceRequest) 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: QueryGetServiceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", 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.Id = 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 *QueryGetServiceResponse) 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: QueryGetServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service.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 *QueryAllServicesRequest) 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: QueryAllServicesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllServicesRequest: 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 + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllServicesResponse) 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: QueryAllServicesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service = append(m.Service, types.Service{}) + if err := m.Service[len(m.Service)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/query.pb.gw.go b/x/service/types/query.pb.gw.go new file mode 100644 index 000000000..621e80775 --- /dev/null +++ b/x/service/types/query.pb.gw.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/service/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetServiceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetServiceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.Service(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllServices_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllServices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllServicesRequest + 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_AllServices_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllServices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllServicesRequest + 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_AllServices_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllServices(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Service_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_Service_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_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllServices_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_AllServices_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_AllServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Service_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_Service_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_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllServices_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_AllServices_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_AllServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "service", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "service", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "service"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Service_0 = runtime.ForwardResponseMessage + + forward_Query_AllServices_0 = runtime.ForwardResponseMessage +) diff --git a/x/service/types/relay.pb.go b/x/service/types/relay.pb.go new file mode 100644 index 000000000..305ff1de7 --- /dev/null +++ b/x/service/types/relay.pb.go @@ -0,0 +1,1370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/relay.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/session/types" + 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 + +// Relay contains both the RelayRequest (signed by the Application) and the RelayResponse (signed by the Supplier). +// The serialized tuple is inserted into the SMST leaves as values in the Claim/Proof lifecycle. +type Relay struct { + Req *RelayRequest `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` + Res *RelayResponse `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *Relay) Reset() { *m = Relay{} } +func (m *Relay) String() string { return proto.CompactTextString(m) } +func (*Relay) ProtoMessage() {} +func (*Relay) Descriptor() ([]byte, []int) { + return fileDescriptor_38cf3e40553b40a1, []int{0} +} +func (m *Relay) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Relay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Relay) XXX_Merge(src proto.Message) { + xxx_messageInfo_Relay.Merge(m, src) +} +func (m *Relay) XXX_Size() int { + return m.Size() +} +func (m *Relay) XXX_DiscardUnknown() { + xxx_messageInfo_Relay.DiscardUnknown(m) +} + +var xxx_messageInfo_Relay proto.InternalMessageInfo + +func (m *Relay) GetReq() *RelayRequest { + if m != nil { + return m.Req + } + return nil +} + +func (m *Relay) GetRes() *RelayResponse { + if m != nil { + return m.Res + } + return nil +} + +// RelayRequestMetadata contains the metadata for a RelayRequest. +type RelayRequestMetadata struct { + SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + // The request signature is a serialized ring signature that may have been + // by either the application itself or one of the gateways that the + // application has delegated to. The signature is made using the ring of the + // application in both cases. + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). + // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 + // + // The supplier operator address the relay is sent to. It is being used on the + // RelayMiner to route to the correct supplier. + SupplierOperatorAddress string `protobuf:"bytes,3,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` +} + +func (m *RelayRequestMetadata) Reset() { *m = RelayRequestMetadata{} } +func (m *RelayRequestMetadata) String() string { return proto.CompactTextString(m) } +func (*RelayRequestMetadata) ProtoMessage() {} +func (*RelayRequestMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_38cf3e40553b40a1, []int{1} +} +func (m *RelayRequestMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayRequestMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RelayRequestMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayRequestMetadata.Merge(m, src) +} +func (m *RelayRequestMetadata) XXX_Size() int { + return m.Size() +} +func (m *RelayRequestMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_RelayRequestMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayRequestMetadata proto.InternalMessageInfo + +func (m *RelayRequestMetadata) GetSessionHeader() *types.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *RelayRequestMetadata) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func (m *RelayRequestMetadata) GetSupplierOperatorAddress() string { + if m != nil { + return m.SupplierOperatorAddress + } + return "" +} + +// RelayRequest holds the request details for a relay. +type RelayRequest struct { + Meta RelayRequestMetadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` + // payload is the serialized payload for the request. + // The payload is passed directly to the service and as such can be any + // format that the service supports: JSON-RPC, REST, gRPC, etc. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *RelayRequest) Reset() { *m = RelayRequest{} } +func (m *RelayRequest) String() string { return proto.CompactTextString(m) } +func (*RelayRequest) ProtoMessage() {} +func (*RelayRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_38cf3e40553b40a1, []int{2} +} +func (m *RelayRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RelayRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayRequest.Merge(m, src) +} +func (m *RelayRequest) XXX_Size() int { + return m.Size() +} +func (m *RelayRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RelayRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayRequest proto.InternalMessageInfo + +func (m *RelayRequest) GetMeta() RelayRequestMetadata { + if m != nil { + return m.Meta + } + return RelayRequestMetadata{} +} + +func (m *RelayRequest) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// RelayResponse contains the response details for a RelayRequest. +type RelayResponse struct { + Meta RelayResponseMetadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` + // payload is the serialized payload for the response. + // The payload is passed directly from the service and as such can be any + // format the service responds with: JSON-RPC, REST, gRPC, etc. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *RelayResponse) Reset() { *m = RelayResponse{} } +func (m *RelayResponse) String() string { return proto.CompactTextString(m) } +func (*RelayResponse) ProtoMessage() {} +func (*RelayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_38cf3e40553b40a1, []int{3} +} +func (m *RelayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RelayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayResponse.Merge(m, src) +} +func (m *RelayResponse) XXX_Size() int { + return m.Size() +} +func (m *RelayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RelayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayResponse proto.InternalMessageInfo + +func (m *RelayResponse) GetMeta() RelayResponseMetadata { + if m != nil { + return m.Meta + } + return RelayResponseMetadata{} +} + +func (m *RelayResponse) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// RelayResponseMetadata contains the metadata for a RelayResponse. +type RelayResponseMetadata struct { + SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorSignature []byte `protobuf:"bytes,2,opt,name=supplier_operator_signature,json=supplierOperatorSignature,proto3" json:"supplier_operator_signature,omitempty"` +} + +func (m *RelayResponseMetadata) Reset() { *m = RelayResponseMetadata{} } +func (m *RelayResponseMetadata) String() string { return proto.CompactTextString(m) } +func (*RelayResponseMetadata) ProtoMessage() {} +func (*RelayResponseMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_38cf3e40553b40a1, []int{4} +} +func (m *RelayResponseMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayResponseMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RelayResponseMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayResponseMetadata.Merge(m, src) +} +func (m *RelayResponseMetadata) XXX_Size() int { + return m.Size() +} +func (m *RelayResponseMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_RelayResponseMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayResponseMetadata proto.InternalMessageInfo + +func (m *RelayResponseMetadata) GetSessionHeader() *types.SessionHeader { + if m != nil { + return m.SessionHeader + } + return nil +} + +func (m *RelayResponseMetadata) GetSupplierOperatorSignature() []byte { + if m != nil { + return m.SupplierOperatorSignature + } + return nil +} + +func init() { + proto.RegisterType((*Relay)(nil), "poktroll.service.Relay") + proto.RegisterType((*RelayRequestMetadata)(nil), "poktroll.service.RelayRequestMetadata") + proto.RegisterType((*RelayRequest)(nil), "poktroll.service.RelayRequest") + proto.RegisterType((*RelayResponse)(nil), "poktroll.service.RelayResponse") + proto.RegisterType((*RelayResponseMetadata)(nil), "poktroll.service.RelayResponseMetadata") +} + +func init() { proto.RegisterFile("poktroll/service/relay.proto", fileDescriptor_38cf3e40553b40a1) } + +var fileDescriptor_38cf3e40553b40a1 = []byte{ + // 435 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xf6, 0xd2, 0x02, 0xea, 0xd2, 0x22, 0xb4, 0x0a, 0xc2, 0x29, 0xd5, 0xb6, 0xf2, 0x01, 0x7a, + 0xa9, 0x5d, 0xe0, 0x8e, 0x68, 0x0e, 0x88, 0x0b, 0x20, 0x39, 0x9c, 0xb8, 0x58, 0x9b, 0x78, 0xe4, + 0x98, 0x38, 0xde, 0xcd, 0xee, 0x1a, 0xc8, 0x5b, 0xf0, 0x06, 0xbc, 0x04, 0x0f, 0x91, 0x63, 0x94, + 0x53, 0x4e, 0x08, 0x39, 0x2f, 0x82, 0xbc, 0x5e, 0x07, 0x27, 0xfc, 0x09, 0x89, 0x93, 0x3d, 0xf3, + 0xcd, 0xb7, 0xdf, 0xcc, 0x37, 0x1a, 0x7c, 0x22, 0xf8, 0x58, 0x4b, 0x9e, 0x65, 0x81, 0x02, 0xf9, + 0x3e, 0x1d, 0x42, 0x20, 0x21, 0x63, 0x33, 0x5f, 0x48, 0xae, 0x39, 0xb9, 0xd3, 0xa0, 0xbe, 0x45, + 0x8f, 0xbb, 0x43, 0xae, 0x26, 0x5c, 0x45, 0x06, 0x0f, 0xea, 0xa0, 0x2e, 0x3e, 0xee, 0x24, 0x3c, + 0xe1, 0x75, 0xbe, 0xfa, 0xb3, 0xd9, 0xb6, 0x80, 0x52, 0x29, 0xcf, 0x03, 0x3d, 0x13, 0x60, 0x39, + 0x5e, 0x86, 0xaf, 0x87, 0x95, 0x1e, 0xb9, 0xc4, 0x7b, 0x12, 0xa6, 0x2e, 0x3a, 0x43, 0xe7, 0xb7, + 0x1e, 0x53, 0x7f, 0x57, 0xd7, 0x37, 0x55, 0x21, 0x4c, 0x0b, 0x50, 0x3a, 0xac, 0x4a, 0xc9, 0xa3, + 0x8a, 0xa1, 0xdc, 0x6b, 0x86, 0x71, 0xfa, 0x5b, 0x86, 0x12, 0x3c, 0x57, 0x50, 0x51, 0x94, 0xb7, + 0x44, 0xb8, 0xd3, 0x7e, 0xe8, 0x25, 0x68, 0x16, 0x33, 0xcd, 0xc8, 0x73, 0x7c, 0xdb, 0x76, 0x17, + 0x8d, 0x80, 0xc5, 0x20, 0x6d, 0x23, 0x5b, 0xcf, 0x1a, 0xdc, 0xef, 0xd7, 0xdf, 0x17, 0xa6, 0x2c, + 0x3c, 0x52, 0xed, 0x90, 0x9c, 0xe0, 0x03, 0x95, 0x26, 0x39, 0xd3, 0x85, 0x04, 0xd3, 0xd9, 0x61, + 0xf8, 0x23, 0x41, 0xde, 0xe0, 0xae, 0x2a, 0x84, 0xc8, 0x52, 0x90, 0x11, 0x17, 0x20, 0x99, 0xe6, + 0x32, 0x62, 0x71, 0x2c, 0x41, 0x29, 0x77, 0xef, 0x0c, 0x9d, 0x1f, 0xf4, 0xdc, 0xe5, 0x97, 0x8b, + 0x8e, 0x75, 0xf5, 0xaa, 0x46, 0xfa, 0x5a, 0xa6, 0x79, 0x12, 0xde, 0x6b, 0xa8, 0xaf, 0x2d, 0xd3, + 0xc2, 0xde, 0x3b, 0x7c, 0xd8, 0x9e, 0x89, 0x3c, 0xc3, 0xfb, 0x13, 0xd0, 0xcc, 0x4e, 0xf0, 0xe0, + 0xcf, 0x56, 0x36, 0x0e, 0xf4, 0xf6, 0xe7, 0x5f, 0x4f, 0x9d, 0xd0, 0x30, 0x89, 0x8b, 0x6f, 0x0a, + 0x36, 0xcb, 0x38, 0x8b, 0xed, 0x0c, 0x4d, 0xe8, 0x65, 0xf8, 0x68, 0xcb, 0x56, 0x72, 0xb5, 0x25, + 0xf6, 0xf0, 0x2f, 0x5b, 0xf8, 0x47, 0xb5, 0xcf, 0x08, 0xdf, 0xfd, 0x25, 0xff, 0xbf, 0xed, 0xeb, + 0x29, 0xbe, 0xff, 0xf3, 0x46, 0x76, 0x37, 0xd8, 0xdd, 0x75, 0xbe, 0xdf, 0x14, 0xf4, 0x5e, 0xcd, + 0x4b, 0x8a, 0x16, 0x25, 0x45, 0xab, 0x92, 0xa2, 0x6f, 0x25, 0x45, 0x9f, 0xd6, 0xd4, 0x59, 0xac, + 0xa9, 0xb3, 0x5a, 0x53, 0xe7, 0xed, 0x65, 0x92, 0xea, 0x51, 0x31, 0xf0, 0x87, 0x7c, 0x12, 0x54, + 0x7d, 0x5d, 0xe4, 0xa0, 0x3f, 0x70, 0x39, 0x0e, 0x36, 0x27, 0xf1, 0x71, 0x73, 0x75, 0xe6, 0x28, + 0x06, 0x37, 0xcc, 0x55, 0x3c, 0xf9, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x43, 0xeb, 0x94, 0x5b, 0x96, + 0x03, 0x00, 0x00, +} + +func (m *Relay) 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 *Relay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Relay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RelayRequestMetadata) 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 *RelayRequestMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayRequestMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintRelay(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RelayRequest) 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 *RelayRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintRelay(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RelayResponse) 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 *RelayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintRelay(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RelayResponseMetadata) 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 *RelayResponseMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayResponseMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SupplierOperatorSignature) > 0 { + i -= len(m.SupplierOperatorSignature) + copy(dAtA[i:], m.SupplierOperatorSignature) + i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorSignature))) + i-- + dAtA[i] = 0x12 + } + if m.SessionHeader != nil { + { + size, err := m.SessionHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRelay(dAtA []byte, offset int, v uint64) int { + offset -= sovRelay(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Relay) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovRelay(uint64(l)) + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovRelay(uint64(l)) + } + return n +} + +func (m *RelayRequestMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovRelay(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovRelay(uint64(l)) + } + l = len(m.SupplierOperatorAddress) + if l > 0 { + n += 1 + l + sovRelay(uint64(l)) + } + return n +} + +func (m *RelayRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Meta.Size() + n += 1 + l + sovRelay(uint64(l)) + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovRelay(uint64(l)) + } + return n +} + +func (m *RelayResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Meta.Size() + n += 1 + l + sovRelay(uint64(l)) + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovRelay(uint64(l)) + } + return n +} + +func (m *RelayResponseMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SessionHeader != nil { + l = m.SessionHeader.Size() + n += 1 + l + sovRelay(uint64(l)) + } + l = len(m.SupplierOperatorSignature) + if l > 0 { + n += 1 + l + sovRelay(uint64(l)) + } + return n +} + +func sovRelay(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRelay(x uint64) (n int) { + return sovRelay(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Relay) 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 ErrIntOverflowRelay + } + 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: Relay: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Relay: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &RelayRequest{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &RelayResponse{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RelayRequestMetadata) 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 ErrIntOverflowRelay + } + 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: RelayRequestMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayRequestMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + 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 ErrInvalidLengthRelay + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RelayRequest) 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 ErrIntOverflowRelay + } + 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: RelayRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RelayResponse) 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 ErrIntOverflowRelay + } + 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: RelayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RelayResponseMetadata) 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 ErrIntOverflowRelay + } + 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: RelayResponseMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayResponseMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionHeader == nil { + m.SessionHeader = &types.SessionHeader{} + } + if err := m.SessionHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorSignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorSignature = append(m.SupplierOperatorSignature[:0], dAtA[iNdEx:postIndex]...) + if m.SupplierOperatorSignature == nil { + m.SupplierOperatorSignature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRelay(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, ErrIntOverflowRelay + } + 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, ErrIntOverflowRelay + } + 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, ErrIntOverflowRelay + } + 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, ErrInvalidLengthRelay + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRelay + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRelay + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRelay = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRelay = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRelay = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/tx.pb.go b/x/service/types/tx.pb.go new file mode 100644 index 000000000..cbfd2f131 --- /dev/null +++ b/x/service/types/tx.pb.go @@ -0,0 +1,1529 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/pokt-network/poktroll/x/shared/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/service parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. +type MsgUpdateParam struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // The (name, as_type) tuple must match the corresponding name and type as + // specified in the `Params` message in `proof/params.proto.` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Types that are valid to be assigned to AsType: + // *MsgUpdateParam_AsCoin + AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` +} + +func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } +func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParam) ProtoMessage() {} +func (*MsgUpdateParam) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{2} +} +func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParam.Merge(m, src) +} +func (m *MsgUpdateParam) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParam) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo + +type isMsgUpdateParam_AsType interface { + isMsgUpdateParam_AsType() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateParam_AsCoin struct { + AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` +} + +func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} + +func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { + if m != nil { + return m.AsType + } + return nil +} + +func (m *MsgUpdateParam) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParam) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpdateParam) GetAsCoin() *types.Coin { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsCoin); ok { + return x.AsCoin + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateParam_AsCoin)(nil), + } +} + +// MsgUpdateParamResponse defines the response structure for executing a +// MsgUpdateParam message after a single param update. +type MsgUpdateParamResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } +func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamResponse) ProtoMessage() {} +func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{3} +} +func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) +} +func (m *MsgUpdateParamResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo + +func (m *MsgUpdateParamResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +// MsgAddService defines a message for adding a new message to the network. +// Services can be added by any actor in the network making them truly +// permissionless. +// TODO_BETA: Add Champions / Sources once its fully defined. +type MsgAddService struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + Service types1.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service"` +} + +func (m *MsgAddService) Reset() { *m = MsgAddService{} } +func (m *MsgAddService) String() string { return proto.CompactTextString(m) } +func (*MsgAddService) ProtoMessage() {} +func (*MsgAddService) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{4} +} +func (m *MsgAddService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgAddService) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddService.Merge(m, src) +} +func (m *MsgAddService) XXX_Size() int { + return m.Size() +} +func (m *MsgAddService) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddService.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddService proto.InternalMessageInfo + +func (m *MsgAddService) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + +func (m *MsgAddService) GetService() types1.Service { + if m != nil { + return m.Service + } + return types1.Service{} +} + +type MsgAddServiceResponse struct { +} + +func (m *MsgAddServiceResponse) Reset() { *m = MsgAddServiceResponse{} } +func (m *MsgAddServiceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddServiceResponse) ProtoMessage() {} +func (*MsgAddServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_31ba9559706e649e, []int{5} +} +func (m *MsgAddServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgAddServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddServiceResponse.Merge(m, src) +} +func (m *MsgAddServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddServiceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.service.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.service.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.service.MsgUpdateParam") + proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.service.MsgUpdateParamResponse") + proto.RegisterType((*MsgAddService)(nil), "poktroll.service.MsgAddService") + proto.RegisterType((*MsgAddServiceResponse)(nil), "poktroll.service.MsgAddServiceResponse") +} + +func init() { proto.RegisterFile("poktroll/service/tx.proto", fileDescriptor_31ba9559706e649e) } + +var fileDescriptor_31ba9559706e649e = []byte{ + // 575 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xce, 0x95, 0x92, 0xca, 0x97, 0xb6, 0x80, 0x55, 0x48, 0x62, 0x09, 0x27, 0x78, 0x21, 0x44, + 0xaa, 0xdd, 0x14, 0x81, 0x50, 0x10, 0x43, 0xcc, 0x82, 0x90, 0x82, 0x90, 0x2b, 0x90, 0x40, 0x48, + 0xd1, 0x25, 0x3e, 0x39, 0x56, 0x6b, 0x9f, 0xe5, 0xbb, 0xa6, 0xed, 0x86, 0x18, 0x99, 0xf8, 0x03, + 0x60, 0x67, 0xcc, 0xc0, 0x84, 0xc4, 0xde, 0xb1, 0x62, 0xea, 0x54, 0xa1, 0x64, 0x88, 0xc4, 0x5f, + 0x81, 0x7c, 0x3e, 0x27, 0x75, 0x12, 0x61, 0xa9, 0x4b, 0x72, 0xf7, 0xbe, 0xef, 0xfd, 0xf8, 0xde, + 0x7b, 0x67, 0x58, 0x0e, 0xc8, 0x3e, 0x0b, 0xc9, 0xc1, 0x81, 0x41, 0x71, 0x38, 0x70, 0x7b, 0xd8, + 0x60, 0xc7, 0x7a, 0x10, 0x12, 0x46, 0xe4, 0x9b, 0x09, 0xa4, 0x0b, 0x48, 0xb9, 0x85, 0x3c, 0xd7, + 0x27, 0x06, 0xff, 0x8d, 0x49, 0x8a, 0xda, 0x23, 0xd4, 0x23, 0xd4, 0xe8, 0x22, 0x8a, 0x8d, 0x41, + 0xa3, 0x8b, 0x19, 0x6a, 0x18, 0x3d, 0xe2, 0xfa, 0x02, 0x2f, 0x0a, 0xdc, 0xa3, 0x8e, 0x31, 0x68, + 0x44, 0x7f, 0x02, 0x28, 0xc7, 0x40, 0x87, 0xdf, 0x8c, 0xf8, 0x22, 0xa0, 0x2d, 0x87, 0x38, 0x24, + 0xb6, 0x47, 0x27, 0x61, 0xbd, 0xbb, 0x50, 0x69, 0x80, 0x42, 0xe4, 0xd1, 0x45, 0xb8, 0x8f, 0x42, + 0x6c, 0x27, 0xac, 0x18, 0xd6, 0x7e, 0x01, 0x78, 0xa3, 0x4d, 0x9d, 0x37, 0x81, 0x8d, 0x18, 0x7e, + 0xcd, 0x1d, 0xe5, 0xc7, 0x50, 0x42, 0x87, 0xac, 0x4f, 0x42, 0x97, 0x9d, 0x94, 0x40, 0x15, 0xd4, + 0x24, 0xb3, 0xf4, 0xfb, 0xc7, 0xf6, 0x96, 0x28, 0xa6, 0x65, 0xdb, 0x21, 0xa6, 0x74, 0x8f, 0x85, + 0xae, 0xef, 0x58, 0x33, 0xaa, 0xfc, 0x14, 0xe6, 0xe3, 0xd4, 0xa5, 0x95, 0x2a, 0xa8, 0x15, 0x76, + 0x4b, 0xfa, 0x7c, 0xa7, 0xf4, 0x38, 0x83, 0x29, 0x9d, 0x5e, 0x54, 0x72, 0xdf, 0x27, 0xc3, 0x3a, + 0xb0, 0x84, 0x4b, 0xf3, 0xd1, 0xa7, 0xc9, 0xb0, 0x3e, 0x0b, 0xf6, 0x79, 0x32, 0xac, 0x6b, 0xd3, + 0xd2, 0x8f, 0xa7, 0xda, 0xe6, 0x6a, 0xd5, 0xca, 0xb0, 0x38, 0x67, 0xb2, 0x30, 0x0d, 0x88, 0x4f, + 0xb1, 0xf6, 0x13, 0xc0, 0xcd, 0x34, 0x76, 0x65, 0x65, 0x32, 0x5c, 0xf5, 0x91, 0x87, 0xb9, 0x2e, + 0xc9, 0xe2, 0x67, 0xb9, 0x05, 0xd7, 0x10, 0xed, 0x44, 0x23, 0x2d, 0x49, 0x5c, 0x6e, 0x59, 0x17, + 0x61, 0xa2, 0x99, 0xeb, 0x62, 0xe6, 0xfa, 0x73, 0xe2, 0xfa, 0x66, 0xe1, 0xef, 0x45, 0x25, 0x61, + 0xbf, 0xc8, 0x59, 0x79, 0x44, 0x23, 0x73, 0x73, 0x33, 0xad, 0xd9, 0x94, 0x78, 0x48, 0x76, 0x12, + 0x60, 0xed, 0x25, 0xbc, 0x93, 0xae, 0x3d, 0x91, 0x25, 0xef, 0x4c, 0xbb, 0x0c, 0xfe, 0xdf, 0xe5, + 0xa4, 0xb5, 0xda, 0x57, 0x00, 0x37, 0xda, 0xd4, 0x69, 0xd9, 0xf6, 0x5e, 0x4c, 0x90, 0x9f, 0xc1, + 0x0d, 0x72, 0xe4, 0xe3, 0xb0, 0x83, 0x62, 0xc5, 0x99, 0xbd, 0x58, 0xe7, 0x74, 0x61, 0x93, 0x9f, + 0xc0, 0x35, 0x91, 0x6a, 0xc9, 0xa4, 0xf9, 0x96, 0xe9, 0x22, 0x93, 0xb9, 0x1a, 0x4d, 0xda, 0x4a, + 0xe8, 0x4d, 0x39, 0x52, 0x9c, 0xce, 0xad, 0x15, 0xe1, 0xed, 0x54, 0x75, 0x89, 0xd2, 0xdd, 0x6f, + 0x2b, 0xf0, 0x5a, 0x9b, 0x3a, 0xf2, 0x07, 0xb8, 0x9e, 0xda, 0xcf, 0x7b, 0x8b, 0x8a, 0xe7, 0x76, + 0x40, 0x79, 0x90, 0x49, 0x99, 0xf6, 0xf3, 0x1d, 0x2c, 0x5c, 0x5e, 0x91, 0x6a, 0x96, 0xa7, 0x52, + 0xcb, 0x62, 0x4c, 0x43, 0xbf, 0x85, 0xf0, 0x52, 0xd3, 0x2b, 0x4b, 0xfd, 0x66, 0x04, 0xe5, 0x7e, + 0x06, 0x21, 0x89, 0xab, 0x5c, 0xff, 0x18, 0x3d, 0x1d, 0xf3, 0xd5, 0xe9, 0x48, 0x05, 0x67, 0x23, + 0x15, 0x9c, 0x8f, 0x54, 0xf0, 0x67, 0xa4, 0x82, 0x2f, 0x63, 0x35, 0x77, 0x36, 0x56, 0x73, 0xe7, + 0x63, 0x35, 0xf7, 0x7e, 0xc7, 0x71, 0x59, 0xff, 0xb0, 0xab, 0xf7, 0x88, 0x67, 0x44, 0x71, 0xb7, + 0x7d, 0xcc, 0x8e, 0x48, 0xb8, 0x6f, 0x2c, 0x79, 0x55, 0xd1, 0xca, 0xd1, 0x6e, 0x9e, 0x7f, 0x12, + 0x1e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xce, 0x8f, 0xce, 0xfc, 0x04, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) + AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Msg/UpdateParam", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) { + out := new(MsgAddServiceResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Msg/AddService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) + AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} +func (*UnimplementedMsgServer) AddService(ctx context.Context, req *MsgAddService) (*MsgAddServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Msg/UpdateParam", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddService) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Msg/AddService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddService(ctx, req.(*MsgAddService)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.service.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + { + MethodName: "AddService", + Handler: _Msg_AddService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/service/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AsType != nil { + { + size := m.AsType.Size() + i -= size + if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam_AsCoin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AsCoin != nil { + { + size, err := m.AsCoin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddService) 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 *MsgAddService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddServiceResponse) 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 *MsgAddServiceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AsType != nil { + n += m.AsType.Size() + } + return n +} + +func (m *MsgUpdateParam_AsCoin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsCoin != nil { + l = m.AsCoin.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUpdateParamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAddService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Service.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgAddServiceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParam) 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 ErrIntOverflowTx + } + 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: MsgUpdateParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.Coin{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.AsType = &MsgUpdateParam_AsCoin{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddService) 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 ErrIntOverflowTx + } + 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: MsgAddService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddServiceResponse) 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 ErrIntOverflowTx + } + 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: MsgAddServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/session/types/genesis.pb.go b/x/session/types/genesis.pb.go new file mode 100644 index 000000000..f874492b5 --- /dev/null +++ b/x/session/types/genesis.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/session/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the session module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_eb011c8651a70d0e, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.session.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/session/genesis.proto", fileDescriptor_eb011c8651a70d0e) } + +var fileDescriptor_eb011c8651a70d0e = []byte{ + // 217 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x4f, 0x4f, 0xcd, + 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, + 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, + 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, + 0xcc, 0x85, 0x9a, 0xac, 0xe4, 0xcd, 0xc5, 0xe3, 0x0e, 0xb1, 0x2a, 0xb8, 0x24, 0xb1, 0x24, 0x55, + 0xc8, 0x9a, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0x6e, + 0xb5, 0x5e, 0x00, 0x58, 0xde, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, + 0x06, 0x41, 0xb5, 0x38, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, + 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, + 0xc7, 0x72, 0x0c, 0x51, 0x06, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, + 0x20, 0x43, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xe1, 0x2e, 0xac, 0x80, 0xbb, + 0xb1, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x46, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x5b, 0x35, 0xaa, 0xf9, 0x1f, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.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 *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 + 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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/session/types/params.pb.go b/x/session/types/params.pb.go new file mode 100644 index 000000000..ac12d5cc9 --- /dev/null +++ b/x/session/types/params.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/session/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_b9edf07916909b5b, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.session.Params") +} + +func init() { proto.RegisterFile("poktroll/session/params.proto", fileDescriptor_b9edf07916909b5b) } + +var fileDescriptor_b9edf07916909b5b = []byte{ + // 180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, + 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, + 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb8, 0xd8, 0x02, 0xc0, 0x46, 0x59, + 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xb2, 0x0a, 0xb8, 0x75, + 0x10, 0x35, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, + 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, + 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, + 0x0c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x2c, 0x06, 0x96, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x5e, 0xc7, 0xb4, + 0xe0, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/session/types/query.pb.go b/x/session/types/query.pb.go new file mode 100644 index 000000000..ca446e8de --- /dev/null +++ b/x/session/types/query.pb.go @@ -0,0 +1,1008 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/session/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/pokt-network/poktroll/x/shared/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d59d2e9c0a875c89, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d59d2e9c0a875c89, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetSessionRequest struct { + ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` + ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + BlockHeight int64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` +} + +func (m *QueryGetSessionRequest) Reset() { *m = QueryGetSessionRequest{} } +func (m *QueryGetSessionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSessionRequest) ProtoMessage() {} +func (*QueryGetSessionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d59d2e9c0a875c89, []int{2} +} +func (m *QueryGetSessionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetSessionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSessionRequest.Merge(m, src) +} +func (m *QueryGetSessionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSessionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSessionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSessionRequest proto.InternalMessageInfo + +func (m *QueryGetSessionRequest) GetApplicationAddress() string { + if m != nil { + return m.ApplicationAddress + } + return "" +} + +func (m *QueryGetSessionRequest) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *QueryGetSessionRequest) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +type QueryGetSessionResponse struct { + Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` +} + +func (m *QueryGetSessionResponse) Reset() { *m = QueryGetSessionResponse{} } +func (m *QueryGetSessionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSessionResponse) ProtoMessage() {} +func (*QueryGetSessionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d59d2e9c0a875c89, []int{3} +} +func (m *QueryGetSessionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetSessionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSessionResponse.Merge(m, src) +} +func (m *QueryGetSessionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSessionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSessionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSessionResponse proto.InternalMessageInfo + +func (m *QueryGetSessionResponse) GetSession() *Session { + if m != nil { + return m.Session + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.session.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.session.QueryParamsResponse") + proto.RegisterType((*QueryGetSessionRequest)(nil), "poktroll.session.QueryGetSessionRequest") + proto.RegisterType((*QueryGetSessionResponse)(nil), "poktroll.session.QueryGetSessionResponse") +} + +func init() { proto.RegisterFile("poktroll/session/query.proto", fileDescriptor_d59d2e9c0a875c89) } + +var fileDescriptor_d59d2e9c0a875c89 = []byte{ + // 485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xae, 0x3b, 0x51, 0x54, 0x8f, 0x03, 0x78, 0x15, 0x64, 0xd5, 0x16, 0x46, 0xc4, 0x44, 0x99, + 0x68, 0x8c, 0xba, 0x23, 0x27, 0x7a, 0x81, 0x5d, 0x26, 0xc8, 0x6e, 0x5c, 0x22, 0x37, 0xb1, 0x52, + 0xab, 0x69, 0x5e, 0x66, 0xbb, 0xc0, 0xae, 0x88, 0x1f, 0x80, 0x84, 0xf8, 0x09, 0x20, 0x8e, 0x1c, + 0xf8, 0x11, 0x3b, 0x4e, 0x70, 0xd9, 0x09, 0xa1, 0x16, 0x89, 0xbf, 0x81, 0x6a, 0xbb, 0x82, 0x11, + 0xaa, 0x72, 0x89, 0x9c, 0xf7, 0x7d, 0xdf, 0x7b, 0xdf, 0xfb, 0x6c, 0xbc, 0x55, 0xc2, 0x48, 0x4b, + 0xc8, 0x73, 0xaa, 0xb8, 0x52, 0x02, 0x0a, 0x7a, 0x3c, 0xe1, 0xf2, 0x24, 0x2c, 0x25, 0x68, 0x20, + 0x57, 0x17, 0x68, 0xe8, 0xd0, 0xf6, 0x35, 0x36, 0x16, 0x05, 0x50, 0xf3, 0xb5, 0xa4, 0x76, 0x2b, + 0x83, 0x0c, 0xcc, 0x91, 0xce, 0x4f, 0xae, 0xba, 0x95, 0x01, 0x64, 0x39, 0xa7, 0xac, 0x14, 0x94, + 0x15, 0x05, 0x68, 0xa6, 0x05, 0x14, 0xca, 0xa1, 0x9b, 0x09, 0xa8, 0x31, 0xa8, 0xd8, 0xca, 0xec, + 0x8f, 0x83, 0xb6, 0x2b, 0x8e, 0x4a, 0x26, 0xd9, 0x78, 0x01, 0x57, 0x0d, 0xeb, 0x93, 0x92, 0xff, + 0x43, 0x3c, 0x64, 0x92, 0xa7, 0x54, 0x71, 0xf9, 0x5c, 0x24, 0xdc, 0xc2, 0x41, 0x0b, 0x93, 0xa7, + 0xf3, 0xf5, 0x9e, 0x98, 0x8e, 0x11, 0x3f, 0x9e, 0x70, 0xa5, 0x83, 0x08, 0x6f, 0x5c, 0xa8, 0xaa, + 0x12, 0x0a, 0xc5, 0xc9, 0x03, 0xdc, 0xb0, 0x93, 0x3d, 0xb4, 0x83, 0x3a, 0xeb, 0x3d, 0x2f, 0xfc, + 0x3b, 0x8d, 0xd0, 0x2a, 0xfa, 0xcd, 0xd3, 0x6f, 0x37, 0x6b, 0x1f, 0x7f, 0x7e, 0xda, 0x43, 0x91, + 0x93, 0x04, 0xef, 0x11, 0xbe, 0x6e, 0x9a, 0x3e, 0xe2, 0xfa, 0xc8, 0xb2, 0xdd, 0x38, 0x72, 0x80, + 0x37, 0x58, 0x59, 0xe6, 0x22, 0x31, 0x89, 0xc4, 0x2c, 0x4d, 0x25, 0x57, 0x76, 0x48, 0xb3, 0xef, + 0x7d, 0xf9, 0xdc, 0x6d, 0xb9, 0x3c, 0x1e, 0x5a, 0xe4, 0x48, 0x4b, 0x51, 0x64, 0x11, 0xf9, 0x43, + 0xe4, 0x10, 0xb2, 0x8d, 0xb1, 0x5b, 0x30, 0x16, 0xa9, 0x57, 0x9f, 0x77, 0x88, 0x9a, 0xae, 0x72, + 0x90, 0x92, 0x5b, 0xf8, 0xca, 0x20, 0x87, 0x64, 0x14, 0x0f, 0xb9, 0xc8, 0x86, 0xda, 0x5b, 0xdb, + 0x41, 0x9d, 0xb5, 0x68, 0xdd, 0xd4, 0x1e, 0x9b, 0x52, 0x70, 0x88, 0x6f, 0x54, 0x6c, 0xba, 0xfd, + 0xf7, 0xf1, 0x65, 0xb7, 0xa7, 0x0b, 0x60, 0xb3, 0x1a, 0xc0, 0x42, 0xb3, 0x60, 0xf6, 0x3e, 0xd4, + 0xf1, 0x25, 0xd3, 0x90, 0xbc, 0x46, 0xb8, 0x61, 0xf3, 0x21, 0xb7, 0xab, 0xc2, 0xea, 0x35, 0xb4, + 0x77, 0x57, 0xb0, 0xac, 0xad, 0xa0, 0xfb, 0xea, 0xeb, 0x8f, 0xb7, 0xf5, 0x3b, 0x64, 0x97, 0xce, + 0xe9, 0xdd, 0x82, 0xeb, 0x17, 0x20, 0x47, 0x74, 0xc9, 0xab, 0x21, 0xef, 0x10, 0xc6, 0xbf, 0x97, + 0x23, 0x9d, 0x25, 0x43, 0x2a, 0xd7, 0xd4, 0xbe, 0xfb, 0x1f, 0x4c, 0x67, 0xa9, 0x67, 0x2c, 0xdd, + 0x23, 0x7b, 0x2b, 0x2c, 0x65, 0x5c, 0xc7, 0xee, 0xdc, 0x3f, 0x3c, 0x9d, 0xfa, 0xe8, 0x6c, 0xea, + 0xa3, 0xf3, 0xa9, 0x8f, 0xbe, 0x4f, 0x7d, 0xf4, 0x66, 0xe6, 0xd7, 0xce, 0x66, 0x7e, 0xed, 0x7c, + 0xe6, 0xd7, 0x9e, 0xdd, 0xcf, 0x84, 0x1e, 0x4e, 0x06, 0x61, 0x02, 0xe3, 0x25, 0x3d, 0x5f, 0x5e, + 0x7c, 0xff, 0x83, 0x86, 0x79, 0xe1, 0xfb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x71, 0x8a, 0x02, + 0x58, 0xd1, 0x03, 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 the session given app_address, service and block_height. + GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.session.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error) { + out := new(QueryGetSessionResponse) + err := c.cc.Invoke(ctx, "/poktroll.session.Query/GetSession", in, out, opts...) + 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 the session given app_address, service and block_height. + GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, 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) GetSession(ctx context.Context, req *QueryGetSessionRequest) (*QueryGetSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.session.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 _Query_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.session.Query/GetSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetSession(ctx, req.(*QueryGetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.session.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "GetSession", + Handler: _Query_GetSession_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/session/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetSessionRequest) 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 *QueryGetSessionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ApplicationAddress) > 0 { + i -= len(m.ApplicationAddress) + copy(dAtA[i:], m.ApplicationAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ApplicationAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetSessionResponse) 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 *QueryGetSessionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Session != nil { + { + size, err := m.Session.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 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 *QueryGetSessionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ApplicationAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + return n +} + +func (m *QueryGetSessionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Session != nil { + l = m.Session.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 *QueryGetSessionRequest) 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: QueryGetSessionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSessionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddress", 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.ApplicationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(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 *QueryGetSessionResponse) 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: QueryGetSessionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSessionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Session", 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.Session == nil { + m.Session = &Session{} + } + if err := m.Session.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 skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/session/types/query.pb.gw.go b/x/session/types/query.pb.gw.go new file mode 100644 index 000000000..235d1d10a --- /dev/null +++ b/x/session/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/session/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetSession_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetSession_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSessionRequest + 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_GetSession_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetSession(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetSession_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSessionRequest + 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_GetSession_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetSession(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetSession_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_GetSession_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_GetSession_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetSession_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_GetSession_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_GetSession_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "session", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "session", "get_session"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_GetSession_0 = runtime.ForwardResponseMessage +) diff --git a/x/session/types/tx.pb.go b/x/session/types/tx.pb.go new file mode 100644 index 000000000..e60329741 --- /dev/null +++ b/x/session/types/tx.pb.go @@ -0,0 +1,590 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/session/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/session parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_0b53e8fbf6b46fb6, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0b53e8fbf6b46fb6, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.session.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.session.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("poktroll/session/tx.proto", fileDescriptor_0b53e8fbf6b46fb6) } + +var fileDescriptor_0b53e8fbf6b46fb6 = []byte{ + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xe9, 0x41, 0xa5, 0xa4, 0x04, 0x13, 0x73, + 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0xb1, + 0x7e, 0x6e, 0x71, 0xba, 0x7e, 0x99, 0x21, 0x88, 0x82, 0x4a, 0x48, 0x42, 0x24, 0xe2, 0xc1, 0x3c, + 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, 0xa2, 0xb2, + 0x18, 0x2e, 0x29, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0x6a, 0x52, 0x3a, 0xce, 0xc8, 0xc5, 0xef, 0x5b, + 0x9c, 0x1e, 0x5a, 0x90, 0x92, 0x58, 0x92, 0x1a, 0x00, 0x96, 0x11, 0x32, 0xe3, 0xe2, 0x4c, 0x2c, + 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, 0xa9, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xb8, + 0xb4, 0x45, 0x57, 0x04, 0x6a, 0x9b, 0x63, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x70, 0x49, 0x51, + 0x66, 0x5e, 0x7a, 0x10, 0x42, 0xa9, 0x90, 0x2b, 0x17, 0x1b, 0xc4, 0x6c, 0x09, 0x26, 0x05, 0x46, + 0x0d, 0x6e, 0x23, 0x09, 0x3d, 0x74, 0xaf, 0xea, 0x41, 0x6c, 0x70, 0x12, 0x3e, 0x71, 0x4f, 0x9e, + 0xe1, 0xd5, 0x3d, 0x79, 0xa8, 0xfa, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0x39, 0x56, 0xa6, + 0x4d, 0xcf, 0x37, 0x68, 0x21, 0x8c, 0xed, 0x7a, 0xbe, 0x41, 0x4b, 0x09, 0xee, 0x89, 0x0a, 0xb8, + 0x37, 0xd0, 0x5c, 0xad, 0x24, 0xc9, 0x25, 0x8e, 0x26, 0x14, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, + 0x9c, 0x6a, 0x94, 0xc5, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x14, 0xc3, 0xc5, 0x83, 0xe2, 0x4f, 0x45, + 0x4c, 0xf7, 0xa1, 0x99, 0x20, 0xa5, 0x49, 0x50, 0x09, 0xcc, 0x12, 0x29, 0xd6, 0x06, 0x90, 0x2f, + 0x9c, 0xfc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc6, 0x23, 0x39, 0xc6, 0x07, + 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, + 0x28, 0x83, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0xc9, 0xba, + 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x58, 0x3c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0x8e, 0x27, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xc2, 0x98, 0xb6, 0x52, + 0x02, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.session.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.session.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.session.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/session/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/session/types/types.pb.go b/x/session/types/types.pb.go new file mode 100644 index 000000000..2d12d8f47 --- /dev/null +++ b/x/session/types/types.pb.go @@ -0,0 +1,933 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/session/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/application/types" + types1 "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// SessionHeader is a lightweight header for a session that can be passed around. +// It is the minimal amount of data required to hydrate & retrieve all data relevant to the session. +type SessionHeader struct { + ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` + ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SessionStartBlockHeight int64 `protobuf:"varint,4,opt,name=session_start_block_height,json=sessionStartBlockHeight,proto3" json:"session_start_block_height,omitempty"` + // Note that`session_end_block_height` is a derivative of (`start` + `num_blocks_per_session`) + // as goverened by on-chain params at the time of the session start. + // It is stored as an additional field to simplofy business logic in case + // the number of blocks_per_session changes during the session. + SessionEndBlockHeight int64 `protobuf:"varint,5,opt,name=session_end_block_height,json=sessionEndBlockHeight,proto3" json:"session_end_block_height,omitempty"` +} + +func (m *SessionHeader) Reset() { *m = SessionHeader{} } +func (m *SessionHeader) String() string { return proto.CompactTextString(m) } +func (*SessionHeader) ProtoMessage() {} +func (*SessionHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_4b2d9db41a667008, []int{0} +} +func (m *SessionHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SessionHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SessionHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SessionHeader.Merge(m, src) +} +func (m *SessionHeader) XXX_Size() int { + return m.Size() +} +func (m *SessionHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SessionHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_SessionHeader proto.InternalMessageInfo + +func (m *SessionHeader) GetApplicationAddress() string { + if m != nil { + return m.ApplicationAddress + } + return "" +} + +func (m *SessionHeader) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *SessionHeader) GetSessionId() string { + if m != nil { + return m.SessionId + } + return "" +} + +func (m *SessionHeader) GetSessionStartBlockHeight() int64 { + if m != nil { + return m.SessionStartBlockHeight + } + return 0 +} + +func (m *SessionHeader) GetSessionEndBlockHeight() int64 { + if m != nil { + return m.SessionEndBlockHeight + } + return 0 +} + +// Session is a fully hydrated session object that contains all the information for the Session +// and its parcipants. +type Session struct { + Header *SessionHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SessionNumber int64 `protobuf:"varint,3,opt,name=session_number,json=sessionNumber,proto3" json:"session_number,omitempty"` + NumBlocksPerSession int64 `protobuf:"varint,4,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` + Application *types.Application `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"` + Suppliers []*types1.Supplier `protobuf:"bytes,6,rep,name=suppliers,proto3" json:"suppliers,omitempty"` +} + +func (m *Session) Reset() { *m = Session{} } +func (m *Session) String() string { return proto.CompactTextString(m) } +func (*Session) ProtoMessage() {} +func (*Session) Descriptor() ([]byte, []int) { + return fileDescriptor_4b2d9db41a667008, []int{1} +} +func (m *Session) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Session) XXX_Merge(src proto.Message) { + xxx_messageInfo_Session.Merge(m, src) +} +func (m *Session) XXX_Size() int { + return m.Size() +} +func (m *Session) XXX_DiscardUnknown() { + xxx_messageInfo_Session.DiscardUnknown(m) +} + +var xxx_messageInfo_Session proto.InternalMessageInfo + +func (m *Session) GetHeader() *SessionHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *Session) GetSessionId() string { + if m != nil { + return m.SessionId + } + return "" +} + +func (m *Session) GetSessionNumber() int64 { + if m != nil { + return m.SessionNumber + } + return 0 +} + +func (m *Session) GetNumBlocksPerSession() int64 { + if m != nil { + return m.NumBlocksPerSession + } + return 0 +} + +func (m *Session) GetApplication() *types.Application { + if m != nil { + return m.Application + } + return nil +} + +func (m *Session) GetSuppliers() []*types1.Supplier { + if m != nil { + return m.Suppliers + } + return nil +} + +func init() { + proto.RegisterType((*SessionHeader)(nil), "poktroll.session.SessionHeader") + proto.RegisterType((*Session)(nil), "poktroll.session.Session") +} + +func init() { proto.RegisterFile("poktroll/session/types.proto", fileDescriptor_4b2d9db41a667008) } + +var fileDescriptor_4b2d9db41a667008 = []byte{ + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xc7, 0x9b, 0x16, 0x8a, 0xea, 0x6a, 0x08, 0x79, 0x03, 0xb2, 0x8a, 0x99, 0x32, 0x09, 0xa9, + 0x97, 0x25, 0xa8, 0x3b, 0xf4, 0xc0, 0x69, 0x45, 0x48, 0xeb, 0x65, 0x42, 0xe9, 0x8d, 0x4b, 0x94, + 0xc4, 0x56, 0x12, 0x35, 0xb1, 0x23, 0xdb, 0xe1, 0xe5, 0x4b, 0x20, 0x3e, 0x0c, 0x37, 0xbe, 0x00, + 0xc7, 0x89, 0xd3, 0x8e, 0x28, 0xfd, 0x22, 0x28, 0xb6, 0xb3, 0xa4, 0xd9, 0xcd, 0x79, 0x7e, 0xff, + 0xe7, 0xe5, 0x6f, 0x3f, 0x01, 0xaf, 0x0a, 0xb6, 0x93, 0x9c, 0x65, 0x99, 0x2b, 0x88, 0x10, 0x29, + 0xa3, 0xae, 0xfc, 0x5e, 0x10, 0xe1, 0x14, 0x9c, 0x49, 0x06, 0x9f, 0x35, 0xd4, 0x31, 0x74, 0x76, + 0x1a, 0x31, 0x91, 0x33, 0xe1, 0x2b, 0xee, 0xea, 0x0f, 0x2d, 0x9e, 0x9d, 0xb5, 0xa5, 0x92, 0x80, + 0x13, 0xec, 0x0a, 0xc2, 0xbf, 0xa4, 0x11, 0x31, 0x78, 0x7e, 0x8f, 0x83, 0xa2, 0xc8, 0xd2, 0x28, + 0x90, 0xbd, 0x6e, 0x33, 0xf4, 0xa0, 0x40, 0x59, 0x2b, 0x09, 0x37, 0xfc, 0x24, 0x66, 0x31, 0xd3, + 0x8d, 0xeb, 0x93, 0x8e, 0x9e, 0xff, 0x18, 0x82, 0xa3, 0xad, 0x9e, 0xee, 0x9a, 0x04, 0x98, 0x70, + 0xb8, 0x01, 0xc7, 0x9d, 0x16, 0x7e, 0x80, 0x31, 0x27, 0x42, 0xd8, 0xd6, 0xdc, 0x5a, 0x4c, 0xd6, + 0xf6, 0xdf, 0x5f, 0x17, 0x27, 0x66, 0xee, 0x2b, 0x4d, 0xb6, 0x92, 0xa7, 0x34, 0xf6, 0x60, 0x27, + 0xc9, 0x10, 0x78, 0x06, 0x80, 0x71, 0xe1, 0xa7, 0xd8, 0x1e, 0xd6, 0x15, 0xbc, 0x89, 0x89, 0x6c, + 0xb0, 0xc6, 0xaa, 0x75, 0x8d, 0x47, 0x0d, 0x56, 0x91, 0x0d, 0x86, 0xef, 0xc1, 0xac, 0xc1, 0x42, + 0x06, 0x5c, 0xfa, 0x61, 0xc6, 0xa2, 0x9d, 0x9f, 0x90, 0x34, 0x4e, 0xa4, 0xfd, 0x68, 0x6e, 0x2d, + 0x46, 0xde, 0x4b, 0xa3, 0xd8, 0xd6, 0x82, 0x75, 0xcd, 0xaf, 0x15, 0x86, 0x2b, 0x60, 0x37, 0xc9, + 0x84, 0xe2, 0xc3, 0xd4, 0xc7, 0x2a, 0xf5, 0xb9, 0xe1, 0x1f, 0x29, 0xee, 0x24, 0x9e, 0xff, 0x1e, + 0x82, 0x27, 0xe6, 0x42, 0xe0, 0x0a, 0x8c, 0x13, 0x75, 0x29, 0xca, 0xfd, 0x74, 0xf9, 0xda, 0xe9, + 0xbf, 0xa8, 0x73, 0x70, 0x77, 0x9e, 0x91, 0xf7, 0x9c, 0x0d, 0xfb, 0xce, 0xde, 0x82, 0xa7, 0x0d, + 0xa6, 0x65, 0x1e, 0x12, 0xae, 0xcc, 0x8f, 0xbc, 0x23, 0x13, 0xbd, 0x51, 0x41, 0x78, 0x09, 0x5e, + 0xd0, 0x32, 0xd7, 0xb3, 0x0b, 0xbf, 0x20, 0xdc, 0x37, 0xdc, 0x98, 0x3f, 0xa6, 0x65, 0xae, 0x46, + 0x17, 0x9f, 0x08, 0x6f, 0x66, 0xfe, 0x00, 0xa6, 0x9d, 0x97, 0x50, 0x5e, 0xa7, 0xcb, 0x37, 0xed, + 0xe0, 0x1d, 0xe8, 0x5c, 0xb5, 0x67, 0xaf, 0x9b, 0x05, 0x57, 0x60, 0xd2, 0x6c, 0x8f, 0xb0, 0xc7, + 0xf3, 0xd1, 0x62, 0xba, 0x3c, 0xed, 0x78, 0x57, 0xfb, 0xe5, 0x6c, 0x8d, 0xc2, 0x6b, 0xb5, 0xeb, + 0x9b, 0x3f, 0x15, 0xb2, 0x6e, 0x2b, 0x64, 0xdd, 0x55, 0xc8, 0xfa, 0x57, 0x21, 0xeb, 0xe7, 0x1e, + 0x0d, 0x6e, 0xf7, 0x68, 0x70, 0xb7, 0x47, 0x83, 0xcf, 0xef, 0xe2, 0x54, 0x26, 0x65, 0xe8, 0x44, + 0x2c, 0x77, 0xeb, 0x6a, 0x17, 0x94, 0xc8, 0xaf, 0x8c, 0xef, 0xdc, 0xfb, 0xd5, 0xfd, 0x76, 0xf8, + 0x23, 0x85, 0x63, 0xb5, 0xa5, 0x97, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x3f, 0x27, 0x80, + 0x69, 0x03, 0x00, 0x00, +} + +func (m *SessionHeader) 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 *SessionHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SessionHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SessionEndBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SessionEndBlockHeight)) + i-- + dAtA[i] = 0x28 + } + if m.SessionStartBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SessionStartBlockHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.SessionId) > 0 { + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ApplicationAddress) > 0 { + i -= len(m.ApplicationAddress) + copy(dAtA[i:], m.ApplicationAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ApplicationAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Session) 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 *Session) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Suppliers) > 0 { + for iNdEx := len(m.Suppliers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Suppliers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Application != nil { + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.NumBlocksPerSession != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.NumBlocksPerSession)) + i-- + dAtA[i] = 0x20 + } + if m.SessionNumber != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SessionNumber)) + i-- + dAtA[i] = 0x18 + } + if len(m.SessionId) > 0 { + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SessionHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ApplicationAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.SessionId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SessionStartBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.SessionStartBlockHeight)) + } + if m.SessionEndBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.SessionEndBlockHeight)) + } + return n +} + +func (m *Session) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.SessionId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SessionNumber != 0 { + n += 1 + sovTypes(uint64(m.SessionNumber)) + } + if m.NumBlocksPerSession != 0 { + n += 1 + sovTypes(uint64(m.NumBlocksPerSession)) + } + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Suppliers) > 0 { + for _, e := range m.Suppliers { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SessionHeader) 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 ErrIntOverflowTypes + } + 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: SessionHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SessionHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ApplicationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SessionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionStartBlockHeight", wireType) + } + m.SessionStartBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SessionStartBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndBlockHeight", wireType) + } + m.SessionEndBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SessionEndBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Session) 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 ErrIntOverflowTypes + } + 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: Session: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Session: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &SessionHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SessionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionNumber", wireType) + } + m.SessionNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SessionNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocksPerSession", wireType) + } + m.NumBlocksPerSession = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocksPerSession |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Application == nil { + m.Application = &types.Application{} + } + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Suppliers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Suppliers = append(m.Suppliers, &types1.Supplier{}) + if err := m.Suppliers[len(m.Suppliers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/genesis.pb.go b/x/shared/types/genesis.pb.go new file mode 100644 index 000000000..7fdfa5ca8 --- /dev/null +++ b/x/shared/types/genesis.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the shared module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_7a0004d2eefa4b15, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.shared.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/shared/genesis.proto", fileDescriptor_7a0004d2eefa4b15) } + +var fileDescriptor_7a0004d2eefa4b15 = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, + 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0x49, 0xeb, 0x41, 0xa4, + 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x48, 0x7a, 0x7e, + 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0xd0, 0x0d, 0x2e, 0x48, 0x2c, 0x4a, 0xcc, + 0x85, 0x9a, 0xab, 0xe4, 0xc5, 0xc5, 0xe3, 0x0e, 0xb1, 0x28, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, + 0x8a, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0x66, 0xb1, + 0x5e, 0x00, 0x58, 0xda, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, + 0x41, 0x75, 0x38, 0xf9, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, + 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, + 0x72, 0x0c, 0x51, 0xfa, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, + 0x33, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xe1, 0xee, 0xab, 0x80, 0xb9, 0xb0, + 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xb7, 0x4b, 0x51, 0xdd, 0x1a, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.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 *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 + 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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/params.pb.go b/x/shared/types/params.pb.go new file mode 100644 index 000000000..7b5863516 --- /dev/null +++ b/x/shared/types/params.pb.go @@ -0,0 +1,671 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { + // num_blocks_per_session is the number of blocks between the session start & end heights. + NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` + // grace_period_end_offset_blocks is the number of blocks, after the session end height, + // during which the supplier can still service payable relays. + // Suppliers will need to recreate a claim for the previous session (if already created) to + // get paid for the additional relays. + GracePeriodEndOffsetBlocks uint64 `protobuf:"varint,2,opt,name=grace_period_end_offset_blocks,json=gracePeriodEndOffsetBlocks,proto3" json:"grace_period_end_offset_blocks"` + // claim_window_open_offset_blocks is the number of blocks after the session grace + // period height, at which the claim window opens. + ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,3,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks"` + // claim_window_close_offset_blocks is the number of blocks after the claim window + // open height, at which the claim window closes. + ClaimWindowCloseOffsetBlocks uint64 `protobuf:"varint,4,opt,name=claim_window_close_offset_blocks,json=claimWindowCloseOffsetBlocks,proto3" json:"claim_window_close_offset_blocks"` + // proof_window_open_offset_blocks is the number of blocks after the claim window + // close height, at which the proof window opens. + ProofWindowOpenOffsetBlocks uint64 `protobuf:"varint,5,opt,name=proof_window_open_offset_blocks,json=proofWindowOpenOffsetBlocks,proto3" json:"proof_window_open_offset_blocks"` + // proof_window_close_offset_blocks is the number of blocks after the proof window + // open height, at which the proof window closes. + ProofWindowCloseOffsetBlocks uint64 `protobuf:"varint,6,opt,name=proof_window_close_offset_blocks,json=proofWindowCloseOffsetBlocks,proto3" json:"proof_window_close_offset_blocks"` + // supplier_unbonding_period_sessions is the number of sessions that a supplier must wait after + // unstaking before their staked assets are moved to their account balance. + // On-chain business logic requires, and ensures, that the corresponding block count of the unbonding + // period will exceed the end of any active claim & proof lifecycles. + SupplierUnbondingPeriodSessions uint64 `protobuf:"varint,7,opt,name=supplier_unbonding_period_sessions,json=supplierUnbondingPeriodSessions,proto3" json:"supplier_unbonding_period_sessions"` + // application_unbonding_period_sessions is the number of sessions that an application must wait after + // unstaking before their staked assets are moved to their account balance. + // On-chain business logic requires, and ensures, that the corresponding block count of the + // application unbonding period will exceed the end of its corresponding proof window close height. + ApplicationUnbondingPeriodSessions uint64 `protobuf:"varint,8,opt,name=application_unbonding_period_sessions,json=applicationUnbondingPeriodSessions,proto3" json:"application_unbonding_period_sessions"` + // The amount of upokt that a compute unit should translate to when settling a session. + // DEV_NOTE: This used to be under x/tokenomics but has been moved here to avoid cyclic dependencies. + ComputeUnitsToTokensMultiplier uint64 `protobuf:"varint,9,opt,name=compute_units_to_tokens_multiplier,json=computeUnitsToTokensMultiplier,proto3" json:"compute_units_to_tokens_multiplier" yaml:"compute_units_to_tokens_multiplier"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_ee6189c7aa51bbf5, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetNumBlocksPerSession() uint64 { + if m != nil { + return m.NumBlocksPerSession + } + return 0 +} + +func (m *Params) GetGracePeriodEndOffsetBlocks() uint64 { + if m != nil { + return m.GracePeriodEndOffsetBlocks + } + return 0 +} + +func (m *Params) GetClaimWindowOpenOffsetBlocks() uint64 { + if m != nil { + return m.ClaimWindowOpenOffsetBlocks + } + return 0 +} + +func (m *Params) GetClaimWindowCloseOffsetBlocks() uint64 { + if m != nil { + return m.ClaimWindowCloseOffsetBlocks + } + return 0 +} + +func (m *Params) GetProofWindowOpenOffsetBlocks() uint64 { + if m != nil { + return m.ProofWindowOpenOffsetBlocks + } + return 0 +} + +func (m *Params) GetProofWindowCloseOffsetBlocks() uint64 { + if m != nil { + return m.ProofWindowCloseOffsetBlocks + } + return 0 +} + +func (m *Params) GetSupplierUnbondingPeriodSessions() uint64 { + if m != nil { + return m.SupplierUnbondingPeriodSessions + } + return 0 +} + +func (m *Params) GetApplicationUnbondingPeriodSessions() uint64 { + if m != nil { + return m.ApplicationUnbondingPeriodSessions + } + return 0 +} + +func (m *Params) GetComputeUnitsToTokensMultiplier() uint64 { + if m != nil { + return m.ComputeUnitsToTokensMultiplier + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.shared.Params") +} + +func init() { proto.RegisterFile("poktroll/shared/params.proto", fileDescriptor_ee6189c7aa51bbf5) } + +var fileDescriptor_ee6189c7aa51bbf5 = []byte{ + // 524 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xbf, 0x6e, 0xd3, 0x40, + 0x1c, 0xc7, 0x6b, 0x28, 0xa1, 0x78, 0x41, 0x18, 0x84, 0xac, 0x34, 0xf2, 0x15, 0xf3, 0x47, 0x14, + 0x89, 0x78, 0x60, 0xeb, 0x18, 0xc4, 0x58, 0x25, 0x72, 0x5b, 0x21, 0xb1, 0x9c, 0x1c, 0xfb, 0xe2, + 0x9e, 0x62, 0xdf, 0xef, 0x74, 0x77, 0x56, 0xa8, 0xc4, 0x13, 0x30, 0xf1, 0x06, 0xb0, 0xb3, 0xf0, + 0x18, 0x8c, 0x1d, 0x3b, 0x59, 0x28, 0x19, 0x40, 0x1e, 0x79, 0x02, 0xe4, 0x73, 0xdc, 0x26, 0x29, + 0xa9, 0xb3, 0x44, 0xa7, 0xfb, 0x7e, 0xee, 0xf7, 0xc9, 0x57, 0x3e, 0x9d, 0xd9, 0xe1, 0x30, 0x56, + 0x02, 0x92, 0xc4, 0x93, 0xa7, 0x81, 0x20, 0x91, 0xc7, 0x03, 0x11, 0xa4, 0xb2, 0xcb, 0x05, 0x28, + 0xb0, 0xee, 0xd7, 0x69, 0xb7, 0x4a, 0xdb, 0x0f, 0x82, 0x94, 0x32, 0xf0, 0xf4, 0x6f, 0xc5, 0xb4, + 0x1f, 0xc5, 0x10, 0x83, 0x5e, 0x7a, 0xe5, 0xaa, 0xda, 0x75, 0xbf, 0xef, 0x98, 0xad, 0x81, 0x1e, + 0x65, 0xf5, 0xcd, 0xc7, 0x2c, 0x4b, 0xf1, 0x30, 0x81, 0x70, 0x2c, 0x31, 0x27, 0x02, 0x4b, 0x22, + 0x25, 0x05, 0x66, 0x1b, 0x7b, 0xc6, 0xcb, 0xed, 0x5e, 0xbb, 0xc8, 0xd1, 0x1a, 0xc2, 0x7f, 0xc8, + 0xb2, 0xb4, 0xa7, 0xb7, 0x07, 0x44, 0x1c, 0x55, 0x9b, 0xd6, 0xc8, 0x74, 0x62, 0x11, 0x84, 0xa4, + 0x24, 0x29, 0x44, 0x98, 0xb0, 0x08, 0xc3, 0x68, 0x24, 0x89, 0x9a, 0x8f, 0xb0, 0x6f, 0xe9, 0xc1, + 0x6e, 0x91, 0xa3, 0x06, 0xd2, 0x6f, 0xeb, 0x7c, 0xa0, 0xe3, 0x77, 0x2c, 0xea, 0xeb, 0xb0, 0x32, + 0x5a, 0xd4, 0x44, 0x61, 0x12, 0xd0, 0x14, 0x4f, 0x28, 0x8b, 0x60, 0x82, 0x81, 0x13, 0xb6, 0x22, + 0xba, 0xad, 0x45, 0x4f, 0x8b, 0x1c, 0x35, 0xa1, 0xfe, 0xae, 0x06, 0xde, 0xeb, 0xbc, 0xcf, 0x09, + 0x5b, 0x52, 0x25, 0xe6, 0xde, 0xd2, 0xf9, 0x30, 0x01, 0x49, 0x56, 0x5c, 0xdb, 0xda, 0xf5, 0xac, + 0xc8, 0x51, 0x23, 0xeb, 0x77, 0x16, 0x64, 0x6f, 0xcb, 0x7c, 0xb5, 0x18, 0x17, 0x00, 0xa3, 0x1b, + 0x8a, 0xdd, 0xb9, 0x2a, 0xd6, 0x80, 0xfa, 0xbb, 0x1a, 0x58, 0x5f, 0x6c, 0xe9, 0xfc, 0xff, 0x8a, + 0xb5, 0xae, 0x8a, 0x35, 0xb1, 0x7e, 0x67, 0x41, 0x76, 0xbd, 0x98, 0x34, 0x5d, 0x99, 0x71, 0x9e, + 0x50, 0x22, 0x70, 0xc6, 0x86, 0xc0, 0x22, 0xca, 0xe2, 0xfa, 0xe3, 0xcf, 0xef, 0x94, 0xb4, 0xef, + 0x6a, 0xdf, 0x8b, 0x22, 0x47, 0x1b, 0xd0, 0x3e, 0xaa, 0x99, 0x93, 0x1a, 0xa9, 0x6e, 0xcb, 0xfc, + 0x36, 0x4a, 0xeb, 0x93, 0xf9, 0x3c, 0x28, 0x89, 0x30, 0x50, 0x14, 0xd8, 0x0d, 0xde, 0x1d, 0xed, + 0xdd, 0x2f, 0x72, 0xb4, 0xd9, 0x01, 0xdf, 0x5d, 0xc0, 0xd6, 0xd9, 0xbf, 0x1a, 0xa6, 0x1b, 0x42, + 0xca, 0x33, 0x45, 0x70, 0xc6, 0xa8, 0x92, 0x58, 0x01, 0x56, 0x30, 0x26, 0x4c, 0xe2, 0x34, 0x4b, + 0x14, 0xd5, 0xff, 0xdd, 0xbe, 0xa7, 0xdd, 0x47, 0x65, 0xe7, 0x66, 0xfa, 0x6f, 0x8e, 0xf6, 0xcf, + 0x82, 0x34, 0x39, 0xd8, 0x80, 0x75, 0x7d, 0x67, 0x0e, 0x9d, 0x94, 0xcc, 0x31, 0x1c, 0x6b, 0xe2, + 0xf0, 0x12, 0x38, 0x78, 0xf2, 0xe7, 0x1b, 0x32, 0x3e, 0xff, 0xfe, 0xf1, 0xca, 0xbe, 0x7c, 0x6b, + 0x3e, 0xd6, 0xaf, 0x4d, 0xf5, 0x44, 0xf4, 0x0e, 0x7f, 0x4e, 0x1d, 0xe3, 0x7c, 0xea, 0x18, 0x17, + 0x53, 0xc7, 0xf8, 0x35, 0x75, 0x8c, 0x2f, 0x33, 0x67, 0xeb, 0x7c, 0xe6, 0x6c, 0x5d, 0xcc, 0x9c, + 0xad, 0x0f, 0x5e, 0x4c, 0xd5, 0x69, 0x36, 0xec, 0x86, 0x90, 0x7a, 0xe5, 0x88, 0xd7, 0x8c, 0xa8, + 0x09, 0x88, 0xb1, 0x77, 0x7d, 0x9e, 0x3a, 0xe3, 0x44, 0x0e, 0x5b, 0xfa, 0x0d, 0x7a, 0xf3, 0x2f, + 0x00, 0x00, 0xff, 0xff, 0x80, 0xd1, 0x33, 0x73, 0xdd, 0x04, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.NumBlocksPerSession != that1.NumBlocksPerSession { + return false + } + if this.GracePeriodEndOffsetBlocks != that1.GracePeriodEndOffsetBlocks { + return false + } + if this.ClaimWindowOpenOffsetBlocks != that1.ClaimWindowOpenOffsetBlocks { + return false + } + if this.ClaimWindowCloseOffsetBlocks != that1.ClaimWindowCloseOffsetBlocks { + return false + } + if this.ProofWindowOpenOffsetBlocks != that1.ProofWindowOpenOffsetBlocks { + return false + } + if this.ProofWindowCloseOffsetBlocks != that1.ProofWindowCloseOffsetBlocks { + return false + } + if this.SupplierUnbondingPeriodSessions != that1.SupplierUnbondingPeriodSessions { + return false + } + if this.ApplicationUnbondingPeriodSessions != that1.ApplicationUnbondingPeriodSessions { + return false + } + if this.ComputeUnitsToTokensMultiplier != that1.ComputeUnitsToTokensMultiplier { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ComputeUnitsToTokensMultiplier != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ComputeUnitsToTokensMultiplier)) + i-- + dAtA[i] = 0x48 + } + if m.ApplicationUnbondingPeriodSessions != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ApplicationUnbondingPeriodSessions)) + i-- + dAtA[i] = 0x40 + } + if m.SupplierUnbondingPeriodSessions != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.SupplierUnbondingPeriodSessions)) + i-- + dAtA[i] = 0x38 + } + if m.ProofWindowCloseOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ProofWindowCloseOffsetBlocks)) + i-- + dAtA[i] = 0x30 + } + if m.ProofWindowOpenOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ProofWindowOpenOffsetBlocks)) + i-- + dAtA[i] = 0x28 + } + if m.ClaimWindowCloseOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowCloseOffsetBlocks)) + i-- + dAtA[i] = 0x20 + } + if m.ClaimWindowOpenOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowOpenOffsetBlocks)) + i-- + dAtA[i] = 0x18 + } + if m.GracePeriodEndOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.GracePeriodEndOffsetBlocks)) + i-- + dAtA[i] = 0x10 + } + if m.NumBlocksPerSession != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.NumBlocksPerSession)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NumBlocksPerSession != 0 { + n += 1 + sovParams(uint64(m.NumBlocksPerSession)) + } + if m.GracePeriodEndOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.GracePeriodEndOffsetBlocks)) + } + if m.ClaimWindowOpenOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ClaimWindowOpenOffsetBlocks)) + } + if m.ClaimWindowCloseOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ClaimWindowCloseOffsetBlocks)) + } + if m.ProofWindowOpenOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ProofWindowOpenOffsetBlocks)) + } + if m.ProofWindowCloseOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ProofWindowCloseOffsetBlocks)) + } + if m.SupplierUnbondingPeriodSessions != 0 { + n += 1 + sovParams(uint64(m.SupplierUnbondingPeriodSessions)) + } + if m.ApplicationUnbondingPeriodSessions != 0 { + n += 1 + sovParams(uint64(m.ApplicationUnbondingPeriodSessions)) + } + if m.ComputeUnitsToTokensMultiplier != 0 { + n += 1 + sovParams(uint64(m.ComputeUnitsToTokensMultiplier)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocksPerSession", wireType) + } + m.NumBlocksPerSession = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocksPerSession |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodEndOffsetBlocks", wireType) + } + m.GracePeriodEndOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GracePeriodEndOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowOpenOffsetBlocks", wireType) + } + m.ClaimWindowOpenOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowCloseOffsetBlocks", wireType) + } + m.ClaimWindowCloseOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofWindowOpenOffsetBlocks", wireType) + } + m.ProofWindowOpenOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProofWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofWindowCloseOffsetBlocks", wireType) + } + m.ProofWindowCloseOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProofWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierUnbondingPeriodSessions", wireType) + } + m.SupplierUnbondingPeriodSessions = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SupplierUnbondingPeriodSessions |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationUnbondingPeriodSessions", wireType) + } + m.ApplicationUnbondingPeriodSessions = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ApplicationUnbondingPeriodSessions |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnitsToTokensMultiplier", wireType) + } + m.ComputeUnitsToTokensMultiplier = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ComputeUnitsToTokensMultiplier |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/query.pb.go b/x/shared/types/query.pb.go new file mode 100644 index 000000000..d2df1f2c8 --- /dev/null +++ b/x/shared/types/query.pb.go @@ -0,0 +1,532 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6adee1148228eb7c, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6adee1148228eb7c, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.shared.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.shared.QueryParamsResponse") +} + +func init() { proto.RegisterFile("poktroll/shared/query.proto", fileDescriptor_6adee1148228eb7c) } + +var fileDescriptor_6adee1148228eb7c = []byte{ + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x31, 0x4b, 0x03, 0x41, + 0x10, 0x85, 0x6f, 0x05, 0x03, 0x9e, 0x85, 0x78, 0x06, 0x94, 0x28, 0xab, 0xc4, 0x20, 0x12, 0xf4, + 0x86, 0xc4, 0xce, 0x32, 0xbd, 0x60, 0x52, 0xda, 0xed, 0xc5, 0xe5, 0x72, 0x24, 0xb7, 0xb3, 0xd9, + 0xdd, 0xa8, 0x29, 0xb5, 0xb5, 0x11, 0xfc, 0x13, 0x96, 0xfe, 0x8c, 0x94, 0x01, 0x9b, 0x54, 0x22, + 0x17, 0xc1, 0xbf, 0x21, 0xd9, 0xbd, 0x14, 0x26, 0x6a, 0x73, 0x0c, 0xf3, 0xde, 0xfb, 0xee, 0xcd, + 0xfa, 0xbb, 0x12, 0xbb, 0x46, 0x61, 0xaf, 0x07, 0xba, 0xc3, 0x14, 0xbf, 0x86, 0xfe, 0x80, 0xab, + 0x61, 0x28, 0x15, 0x1a, 0x0c, 0x36, 0xe6, 0x62, 0xe8, 0xc4, 0xd2, 0x26, 0x4b, 0x13, 0x81, 0x60, + 0xbf, 0xce, 0x53, 0x2a, 0xc6, 0x18, 0xa3, 0x1d, 0x61, 0x36, 0xe5, 0xdb, 0xbd, 0x18, 0x31, 0xee, + 0x71, 0x60, 0x32, 0x01, 0x26, 0x04, 0x1a, 0x66, 0x12, 0x14, 0x3a, 0x57, 0xab, 0x6d, 0xd4, 0x29, + 0x6a, 0x88, 0x98, 0xe6, 0xee, 0x87, 0x70, 0x53, 0x8b, 0xb8, 0x61, 0x35, 0x90, 0x2c, 0x4e, 0x84, + 0x35, 0xcf, 0x49, 0x8b, 0x05, 0x25, 0x53, 0x2c, 0xcd, 0x49, 0xe5, 0xa2, 0x1f, 0x34, 0x67, 0xf9, + 0x4b, 0xbb, 0x6c, 0xf1, 0xfe, 0x80, 0x6b, 0x53, 0x6e, 0xfa, 0x5b, 0x3f, 0xb6, 0x5a, 0xa2, 0xd0, + 0x3c, 0x38, 0xf7, 0x0b, 0x2e, 0xbc, 0x43, 0x0e, 0xc8, 0xf1, 0x7a, 0x7d, 0x3b, 0x5c, 0xb8, 0x2f, + 0x74, 0x81, 0xc6, 0xda, 0xe8, 0x7d, 0xdf, 0x7b, 0xf9, 0x7a, 0xad, 0x92, 0x56, 0x9e, 0xa8, 0x3f, + 0x12, 0x7f, 0xd5, 0x32, 0x83, 0x7b, 0xe2, 0x17, 0x9c, 0x2f, 0x38, 0x5c, 0x02, 0x2c, 0x97, 0x29, + 0x55, 0xfe, 0x37, 0xb9, 0x6e, 0xe5, 0x93, 0x87, 0xb7, 0xcf, 0xe7, 0x95, 0xa3, 0xa0, 0x02, 0x33, + 0xf7, 0xa9, 0xe0, 0xe6, 0x16, 0x55, 0x17, 0x7e, 0x3f, 0xbe, 0x71, 0x31, 0xca, 0x28, 0x19, 0x67, + 0x94, 0x4c, 0x32, 0x4a, 0x3e, 0x32, 0x4a, 0x9e, 0xa6, 0xd4, 0x1b, 0x4f, 0xa9, 0x37, 0x99, 0x52, + 0xef, 0x0a, 0xe2, 0xc4, 0x74, 0x06, 0x51, 0xd8, 0xc6, 0xf4, 0x0f, 0xda, 0xdd, 0x9c, 0x67, 0x86, + 0x92, 0xeb, 0xa8, 0x60, 0x1f, 0xf3, 0xec, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x24, 0xe8, 0x83, 0xee, + 0x0d, 0x02, 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) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.shared.Query/Params", in, out, opts...) + 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) +} + +// 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 RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.shared.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.shared.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/shared/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 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 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 skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/query.pb.gw.go b/x/shared/types/query.pb.gw.go new file mode 100644 index 000000000..8fdaf9bed --- /dev/null +++ b/x/shared/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/shared/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "shared", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/shared/types/service.pb.go b/x/shared/types/service.pb.go new file mode 100644 index 000000000..1a2538f90 --- /dev/null +++ b/x/shared/types/service.pb.go @@ -0,0 +1,1675 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/service.proto + +// NOTE that the `shared` package is not a Cosmos module, +// but rather a manually created package to resolve circular type dependencies. + +package types + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Enum to define RPC types +type RPCType int32 + +const ( + RPCType_UNKNOWN_RPC RPCType = 0 + RPCType_GRPC RPCType = 1 + RPCType_WEBSOCKET RPCType = 2 + RPCType_JSON_RPC RPCType = 3 + RPCType_REST RPCType = 4 +) + +var RPCType_name = map[int32]string{ + 0: "UNKNOWN_RPC", + 1: "GRPC", + 2: "WEBSOCKET", + 3: "JSON_RPC", + 4: "REST", +} + +var RPCType_value = map[string]int32{ + "UNKNOWN_RPC": 0, + "GRPC": 1, + "WEBSOCKET": 2, + "JSON_RPC": 3, + "REST": 4, +} + +func (x RPCType) String() string { + return proto.EnumName(RPCType_name, int32(x)) +} + +func (RPCType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{0} +} + +// Enum to define configuration options +// TODO_RESEARCH: Should these be configs, SLAs or something else? There will be more discussion once we get closer to implementing on-chain QoS. +type ConfigOptions int32 + +const ( + ConfigOptions_UNKNOWN_CONFIG ConfigOptions = 0 + ConfigOptions_TIMEOUT ConfigOptions = 1 +) + +var ConfigOptions_name = map[int32]string{ + 0: "UNKNOWN_CONFIG", + 1: "TIMEOUT", +} + +var ConfigOptions_value = map[string]int32{ + "UNKNOWN_CONFIG": 0, + "TIMEOUT": 1, +} + +func (x ConfigOptions) String() string { + return proto.EnumName(ConfigOptions_name, int32(x)) +} + +func (ConfigOptions) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{1} +} + +// Service message to encapsulate unique and semantic identifiers for a service on the network +type Service struct { + // For example, what if we want to request a session for a certain service but with some additional configs that identify it? + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // TODO_BETA: Either remove this or rename it to alias. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // The cost of a single relay for this service in terms of compute units. + // Must be used alongside the global 'compute_units_to_tokens_multipler' to calculate the cost of a relay for this service. + // cost_per_relay_for_specific_service = compute_units_per_relay_for_specific_service * compute_units_to_tokens_multipler_global_value + ComputeUnitsPerRelay uint64 `protobuf:"varint,3,opt,name=compute_units_per_relay,json=computeUnitsPerRelay,proto3" json:"compute_units_per_relay,omitempty"` + // The owner address that created the service. + // It is the address that receives rewards based on the Service's on-chain usage + // It is the only address that can update the service configuration (e.g. compute_units_per_relay), + // or make other updates to it. + OwnerAddress string `protobuf:"bytes,4,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{0} +} +func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Service.Merge(m, src) +} +func (m *Service) XXX_Size() int { + return m.Size() +} +func (m *Service) XXX_DiscardUnknown() { + xxx_messageInfo_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_Service proto.InternalMessageInfo + +func (m *Service) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Service) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Service) GetComputeUnitsPerRelay() uint64 { + if m != nil { + return m.ComputeUnitsPerRelay + } + return 0 +} + +func (m *Service) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + +// ApplicationServiceConfig holds the service configuration the application stakes for +type ApplicationServiceConfig struct { + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` +} + +func (m *ApplicationServiceConfig) Reset() { *m = ApplicationServiceConfig{} } +func (m *ApplicationServiceConfig) String() string { return proto.CompactTextString(m) } +func (*ApplicationServiceConfig) ProtoMessage() {} +func (*ApplicationServiceConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{1} +} +func (m *ApplicationServiceConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ApplicationServiceConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationServiceConfig.Merge(m, src) +} +func (m *ApplicationServiceConfig) XXX_Size() int { + return m.Size() +} +func (m *ApplicationServiceConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationServiceConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationServiceConfig proto.InternalMessageInfo + +func (m *ApplicationServiceConfig) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +// SupplierServiceConfig holds the service configuration the supplier stakes for +type SupplierServiceConfig struct { + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + Endpoints []*SupplierEndpoint `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + RevShare []*ServiceRevenueShare `protobuf:"bytes,3,rep,name=rev_share,json=revShare,proto3" json:"rev_share,omitempty"` +} + +func (m *SupplierServiceConfig) Reset() { *m = SupplierServiceConfig{} } +func (m *SupplierServiceConfig) String() string { return proto.CompactTextString(m) } +func (*SupplierServiceConfig) ProtoMessage() {} +func (*SupplierServiceConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{2} +} +func (m *SupplierServiceConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SupplierServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SupplierServiceConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_SupplierServiceConfig.Merge(m, src) +} +func (m *SupplierServiceConfig) XXX_Size() int { + return m.Size() +} +func (m *SupplierServiceConfig) XXX_DiscardUnknown() { + xxx_messageInfo_SupplierServiceConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_SupplierServiceConfig proto.InternalMessageInfo + +func (m *SupplierServiceConfig) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *SupplierServiceConfig) GetEndpoints() []*SupplierEndpoint { + if m != nil { + return m.Endpoints + } + return nil +} + +func (m *SupplierServiceConfig) GetRevShare() []*ServiceRevenueShare { + if m != nil { + return m.RevShare + } + return nil +} + +// SupplierEndpoint message to hold service configuration details +type SupplierEndpoint struct { + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + RpcType RPCType `protobuf:"varint,2,opt,name=rpc_type,json=rpcType,proto3,enum=poktroll.shared.RPCType" json:"rpc_type,omitempty"` + Configs []*ConfigOption `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"` +} + +func (m *SupplierEndpoint) Reset() { *m = SupplierEndpoint{} } +func (m *SupplierEndpoint) String() string { return proto.CompactTextString(m) } +func (*SupplierEndpoint) ProtoMessage() {} +func (*SupplierEndpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{3} +} +func (m *SupplierEndpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SupplierEndpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SupplierEndpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_SupplierEndpoint.Merge(m, src) +} +func (m *SupplierEndpoint) XXX_Size() int { + return m.Size() +} +func (m *SupplierEndpoint) XXX_DiscardUnknown() { + xxx_messageInfo_SupplierEndpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_SupplierEndpoint proto.InternalMessageInfo + +func (m *SupplierEndpoint) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *SupplierEndpoint) GetRpcType() RPCType { + if m != nil { + return m.RpcType + } + return RPCType_UNKNOWN_RPC +} + +func (m *SupplierEndpoint) GetConfigs() []*ConfigOption { + if m != nil { + return m.Configs + } + return nil +} + +// ServiceRevenueShare message to hold revenue share configuration details +type ServiceRevenueShare struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + RevSharePercentage float32 `protobuf:"fixed32,2,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` +} + +func (m *ServiceRevenueShare) Reset() { *m = ServiceRevenueShare{} } +func (m *ServiceRevenueShare) String() string { return proto.CompactTextString(m) } +func (*ServiceRevenueShare) ProtoMessage() {} +func (*ServiceRevenueShare) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{4} +} +func (m *ServiceRevenueShare) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceRevenueShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceRevenueShare) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceRevenueShare.Merge(m, src) +} +func (m *ServiceRevenueShare) XXX_Size() int { + return m.Size() +} +func (m *ServiceRevenueShare) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceRevenueShare.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceRevenueShare proto.InternalMessageInfo + +func (m *ServiceRevenueShare) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ServiceRevenueShare) GetRevSharePercentage() float32 { + if m != nil { + return m.RevSharePercentage + } + return 0 +} + +// Key-value wrapper for config options, as proto maps can't be keyed by enums +type ConfigOption struct { + Key ConfigOptions `protobuf:"varint,1,opt,name=key,proto3,enum=poktroll.shared.ConfigOptions" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *ConfigOption) Reset() { *m = ConfigOption{} } +func (m *ConfigOption) String() string { return proto.CompactTextString(m) } +func (*ConfigOption) ProtoMessage() {} +func (*ConfigOption) Descriptor() ([]byte, []int) { + return fileDescriptor_302c2f793a11ae1e, []int{5} +} +func (m *ConfigOption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConfigOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigOption.Merge(m, src) +} +func (m *ConfigOption) XXX_Size() int { + return m.Size() +} +func (m *ConfigOption) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigOption.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigOption proto.InternalMessageInfo + +func (m *ConfigOption) GetKey() ConfigOptions { + if m != nil { + return m.Key + } + return ConfigOptions_UNKNOWN_CONFIG +} + +func (m *ConfigOption) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func init() { + proto.RegisterEnum("poktroll.shared.RPCType", RPCType_name, RPCType_value) + proto.RegisterEnum("poktroll.shared.ConfigOptions", ConfigOptions_name, ConfigOptions_value) + proto.RegisterType((*Service)(nil), "poktroll.shared.Service") + proto.RegisterType((*ApplicationServiceConfig)(nil), "poktroll.shared.ApplicationServiceConfig") + proto.RegisterType((*SupplierServiceConfig)(nil), "poktroll.shared.SupplierServiceConfig") + proto.RegisterType((*SupplierEndpoint)(nil), "poktroll.shared.SupplierEndpoint") + proto.RegisterType((*ServiceRevenueShare)(nil), "poktroll.shared.ServiceRevenueShare") + proto.RegisterType((*ConfigOption)(nil), "poktroll.shared.ConfigOption") +} + +func init() { proto.RegisterFile("poktroll/shared/service.proto", fileDescriptor_302c2f793a11ae1e) } + +var fileDescriptor_302c2f793a11ae1e = []byte{ + // 621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xcd, 0x26, 0x81, 0x24, 0xd3, 0x36, 0xb5, 0x86, 0x20, 0x4c, 0xa5, 0x5a, 0x25, 0xe2, 0x50, + 0x55, 0x6a, 0x52, 0xa5, 0x42, 0x88, 0x03, 0x42, 0x6d, 0x14, 0xaa, 0x52, 0x35, 0x89, 0xd6, 0x29, + 0x95, 0xb8, 0x58, 0xae, 0xbd, 0xa4, 0x56, 0x13, 0xaf, 0xb5, 0xb6, 0x53, 0x22, 0x7e, 0x02, 0xf1, + 0x0b, 0xfc, 0x02, 0x27, 0xbe, 0x80, 0x63, 0xc5, 0xa9, 0x47, 0x94, 0xfe, 0x08, 0x5a, 0xaf, 0x1d, + 0xa0, 0x41, 0x20, 0x6e, 0xe3, 0x79, 0x6f, 0x66, 0xde, 0xbe, 0x1d, 0x2f, 0xac, 0x07, 0xfc, 0x22, + 0x12, 0x7c, 0x34, 0x6a, 0x86, 0xe7, 0xb6, 0x60, 0x6e, 0x33, 0x64, 0x62, 0xe2, 0x39, 0xac, 0x11, + 0x08, 0x1e, 0x71, 0x5c, 0xcd, 0xe0, 0x86, 0x82, 0xd7, 0x1e, 0x3a, 0x3c, 0x1c, 0xf3, 0xd0, 0x4a, + 0xe0, 0xa6, 0xfa, 0x50, 0xdc, 0xb5, 0xda, 0x90, 0x0f, 0xb9, 0xca, 0xcb, 0x48, 0x65, 0xeb, 0x9f, + 0x08, 0x94, 0x4c, 0xd5, 0x13, 0xab, 0x90, 0xf7, 0x5c, 0x9d, 0x6c, 0x90, 0xcd, 0x0a, 0xcd, 0x7b, + 0x2e, 0x22, 0x14, 0x7d, 0x7b, 0xcc, 0xf4, 0x7c, 0x92, 0x49, 0x62, 0x7c, 0x02, 0x0f, 0x1c, 0x3e, + 0x0e, 0xe2, 0x88, 0x59, 0xb1, 0xef, 0x45, 0xa1, 0x15, 0x30, 0x61, 0x09, 0x36, 0xb2, 0xa7, 0x7a, + 0x61, 0x83, 0x6c, 0x16, 0x69, 0x2d, 0x85, 0x4f, 0x24, 0xda, 0x67, 0x82, 0x4a, 0x0c, 0x9f, 0xc3, + 0x0a, 0xbf, 0xf4, 0x99, 0xb0, 0x6c, 0xd7, 0x15, 0x2c, 0x0c, 0xf5, 0xa2, 0xec, 0xb9, 0xaf, 0x7f, + 0xfb, 0xbc, 0x5d, 0x4b, 0x55, 0xee, 0x29, 0xc4, 0x8c, 0x84, 0xe7, 0x0f, 0xe9, 0x72, 0x42, 0x4f, + 0x73, 0xf5, 0x67, 0xa0, 0xef, 0x05, 0xc1, 0xc8, 0x73, 0xec, 0xc8, 0xe3, 0x7e, 0xaa, 0xb7, 0xcd, + 0xfd, 0xb7, 0xde, 0x10, 0xd7, 0x01, 0x52, 0x53, 0xac, 0xb9, 0xfa, 0x4a, 0x9a, 0x39, 0x74, 0xeb, + 0x5f, 0x08, 0xdc, 0x37, 0x63, 0x59, 0xcc, 0xc4, 0xff, 0x14, 0xe2, 0x0b, 0xa8, 0x30, 0xdf, 0x0d, + 0xb8, 0xe7, 0x47, 0xa1, 0x9e, 0xdf, 0x28, 0x6c, 0x2e, 0xb5, 0x1e, 0x35, 0x6e, 0xf9, 0xdd, 0xc8, + 0x3a, 0x77, 0x52, 0x26, 0xfd, 0x59, 0x83, 0x7b, 0x50, 0x11, 0x6c, 0x62, 0x25, 0x4c, 0xbd, 0x90, + 0x34, 0x78, 0xbc, 0xd8, 0x40, 0xcd, 0xa3, 0x6c, 0xc2, 0xfc, 0x98, 0x99, 0x32, 0x49, 0xcb, 0x82, + 0x4d, 0x92, 0xa8, 0xfe, 0x91, 0x80, 0x76, 0x7b, 0x04, 0x6a, 0x50, 0x88, 0xc5, 0x28, 0x15, 0x2c, + 0x43, 0xdc, 0x85, 0xb2, 0x08, 0x1c, 0x2b, 0x9a, 0x06, 0xea, 0xb2, 0xaa, 0x2d, 0x7d, 0x61, 0x10, + 0xed, 0xb7, 0x07, 0xd3, 0x80, 0xd1, 0x92, 0x08, 0x1c, 0x19, 0xe0, 0x53, 0x28, 0x39, 0x89, 0x11, + 0x61, 0x2a, 0x6e, 0x7d, 0xa1, 0x46, 0x19, 0xd5, 0x0b, 0xa4, 0xe9, 0x34, 0x63, 0xd7, 0xdf, 0xc3, + 0xbd, 0x3f, 0xa8, 0xc6, 0x16, 0x94, 0xb2, 0xcb, 0x25, 0xff, 0xb8, 0xdc, 0x8c, 0x88, 0x3b, 0x50, + 0x9b, 0x5b, 0x24, 0x37, 0xc9, 0x61, 0x7e, 0x64, 0x0f, 0xd5, 0x21, 0xf2, 0x14, 0x33, 0x1f, 0xfa, + 0x73, 0xa4, 0xfe, 0x1a, 0x96, 0x7f, 0x55, 0x85, 0x3b, 0x50, 0xb8, 0x60, 0xd3, 0x64, 0x62, 0xb5, + 0x65, 0xfc, 0xf5, 0x04, 0x21, 0x95, 0x54, 0xac, 0xc1, 0x9d, 0x89, 0x3d, 0x8a, 0xb3, 0xb5, 0x56, + 0x1f, 0x5b, 0x47, 0x50, 0x4a, 0x1d, 0xc2, 0x55, 0x58, 0x3a, 0xe9, 0x1e, 0x75, 0x7b, 0xa7, 0x5d, + 0x8b, 0xf6, 0xdb, 0x5a, 0x0e, 0xcb, 0x50, 0x3c, 0x90, 0x11, 0xc1, 0x15, 0xa8, 0x9c, 0x76, 0xf6, + 0xcd, 0x5e, 0xfb, 0xa8, 0x33, 0xd0, 0xf2, 0xb8, 0x0c, 0xe5, 0x57, 0x66, 0x4f, 0xd1, 0x0a, 0x92, + 0x46, 0x3b, 0xe6, 0x40, 0x2b, 0x6e, 0xed, 0xc0, 0xca, 0x6f, 0x83, 0x11, 0xa1, 0x9a, 0xb5, 0x6c, + 0xf7, 0xba, 0x2f, 0x0f, 0x0f, 0xb4, 0x1c, 0x2e, 0x41, 0x69, 0x70, 0x78, 0xdc, 0xe9, 0x9d, 0x0c, + 0x34, 0xb2, 0x7f, 0xfc, 0x75, 0x66, 0x90, 0xab, 0x99, 0x41, 0xae, 0x67, 0x06, 0xf9, 0x3e, 0x33, + 0xc8, 0x87, 0x1b, 0x23, 0x77, 0x75, 0x63, 0xe4, 0xae, 0x6f, 0x8c, 0xdc, 0x9b, 0xe6, 0xd0, 0x8b, + 0xce, 0xe3, 0xb3, 0x86, 0xc3, 0xc7, 0x4d, 0x79, 0xc2, 0x6d, 0x9f, 0x45, 0x97, 0x5c, 0x5c, 0x34, + 0xe7, 0xaf, 0xc3, 0xbb, 0xec, 0x7d, 0x90, 0x3b, 0x10, 0x9e, 0xdd, 0x4d, 0x7e, 0xee, 0xdd, 0x1f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x19, 0xf1, 0x60, 0x3f, 0x04, 0x00, 0x00, +} + +func (m *Service) 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 *Service) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintService(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0x22 + } + if m.ComputeUnitsPerRelay != 0 { + i = encodeVarintService(dAtA, i, uint64(m.ComputeUnitsPerRelay)) + i-- + dAtA[i] = 0x18 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintService(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ApplicationServiceConfig) 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 *ApplicationServiceConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationServiceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintService(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SupplierServiceConfig) 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 *SupplierServiceConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SupplierServiceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RevShare) > 0 { + for iNdEx := len(m.RevShare) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RevShare[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintService(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SupplierEndpoint) 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 *SupplierEndpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SupplierEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Configs) > 0 { + for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.RpcType != 0 { + i = encodeVarintService(dAtA, i, uint64(m.RpcType)) + i-- + dAtA[i] = 0x10 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintService(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceRevenueShare) 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 *ServiceRevenueShare) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceRevenueShare) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RevSharePercentage != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.RevSharePercentage)))) + i-- + dAtA[i] = 0x15 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintService(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigOption) 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 *ConfigOption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintService(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if m.Key != 0 { + i = encodeVarintService(dAtA, i, uint64(m.Key)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Service) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.ComputeUnitsPerRelay != 0 { + n += 1 + sovService(uint64(m.ComputeUnitsPerRelay)) + } + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *ApplicationServiceConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *SupplierServiceConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if len(m.Endpoints) > 0 { + for _, e := range m.Endpoints { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + if len(m.RevShare) > 0 { + for _, e := range m.RevShare { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *SupplierEndpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.RpcType != 0 { + n += 1 + sovService(uint64(m.RpcType)) + } + if len(m.Configs) > 0 { + for _, e := range m.Configs { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *ServiceRevenueShare) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.RevSharePercentage != 0 { + n += 5 + } + return n +} + +func (m *ConfigOption) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Key != 0 { + n += 1 + sovService(uint64(m.Key)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Service) 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 ErrIntOverflowService + } + 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: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnitsPerRelay", wireType) + } + m.ComputeUnitsPerRelay = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ComputeUnitsPerRelay |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApplicationServiceConfig) 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 ErrIntOverflowService + } + 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: ApplicationServiceConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationServiceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SupplierServiceConfig) 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 ErrIntOverflowService + } + 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: SupplierServiceConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SupplierServiceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoints = append(m.Endpoints, &SupplierEndpoint{}) + if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RevShare", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RevShare = append(m.RevShare, &ServiceRevenueShare{}) + if err := m.RevShare[len(m.RevShare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SupplierEndpoint) 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 ErrIntOverflowService + } + 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: SupplierEndpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SupplierEndpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RpcType", wireType) + } + m.RpcType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RpcType |= RPCType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Configs = append(m.Configs, &ConfigOption{}) + if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceRevenueShare) 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 ErrIntOverflowService + } + 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: ServiceRevenueShare: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceRevenueShare: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field RevSharePercentage", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.RevSharePercentage = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigOption) 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 ErrIntOverflowService + } + 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: ConfigOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + m.Key = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Key |= ConfigOptions(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipService(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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrInvalidLengthService + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupService + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowService = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/supplier.pb.go b/x/shared/types/supplier.pb.go new file mode 100644 index 000000000..2a062c371 --- /dev/null +++ b/x/shared/types/supplier.pb.go @@ -0,0 +1,706 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/supplier.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" + 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 + +// Supplier is the type defining the actor in Pocket Network that provides RPC services. +type Supplier struct { + // The address of the owner (i.e. staker, custodial) that owns the funds for staking. + // By default, this address is the one that receives all the rewards unless owtherwise specified. + // This property cannot be updated by the operator. + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + // The operator address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address can update the supplier's configurations excluding the owner address. + // This property does not change over the supplier's lifespan, the supplier must be unstaked + // and re-staked to effectively update this value. + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + Stake *types.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` + // The session end height at which an actively unbonding supplier unbonds its stake. + // If the supplier did not unstake, this value will be 0. + UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + // services_activation_heights_map is a map of serviceIds to the height at + // which the staked supplier will become active for that service. + // Activation heights are session start heights. + ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,6,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (m *Supplier) Reset() { *m = Supplier{} } +func (m *Supplier) String() string { return proto.CompactTextString(m) } +func (*Supplier) ProtoMessage() {} +func (*Supplier) Descriptor() ([]byte, []int) { + return fileDescriptor_4a189b52ba503cf2, []int{0} +} +func (m *Supplier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Supplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Supplier) XXX_Merge(src proto.Message) { + xxx_messageInfo_Supplier.Merge(m, src) +} +func (m *Supplier) XXX_Size() int { + return m.Size() +} +func (m *Supplier) XXX_DiscardUnknown() { + xxx_messageInfo_Supplier.DiscardUnknown(m) +} + +var xxx_messageInfo_Supplier proto.InternalMessageInfo + +func (m *Supplier) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + +func (m *Supplier) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +func (m *Supplier) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +func (m *Supplier) GetServices() []*SupplierServiceConfig { + if m != nil { + return m.Services + } + return nil +} + +func (m *Supplier) GetUnstakeSessionEndHeight() uint64 { + if m != nil { + return m.UnstakeSessionEndHeight + } + return 0 +} + +func (m *Supplier) GetServicesActivationHeightsMap() map[string]uint64 { + if m != nil { + return m.ServicesActivationHeightsMap + } + return nil +} + +func init() { + proto.RegisterType((*Supplier)(nil), "poktroll.shared.Supplier") + proto.RegisterMapType((map[string]uint64)(nil), "poktroll.shared.Supplier.ServicesActivationHeightsMapEntry") +} + +func init() { proto.RegisterFile("poktroll/shared/supplier.proto", fileDescriptor_4a189b52ba503cf2) } + +var fileDescriptor_4a189b52ba503cf2 = []byte{ + // 453 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xbf, 0x6e, 0x13, 0x31, + 0x18, 0x8f, 0x9b, 0xa4, 0x2a, 0x2e, 0xa8, 0xd5, 0x29, 0x12, 0xd7, 0x08, 0x4c, 0x60, 0x40, 0x59, + 0x6a, 0xab, 0x65, 0x41, 0x54, 0x0c, 0x4d, 0x54, 0x89, 0xa5, 0x42, 0xba, 0x6c, 0x2c, 0x27, 0x27, + 0x67, 0x2e, 0x56, 0x12, 0x7f, 0x27, 0x7f, 0x4e, 0x4a, 0x56, 0x9e, 0x80, 0x89, 0x27, 0xe1, 0x21, + 0x18, 0x2b, 0xa6, 0x8e, 0x28, 0x79, 0x11, 0x74, 0x67, 0x5f, 0x90, 0x40, 0xd0, 0xcd, 0x9f, 0x7f, + 0x7f, 0xee, 0xf7, 0x3b, 0x7f, 0x94, 0x15, 0x30, 0x73, 0x16, 0xe6, 0x73, 0x81, 0x53, 0x69, 0x55, + 0x26, 0x70, 0x59, 0x14, 0x73, 0xad, 0x2c, 0x2f, 0x2c, 0x38, 0x88, 0x8e, 0x6a, 0x9c, 0x7b, 0xbc, + 0x7b, 0x32, 0x01, 0x5c, 0x00, 0xa6, 0x15, 0x2c, 0xfc, 0xe0, 0xb9, 0x5d, 0xe6, 0x27, 0x31, 0x96, + 0xa8, 0xc4, 0xea, 0x6c, 0xac, 0x9c, 0x3c, 0x13, 0x13, 0xd0, 0x26, 0xe0, 0x4f, 0xff, 0xfa, 0x96, + 0xb2, 0x2b, 0x3d, 0x51, 0x01, 0xee, 0xe4, 0x90, 0x83, 0xb7, 0x2d, 0x4f, 0xfe, 0xf6, 0xc5, 0xd7, + 0x16, 0x3d, 0x18, 0x85, 0x4c, 0xd1, 0x5b, 0xfa, 0x08, 0x6e, 0x8c, 0xb2, 0xa9, 0xcc, 0x32, 0xab, + 0x10, 0x63, 0xd2, 0x23, 0xfd, 0x07, 0x83, 0xf8, 0xc7, 0xb7, 0xd3, 0x4e, 0x88, 0x72, 0xe9, 0x91, + 0x91, 0xb3, 0xda, 0xe4, 0xc9, 0xc3, 0x8a, 0x1e, 0xee, 0xa2, 0x21, 0x3d, 0x86, 0x42, 0x59, 0xe9, + 0xe0, 0xb7, 0xc3, 0xde, 0x3d, 0x0e, 0x47, 0xb5, 0xa2, 0x36, 0x11, 0xb4, 0x8d, 0x4e, 0xce, 0x54, + 0xdc, 0xec, 0x91, 0xfe, 0xe1, 0xf9, 0x09, 0x0f, 0xb2, 0xb2, 0x35, 0x0f, 0xad, 0xf9, 0x10, 0xb4, + 0x49, 0x3c, 0x2f, 0x1a, 0xd0, 0x83, 0x50, 0x14, 0xe3, 0x56, 0xaf, 0xd9, 0x3f, 0x3c, 0x7f, 0xc9, + 0xff, 0xf8, 0xab, 0xbc, 0x6e, 0x38, 0xf2, 0xc4, 0x21, 0x98, 0x8f, 0x3a, 0x4f, 0x76, 0xba, 0xe8, + 0x82, 0x76, 0x97, 0xa6, 0xb2, 0x4b, 0x51, 0x21, 0x6a, 0x30, 0xa9, 0x32, 0x59, 0x3a, 0x55, 0x3a, + 0x9f, 0xba, 0xb8, 0xdd, 0x23, 0xfd, 0x56, 0xf2, 0x38, 0x30, 0x46, 0x9e, 0x70, 0x65, 0xb2, 0x77, + 0x15, 0x1c, 0x7d, 0x26, 0xf4, 0x59, 0xed, 0x94, 0xca, 0x89, 0xd3, 0x2b, 0xe9, 0x4a, 0x07, 0xaf, + 0xc6, 0x74, 0x21, 0x8b, 0x78, 0xbf, 0x0a, 0x76, 0xf1, 0xcf, 0x60, 0x3c, 0x24, 0xc3, 0xcb, 0x9d, + 0xde, 0xbb, 0xe3, 0xb5, 0x2c, 0xae, 0x8c, 0xb3, 0xeb, 0xe4, 0x09, 0xfe, 0x87, 0xd2, 0x7d, 0x4f, + 0x9f, 0xdf, 0x6b, 0x11, 0x1d, 0xd3, 0xe6, 0x4c, 0xad, 0xfd, 0xab, 0x26, 0xe5, 0x31, 0xea, 0xd0, + 0xf6, 0x4a, 0xce, 0x97, 0xaa, 0x7a, 0xa7, 0x56, 0xe2, 0x87, 0x37, 0x7b, 0xaf, 0xc9, 0xe0, 0xfa, + 0xfb, 0x86, 0x91, 0xdb, 0x0d, 0x23, 0x77, 0x1b, 0x46, 0x7e, 0x6e, 0x18, 0xf9, 0xb2, 0x65, 0x8d, + 0xdb, 0x2d, 0x6b, 0xdc, 0x6d, 0x59, 0xe3, 0x83, 0xc8, 0xb5, 0x9b, 0x2e, 0xc7, 0x7c, 0x02, 0x0b, + 0x51, 0x76, 0x3a, 0x35, 0xca, 0xdd, 0x80, 0x9d, 0x89, 0xdd, 0x0e, 0x7e, 0xaa, 0xb7, 0xd0, 0xad, + 0x0b, 0x85, 0xe3, 0xfd, 0x6a, 0xdd, 0x5e, 0xfd, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x51, 0xcd, 0x0a, + 0x68, 0x11, 0x03, 0x00, 0x00, +} + +func (m *Supplier) 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 *Supplier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ServicesActivationHeightsMap) > 0 { + keysForServicesActivationHeightsMap := make([]string, 0, len(m.ServicesActivationHeightsMap)) + for k := range m.ServicesActivationHeightsMap { + keysForServicesActivationHeightsMap = append(keysForServicesActivationHeightsMap, string(k)) + } + github_com_cosmos_gogoproto_sortkeys.Strings(keysForServicesActivationHeightsMap) + for iNdEx := len(keysForServicesActivationHeightsMap) - 1; iNdEx >= 0; iNdEx-- { + v := m.ServicesActivationHeightsMap[string(keysForServicesActivationHeightsMap[iNdEx])] + baseI := i + i = encodeVarintSupplier(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(keysForServicesActivationHeightsMap[iNdEx]) + copy(dAtA[i:], keysForServicesActivationHeightsMap[iNdEx]) + i = encodeVarintSupplier(dAtA, i, uint64(len(keysForServicesActivationHeightsMap[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintSupplier(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.UnstakeSessionEndHeight != 0 { + i = encodeVarintSupplier(dAtA, i, uint64(m.UnstakeSessionEndHeight)) + i-- + dAtA[i] = 0x28 + } + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSupplier(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSupplier(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintSupplier(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintSupplier(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSupplier(dAtA []byte, offset int, v uint64) int { + offset -= sovSupplier(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Supplier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovSupplier(uint64(l)) + } + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovSupplier(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovSupplier(uint64(l)) + } + if len(m.Services) > 0 { + for _, e := range m.Services { + l = e.Size() + n += 1 + l + sovSupplier(uint64(l)) + } + } + if m.UnstakeSessionEndHeight != 0 { + n += 1 + sovSupplier(uint64(m.UnstakeSessionEndHeight)) + } + if len(m.ServicesActivationHeightsMap) > 0 { + for k, v := range m.ServicesActivationHeightsMap { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovSupplier(uint64(len(k))) + 1 + sovSupplier(uint64(v)) + n += mapEntrySize + 1 + sovSupplier(uint64(mapEntrySize)) + } + } + return n +} + +func sovSupplier(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSupplier(x uint64) (n int) { + return sovSupplier(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Supplier) 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 ErrIntOverflowSupplier + } + 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: Supplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Supplier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + 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 ErrInvalidLengthSupplier + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + 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 ErrInvalidLengthSupplier + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSupplier + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSupplier + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Services = append(m.Services, &SupplierServiceConfig{}) + if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) + } + m.UnstakeSessionEndHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnstakeSessionEndHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServicesActivationHeightsMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSupplier + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServicesActivationHeightsMap == nil { + m.ServicesActivationHeightsMap = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthSupplier + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthSupplier + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipSupplier(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSupplier + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.ServicesActivationHeightsMap[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSupplier(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSupplier + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSupplier(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, ErrIntOverflowSupplier + } + 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, ErrIntOverflowSupplier + } + 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, ErrIntOverflowSupplier + } + 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, ErrInvalidLengthSupplier + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSupplier + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSupplier + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSupplier = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSupplier = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSupplier = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/shared/types/tx.pb.go b/x/shared/types/tx.pb.go new file mode 100644 index 000000000..553ff6736 --- /dev/null +++ b/x/shared/types/tx.pb.go @@ -0,0 +1,1262 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/shared/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_3f2a7564b43f4d89, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3f2a7564b43f4d89, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. +type MsgUpdateParam struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Types that are valid to be assigned to AsType: + // *MsgUpdateParam_AsString + // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsBytes + AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` +} + +func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } +func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParam) ProtoMessage() {} +func (*MsgUpdateParam) Descriptor() ([]byte, []int) { + return fileDescriptor_3f2a7564b43f4d89, []int{2} +} +func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParam.Merge(m, src) +} +func (m *MsgUpdateParam) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParam) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo + +type isMsgUpdateParam_AsType interface { + isMsgUpdateParam_AsType() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateParam_AsString struct { + AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` +} +type MsgUpdateParam_AsInt64 struct { + AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` +} +type MsgUpdateParam_AsBytes struct { + AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` +} + +func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} + +func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { + if m != nil { + return m.AsType + } + return nil +} + +func (m *MsgUpdateParam) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParam) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpdateParam) GetAsString() string { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { + return x.AsString + } + return "" +} + +func (m *MsgUpdateParam) GetAsInt64() int64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { + return x.AsInt64 + } + return 0 +} + +func (m *MsgUpdateParam) GetAsBytes() []byte { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { + return x.AsBytes + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateParam_AsString)(nil), + (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsBytes)(nil), + } +} + +// MsgUpdateParamResponse defines the response structure for executing a +// MsgUpdateParam message after a single param update. +type MsgUpdateParamResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } +func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamResponse) ProtoMessage() {} +func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3f2a7564b43f4d89, []int{3} +} +func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) +} +func (m *MsgUpdateParamResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo + +func (m *MsgUpdateParamResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.shared.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.shared.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.shared.MsgUpdateParam") + proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.shared.MsgUpdateParamResponse") +} + +func init() { proto.RegisterFile("poktroll/shared/tx.proto", fileDescriptor_3f2a7564b43f4d89) } + +var fileDescriptor_3f2a7564b43f4d89 = []byte{ + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xf6, 0x11, 0x48, 0xea, 0x6b, 0x68, 0x85, 0x55, 0x11, 0xd7, 0x42, 0x8e, 0xc9, 0x82, 0x89, + 0xa8, 0x4f, 0x94, 0xaa, 0x43, 0x36, 0x3c, 0xb5, 0x43, 0x24, 0x64, 0x84, 0x90, 0xba, 0x44, 0x97, + 0xc6, 0x72, 0xac, 0xd6, 0x3e, 0xcb, 0xef, 0x0a, 0xcd, 0x86, 0x18, 0x99, 0xf8, 0x33, 0x18, 0x33, + 0xb0, 0x31, 0xb1, 0x75, 0xac, 0x98, 0x3a, 0x45, 0x28, 0x19, 0x22, 0xf5, 0x5f, 0x60, 0x41, 0x3e, + 0xff, 0x08, 0x71, 0x24, 0x22, 0x75, 0x49, 0xde, 0x7d, 0xdf, 0xf7, 0xbe, 0x7b, 0xef, 0xde, 0x33, + 0x56, 0x23, 0x76, 0xc6, 0x63, 0x76, 0x7e, 0x4e, 0x60, 0x48, 0x63, 0x77, 0x40, 0xf8, 0xa5, 0x15, + 0xc5, 0x8c, 0x33, 0x65, 0x3b, 0x67, 0xac, 0x94, 0xd1, 0x1e, 0xd1, 0xc0, 0x0f, 0x19, 0x11, 0xbf, + 0xa9, 0x46, 0x6b, 0x9c, 0x32, 0x08, 0x18, 0x90, 0x00, 0x3c, 0xf2, 0xe1, 0x65, 0xf2, 0x97, 0x11, + 0xbb, 0x29, 0xd1, 0x13, 0x27, 0x92, 0x1e, 0x32, 0x6a, 0xc7, 0x63, 0x1e, 0x4b, 0xf1, 0x24, 0xca, + 0xd0, 0x27, 0xe5, 0x3a, 0x22, 0x1a, 0xd3, 0x20, 0xcb, 0x69, 0xfd, 0x40, 0x78, 0xbb, 0x0b, 0xde, + 0xbb, 0x68, 0x40, 0xb9, 0xfb, 0x46, 0x30, 0xca, 0x21, 0x96, 0xe9, 0x05, 0x1f, 0xb2, 0xd8, 0xe7, + 0x23, 0x15, 0x19, 0xc8, 0x94, 0x6d, 0xf5, 0xd7, 0xf7, 0xbd, 0x9d, 0xec, 0xb2, 0xd7, 0x83, 0x41, + 0xec, 0x02, 0xbc, 0xe5, 0xb1, 0x1f, 0x7a, 0xce, 0x42, 0xaa, 0x74, 0x70, 0x35, 0xf5, 0x56, 0xef, + 0x19, 0xc8, 0xdc, 0xdc, 0x6f, 0x58, 0xa5, 0x46, 0xad, 0xf4, 0x02, 0x5b, 0xbe, 0x9a, 0x34, 0xa5, + 0x6f, 0xf3, 0x71, 0x1b, 0x39, 0x59, 0x46, 0xe7, 0xe0, 0xf3, 0x7c, 0xdc, 0x5e, 0x78, 0x7d, 0x99, + 0x8f, 0xdb, 0x4f, 0x8b, 0xc2, 0x2f, 0xf3, 0xd2, 0x4b, 0x95, 0xb6, 0x76, 0x71, 0xa3, 0x04, 0x39, + 0x2e, 0x44, 0x2c, 0x04, 0xb7, 0xf5, 0x07, 0xe1, 0xad, 0x65, 0xee, 0xce, 0x7d, 0x29, 0xf8, 0x7e, + 0x48, 0x03, 0x57, 0x74, 0x25, 0x3b, 0x22, 0x56, 0x5e, 0x60, 0x99, 0x42, 0x0f, 0x84, 0x56, 0xad, + 0x08, 0xaf, 0x87, 0xb7, 0x93, 0xe6, 0x02, 0x3c, 0x92, 0x9c, 0x0d, 0x9a, 0x99, 0x29, 0xcf, 0xf1, + 0x06, 0x85, 0x9e, 0x1f, 0xf2, 0xc3, 0x03, 0xb5, 0x6a, 0x20, 0xb3, 0x62, 0xd7, 0x6f, 0x27, 0xcd, + 0x02, 0x3b, 0x92, 0x9c, 0x1a, 0x85, 0xe3, 0x24, 0xcc, 0xa4, 0xfd, 0x11, 0x77, 0x41, 0xad, 0x19, + 0xc8, 0xac, 0x17, 0x52, 0x81, 0xa5, 0x52, 0x3b, 0x09, 0x3b, 0x5b, 0xcb, 0x6f, 0x66, 0xcb, 0xb8, + 0x46, 0xa1, 0xc7, 0x47, 0x91, 0xdb, 0x3a, 0xc6, 0x8f, 0x97, 0x9b, 0xcf, 0xdf, 0x45, 0x21, 0xc5, + 0x90, 0xd0, 0x7f, 0x87, 0x94, 0x4f, 0x66, 0xff, 0x27, 0xc2, 0x95, 0x2e, 0x78, 0xca, 0x09, 0xae, + 0x2f, 0x6d, 0x89, 0xb1, 0x92, 0x58, 0x1a, 0x85, 0x66, 0xae, 0x53, 0x14, 0x45, 0xbd, 0xc7, 0x9b, + 0xff, 0x0e, 0xaa, 0xb9, 0x26, 0x51, 0x7b, 0xb6, 0x46, 0x90, 0x1b, 0x6b, 0x0f, 0x3e, 0x25, 0x5b, + 0x66, 0x77, 0xaf, 0xa6, 0x3a, 0xba, 0x9e, 0xea, 0xe8, 0x66, 0xaa, 0xa3, 0xdf, 0x53, 0x1d, 0x7d, + 0x9d, 0xe9, 0xd2, 0xf5, 0x4c, 0x97, 0x6e, 0x66, 0xba, 0x74, 0x42, 0x3c, 0x9f, 0x0f, 0x2f, 0xfa, + 0xd6, 0x29, 0x0b, 0x48, 0xe2, 0xbb, 0x17, 0xba, 0xfc, 0x23, 0x8b, 0xcf, 0xc8, 0xea, 0x02, 0x26, + 0x8f, 0x0b, 0xfd, 0xaa, 0xf8, 0x76, 0x5e, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x90, 0x6c, 0xe9, + 0x9c, 0xe3, 0x03, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.shared.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, "/poktroll.shared.Msg/UpdateParam", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.shared.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.shared.Msg/UpdateParam", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.shared.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/shared/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AsType != nil { + { + size := m.AsType.Size() + i -= size + if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.AsString) + copy(dAtA[i:], m.AsString) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AsBytes != nil { + i -= len(m.AsBytes) + copy(dAtA[i:], m.AsBytes) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AsType != nil { + n += m.AsType.Size() + } + return n +} + +func (m *MsgUpdateParam_AsString) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AsString) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgUpdateParam_AsInt64) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.AsInt64)) + return n +} +func (m *MsgUpdateParam_AsBytes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsBytes != nil { + l = len(m.AsBytes) + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUpdateParamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParam) 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 ErrIntOverflowTx + } + 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: MsgUpdateParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AsType = &MsgUpdateParam_AsInt64{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.AsType = &MsgUpdateParam_AsBytes{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/supplier/types/event.pb.go b/x/supplier/types/event.pb.go new file mode 100644 index 000000000..477ceced0 --- /dev/null +++ b/x/supplier/types/event.pb.go @@ -0,0 +1,755 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// EventSupplierStaked is emitted with the commitment of the supplier stake message. +type EventSupplierStaked struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier"` +} + +func (m *EventSupplierStaked) Reset() { *m = EventSupplierStaked{} } +func (m *EventSupplierStaked) String() string { return proto.CompactTextString(m) } +func (*EventSupplierStaked) ProtoMessage() {} +func (*EventSupplierStaked) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{0} +} +func (m *EventSupplierStaked) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierStaked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierStaked) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierStaked.Merge(m, src) +} +func (m *EventSupplierStaked) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierStaked) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierStaked.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierStaked proto.InternalMessageInfo + +func (m *EventSupplierStaked) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +// EventSupplierUnstaked is emitted with the commitment of the supplier unstake message. +type EventSupplierUnbondingBegin struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier"` + UnbondingHeight int64 `protobuf:"varint,2,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height"` +} + +func (m *EventSupplierUnbondingBegin) Reset() { *m = EventSupplierUnbondingBegin{} } +func (m *EventSupplierUnbondingBegin) String() string { return proto.CompactTextString(m) } +func (*EventSupplierUnbondingBegin) ProtoMessage() {} +func (*EventSupplierUnbondingBegin) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{1} +} +func (m *EventSupplierUnbondingBegin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierUnbondingBegin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierUnbondingBegin) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierUnbondingBegin.Merge(m, src) +} +func (m *EventSupplierUnbondingBegin) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierUnbondingBegin) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierUnbondingBegin.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierUnbondingBegin proto.InternalMessageInfo + +func (m *EventSupplierUnbondingBegin) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +func (m *EventSupplierUnbondingBegin) GetUnbondingHeight() int64 { + if m != nil { + return m.UnbondingHeight + } + return 0 +} + +// EventSupplierUnbondingEnd is emitted with the commitment of last block of the +// supplier unbonding period. +type EventSupplierUnbondingEnd struct { + Supplier *types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier"` + UnbondingHeight int64 `protobuf:"varint,2,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height"` +} + +func (m *EventSupplierUnbondingEnd) Reset() { *m = EventSupplierUnbondingEnd{} } +func (m *EventSupplierUnbondingEnd) String() string { return proto.CompactTextString(m) } +func (*EventSupplierUnbondingEnd) ProtoMessage() {} +func (*EventSupplierUnbondingEnd) Descriptor() ([]byte, []int) { + return fileDescriptor_22d2d1a82853ce0a, []int{2} +} +func (m *EventSupplierUnbondingEnd) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierUnbondingEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierUnbondingEnd) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierUnbondingEnd.Merge(m, src) +} +func (m *EventSupplierUnbondingEnd) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierUnbondingEnd) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierUnbondingEnd.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierUnbondingEnd proto.InternalMessageInfo + +func (m *EventSupplierUnbondingEnd) GetSupplier() *types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +func (m *EventSupplierUnbondingEnd) GetUnbondingHeight() int64 { + if m != nil { + return m.UnbondingHeight + } + return 0 +} + +func init() { + proto.RegisterType((*EventSupplierStaked)(nil), "poktroll.supplier.EventSupplierStaked") + proto.RegisterType((*EventSupplierUnbondingBegin)(nil), "poktroll.supplier.EventSupplierUnbondingBegin") + proto.RegisterType((*EventSupplierUnbondingEnd)(nil), "poktroll.supplier.EventSupplierUnbondingEnd") +} + +func init() { proto.RegisterFile("poktroll/supplier/event.proto", fileDescriptor_22d2d1a82853ce0a) } + +var fileDescriptor_22d2d1a82853ce0a = []byte{ + // 294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x4f, 0x2d, + 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x49, 0xeb, 0xc1, 0xa4, + 0xa5, 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0xc1, 0x0a, 0xf4, 0x21, 0x1c, 0x88, 0x6a, + 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x88, 0x38, 0x88, 0x05, 0x15, 0x95, 0x43, 0x58, 0x91, 0x91, + 0x58, 0x94, 0x9a, 0x02, 0xb7, 0x09, 0x22, 0xaf, 0x14, 0xc5, 0x25, 0xec, 0x0a, 0xb2, 0x32, 0x18, + 0x2a, 0x1c, 0x5c, 0x92, 0x98, 0x9d, 0x9a, 0x22, 0xe4, 0xcc, 0xc5, 0x01, 0x53, 0x28, 0xc1, 0xa8, + 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa9, 0x87, 0x70, 0x0d, 0xd8, 0x24, 0x3d, 0x98, 0x16, 0x27, 0x9e, + 0x57, 0xf7, 0xe4, 0xe1, 0xca, 0x83, 0xe0, 0x2c, 0xa5, 0xc5, 0x8c, 0x5c, 0xd2, 0x28, 0x86, 0x87, + 0xe6, 0x25, 0xe5, 0xe7, 0xa5, 0x64, 0xe6, 0xa5, 0x3b, 0xa5, 0xa6, 0x67, 0xe6, 0x51, 0xc5, 0x12, + 0x21, 0x7b, 0x2e, 0x81, 0x52, 0x98, 0xb1, 0xf1, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12, 0x4c, + 0x0a, 0x8c, 0x1a, 0xcc, 0x4e, 0x22, 0xaf, 0xee, 0xc9, 0x63, 0xc8, 0x05, 0xf1, 0xc3, 0x45, 0x3c, + 0xc0, 0x02, 0x4a, 0x0b, 0x19, 0xb9, 0x24, 0xb1, 0xbb, 0xd2, 0x35, 0x2f, 0x65, 0x70, 0xb8, 0xd1, + 0xc9, 0xff, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, + 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, + 0x32, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0xb9, 0x4d, 0x37, + 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x1e, 0xf7, 0x15, 0x88, 0x04, 0x56, 0x52, 0x59, + 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x7d, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x65, 0x42, + 0x78, 0xcc, 0x82, 0x02, 0x00, 0x00, +} + +func (m *EventSupplierStaked) 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 *EventSupplierStaked) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierStaked) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSupplierUnbondingBegin) 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 *EventSupplierUnbondingBegin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierUnbondingBegin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnbondingHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.UnbondingHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSupplierUnbondingEnd) 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 *EventSupplierUnbondingEnd) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierUnbondingEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnbondingHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.UnbondingHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Supplier != nil { + { + size, err := m.Supplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventSupplierStaked) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventSupplierUnbondingBegin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.UnbondingHeight != 0 { + n += 1 + sovEvent(uint64(m.UnbondingHeight)) + } + return n +} + +func (m *EventSupplierUnbondingEnd) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.UnbondingHeight != 0 { + n += 1 + sovEvent(uint64(m.UnbondingHeight)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventSupplierStaked) 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 ErrIntOverflowEvent + } + 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: EventSupplierStaked: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierStaked: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSupplierUnbondingBegin) 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 ErrIntOverflowEvent + } + 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: EventSupplierUnbondingBegin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierUnbondingBegin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType) + } + m.UnbondingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSupplierUnbondingEnd) 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 ErrIntOverflowEvent + } + 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: EventSupplierUnbondingEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierUnbondingEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Supplier == nil { + m.Supplier = &types.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType) + } + m.UnbondingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/supplier/types/genesis.pb.go b/x/supplier/types/genesis.pb.go new file mode 100644 index 000000000..75b27ed38 --- /dev/null +++ b/x/supplier/types/genesis.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + 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 + +// GenesisState defines the supplier module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + SupplierList []types.Supplier `protobuf:"bytes,2,rep,name=supplierList,proto3" json:"supplierList"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_c7fecde842e217fc, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetSupplierList() []types.Supplier { + if m != nil { + return m.SupplierList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.supplier.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/supplier/genesis.proto", fileDescriptor_c7fecde842e217fc) } + +var fileDescriptor_c7fecde842e217fc = []byte{ + // 259 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x4f, 0x4f, + 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x29, 0xd0, + 0x83, 0x29, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x55, 0x52, 0x22, + 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0xc3, 0x34, 0xbc, 0x20, 0xb1, + 0x28, 0x31, 0xb7, 0x18, 0x53, 0x3e, 0x23, 0xb1, 0x28, 0x35, 0x05, 0xae, 0x0c, 0x22, 0xaf, 0x34, + 0x91, 0x91, 0x8b, 0xc7, 0x1d, 0xe2, 0x9a, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x1b, 0x2e, 0x36, + 0x88, 0x01, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x92, 0x7a, 0x18, 0xae, 0xd3, 0x0b, 0x00, + 0x2b, 0x70, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x3d, + 0x42, 0xce, 0x5c, 0x3c, 0x30, 0x55, 0x3e, 0x99, 0xc5, 0x25, 0x12, 0x4c, 0x0a, 0xcc, 0x68, 0x66, + 0x80, 0x5d, 0xa1, 0x17, 0x0c, 0x55, 0xe4, 0xc4, 0x02, 0x32, 0x23, 0x08, 0x45, 0x93, 0x93, 0xff, + 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, + 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x98, + 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x32, 0x56, 0x37, 0x2f, 0xb5, + 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xee, 0xd3, 0x0a, 0x44, 0x58, 0x94, 0x54, 0x16, 0xa4, 0x16, + 0x27, 0xb1, 0x81, 0xfd, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x67, 0x25, 0x98, 0x6b, 0x8a, + 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SupplierList) > 0 { + for iNdEx := len(m.SupplierList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SupplierList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.SupplierList) > 0 { + for _, e := range m.SupplierList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierList", 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.SupplierList = append(m.SupplierList, types.Supplier{}) + if err := m.SupplierList[len(m.SupplierList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/supplier/types/params.pb.go b/x/supplier/types/params.pb.go new file mode 100644 index 000000000..4400a9ef5 --- /dev/null +++ b/x/supplier/types/params.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_60f7a8031a8c22d5, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.supplier.Params") +} + +func init() { proto.RegisterFile("poktroll/supplier/params.proto", fileDescriptor_60f7a8031a8c22d5) } + +var fileDescriptor_60f7a8031a8c22d5 = []byte{ + // 181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xc9, 0x4c, 0x2d, 0xd2, 0x2f, 0x48, + 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xc9, 0xeb, 0xc1, + 0xe4, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x95, 0x94, 0x48, 0x7a, + 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x74, 0xb9, 0xd8, 0x02, 0xc0, 0x66, + 0x59, 0x29, 0xbf, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x14, 0xdc, 0xba, 0x0a, 0x84, + 0x85, 0x10, 0x45, 0x4e, 0xfe, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, + 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, + 0xb1, 0x1c, 0x43, 0x94, 0x61, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, + 0xc8, 0x10, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x6c, 0x26, 0x96, 0x54, 0x16, + 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x7e, 0xc4, + 0x71, 0xe4, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/supplier/types/query.pb.go b/x/supplier/types/query.pb.go new file mode 100644 index 000000000..fc4da1c09 --- /dev/null +++ b/x/supplier/types/query.pb.go @@ -0,0 +1,1370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/shared/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetSupplierRequest struct { + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` +} + +func (m *QueryGetSupplierRequest) Reset() { *m = QueryGetSupplierRequest{} } +func (m *QueryGetSupplierRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSupplierRequest) ProtoMessage() {} +func (*QueryGetSupplierRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{2} +} +func (m *QueryGetSupplierRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSupplierRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetSupplierRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSupplierRequest.Merge(m, src) +} +func (m *QueryGetSupplierRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSupplierRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSupplierRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSupplierRequest proto.InternalMessageInfo + +func (m *QueryGetSupplierRequest) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +type QueryGetSupplierResponse struct { + Supplier types.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier"` +} + +func (m *QueryGetSupplierResponse) Reset() { *m = QueryGetSupplierResponse{} } +func (m *QueryGetSupplierResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSupplierResponse) ProtoMessage() {} +func (*QueryGetSupplierResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{3} +} +func (m *QueryGetSupplierResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetSupplierResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSupplierResponse.Merge(m, src) +} +func (m *QueryGetSupplierResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSupplierResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSupplierResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSupplierResponse proto.InternalMessageInfo + +func (m *QueryGetSupplierResponse) GetSupplier() types.Supplier { + if m != nil { + return m.Supplier + } + return types.Supplier{} +} + +type QueryAllSuppliersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSuppliersRequest) Reset() { *m = QueryAllSuppliersRequest{} } +func (m *QueryAllSuppliersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllSuppliersRequest) ProtoMessage() {} +func (*QueryAllSuppliersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{4} +} +func (m *QueryAllSuppliersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSuppliersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllSuppliersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSuppliersRequest.Merge(m, src) +} +func (m *QueryAllSuppliersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSuppliersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSuppliersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSuppliersRequest proto.InternalMessageInfo + +func (m *QueryAllSuppliersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllSuppliersResponse struct { + Supplier []types.Supplier `protobuf:"bytes,1,rep,name=supplier,proto3" json:"supplier"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSuppliersResponse) Reset() { *m = QueryAllSuppliersResponse{} } +func (m *QueryAllSuppliersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllSuppliersResponse) ProtoMessage() {} +func (*QueryAllSuppliersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a8c18c53656bd0d, []int{5} +} +func (m *QueryAllSuppliersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSuppliersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllSuppliersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSuppliersResponse.Merge(m, src) +} +func (m *QueryAllSuppliersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSuppliersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSuppliersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSuppliersResponse proto.InternalMessageInfo + +func (m *QueryAllSuppliersResponse) GetSupplier() []types.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + +func (m *QueryAllSuppliersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.supplier.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.supplier.QueryParamsResponse") + proto.RegisterType((*QueryGetSupplierRequest)(nil), "poktroll.supplier.QueryGetSupplierRequest") + proto.RegisterType((*QueryGetSupplierResponse)(nil), "poktroll.supplier.QueryGetSupplierResponse") + proto.RegisterType((*QueryAllSuppliersRequest)(nil), "poktroll.supplier.QueryAllSuppliersRequest") + proto.RegisterType((*QueryAllSuppliersResponse)(nil), "poktroll.supplier.QueryAllSuppliersResponse") +} + +func init() { proto.RegisterFile("poktroll/supplier/query.proto", fileDescriptor_7a8c18c53656bd0d) } + +var fileDescriptor_7a8c18c53656bd0d = []byte{ + // 567 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0xe3, 0x16, 0xa2, 0xd6, 0x20, 0x41, 0x4d, 0x24, 0x92, 0x08, 0x0e, 0x74, 0x12, 0x21, + 0x0a, 0xd4, 0x26, 0x65, 0x2c, 0x0c, 0x4d, 0x25, 0x3a, 0x52, 0x92, 0x01, 0x89, 0x81, 0xca, 0x49, + 0xac, 0xeb, 0xa9, 0x97, 0xb3, 0x6b, 0x3b, 0x40, 0x85, 0x58, 0x58, 0x58, 0x91, 0x18, 0x99, 0xd8, + 0x3a, 0x32, 0xf0, 0x21, 0x3a, 0x56, 0xb0, 0x54, 0x0c, 0x08, 0x25, 0x48, 0x7c, 0x0d, 0x14, 0xdb, + 0x97, 0xa6, 0xdc, 0x45, 0x49, 0x97, 0xc8, 0xe7, 0xf7, 0xff, 0xbf, 0xf7, 0xf3, 0x7b, 0x4f, 0x81, + 0x37, 0x05, 0xdf, 0xd3, 0x92, 0x47, 0x11, 0x51, 0x7d, 0x21, 0xa2, 0x90, 0x49, 0xb2, 0xdf, 0x67, + 0xf2, 0x00, 0x0b, 0xc9, 0x35, 0x47, 0x2b, 0x49, 0x18, 0x27, 0xe1, 0xf2, 0x0a, 0xed, 0x85, 0x31, + 0x27, 0xe6, 0xd7, 0xaa, 0xca, 0x85, 0x80, 0x07, 0xdc, 0x1c, 0xc9, 0xe8, 0xe4, 0x6e, 0x6f, 0x04, + 0x9c, 0x07, 0x11, 0x23, 0x54, 0x84, 0x84, 0xc6, 0x31, 0xd7, 0x54, 0x87, 0x3c, 0x56, 0x2e, 0x5a, + 0xea, 0x70, 0xd5, 0xe3, 0x6a, 0xc7, 0xda, 0xec, 0x87, 0x0b, 0xd5, 0xec, 0x17, 0x69, 0x53, 0xc5, + 0x2c, 0x0d, 0x79, 0x55, 0x6f, 0x33, 0x4d, 0xeb, 0x44, 0xd0, 0x20, 0x8c, 0x4d, 0x1e, 0xa7, 0xf5, + 0x26, 0xb5, 0x89, 0xaa, 0xc3, 0xc3, 0x71, 0x3c, 0xfd, 0x3e, 0x41, 0x25, 0xed, 0xa9, 0x74, 0x7c, + 0x97, 0x4a, 0xd6, 0x1d, 0xcb, 0x6c, 0xdc, 0x2f, 0x40, 0xf4, 0x6c, 0x44, 0xb0, 0x6d, 0x4c, 0x4d, + 0xb6, 0xdf, 0x67, 0x4a, 0xfb, 0x2d, 0x78, 0xed, 0xcc, 0xad, 0x12, 0x3c, 0x56, 0x0c, 0x3d, 0x82, + 0x79, 0x9b, 0xbc, 0x08, 0x6e, 0x83, 0xea, 0xa5, 0xb5, 0x12, 0x4e, 0xb5, 0x0f, 0x5b, 0x4b, 0x63, + 0xf9, 0xe8, 0xd7, 0xad, 0xdc, 0xe1, 0xdf, 0xaf, 0x35, 0xd0, 0x74, 0x1e, 0xff, 0x25, 0xbc, 0x6e, + 0x92, 0x6e, 0x31, 0xdd, 0x72, 0x6a, 0x57, 0x0f, 0x6d, 0xc2, 0xab, 0x5c, 0x30, 0x49, 0x35, 0x97, + 0x3b, 0xb4, 0xdb, 0x95, 0x4c, 0xd9, 0x12, 0xcb, 0x8d, 0xe2, 0xf7, 0x6f, 0xab, 0x05, 0xd7, 0xbd, + 0x0d, 0x1b, 0x69, 0x69, 0x19, 0xc6, 0x41, 0xf3, 0x4a, 0xe2, 0x70, 0xd7, 0xfe, 0x73, 0x58, 0x4c, + 0xe7, 0x77, 0xe4, 0xeb, 0x70, 0x29, 0x21, 0xcc, 0x60, 0x37, 0x9d, 0xc1, 0x89, 0xa9, 0x71, 0x61, + 0xc4, 0xde, 0x1c, 0x1b, 0xfc, 0xb6, 0x4b, 0xbc, 0x11, 0x45, 0x89, 0x26, 0xe9, 0x14, 0x7a, 0x02, + 0xe1, 0xe9, 0xcc, 0x5c, 0xea, 0x0a, 0x76, 0xc0, 0xa3, 0xa1, 0x61, 0xbb, 0x6e, 0x6e, 0x74, 0x78, + 0x9b, 0x06, 0xcc, 0x79, 0x9b, 0x13, 0x4e, 0xff, 0x0b, 0x80, 0xa5, 0x8c, 0x22, 0x99, 0xf8, 0x8b, + 0xe7, 0xc2, 0x47, 0x5b, 0x67, 0x10, 0x17, 0x0c, 0xe2, 0xdd, 0x99, 0x88, 0xb6, 0xf2, 0x24, 0xe3, + 0xda, 0xcf, 0x45, 0x78, 0xd1, 0x30, 0xa2, 0x0f, 0x00, 0xe6, 0xed, 0xa0, 0xd1, 0x9d, 0x8c, 0x1d, + 0x48, 0x6f, 0x54, 0xb9, 0x32, 0x4b, 0x66, 0xeb, 0xf9, 0xf8, 0xfd, 0x8f, 0x3f, 0x9f, 0x16, 0xaa, + 0xa8, 0x42, 0x46, 0xfa, 0xd5, 0x98, 0xe9, 0xd7, 0x5c, 0xee, 0x91, 0x69, 0x5b, 0x8e, 0x0e, 0x01, + 0x5c, 0x4a, 0x5e, 0x8e, 0x6a, 0xd3, 0x8a, 0xa4, 0x57, 0xae, 0x7c, 0x6f, 0x2e, 0xad, 0xa3, 0xda, + 0x34, 0x54, 0x8f, 0xd1, 0xfa, 0x2c, 0xaa, 0xf1, 0xe1, 0xed, 0xff, 0xfb, 0xfc, 0x0e, 0x7d, 0x06, + 0xf0, 0xf2, 0xe4, 0x74, 0xd1, 0x54, 0x84, 0x8c, 0x45, 0x2b, 0xdf, 0x9f, 0x4f, 0xec, 0x80, 0x1f, + 0x18, 0xe0, 0x1a, 0xaa, 0xce, 0x0b, 0xdc, 0x78, 0x7a, 0x34, 0xf0, 0xc0, 0xf1, 0xc0, 0x03, 0x27, + 0x03, 0x0f, 0xfc, 0x1e, 0x78, 0xe0, 0xe3, 0xd0, 0xcb, 0x1d, 0x0f, 0xbd, 0xdc, 0xc9, 0xd0, 0xcb, + 0xbd, 0xa8, 0x07, 0xa1, 0xde, 0xed, 0xb7, 0x71, 0x87, 0xf7, 0xa6, 0x64, 0x7c, 0x73, 0x9a, 0x53, + 0x1f, 0x08, 0xa6, 0xda, 0x79, 0xf3, 0x07, 0xf3, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, + 0x67, 0x7e, 0xca, 0x82, 0x05, 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 Supplier items. + Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) + AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.supplier.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Supplier(ctx context.Context, in *QueryGetSupplierRequest, opts ...grpc.CallOption) (*QueryGetSupplierResponse, error) { + out := new(QueryGetSupplierResponse) + err := c.cc.Invoke(ctx, "/poktroll.supplier.Query/Supplier", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllSuppliers(ctx context.Context, in *QueryAllSuppliersRequest, opts ...grpc.CallOption) (*QueryAllSuppliersResponse, error) { + out := new(QueryAllSuppliersResponse) + err := c.cc.Invoke(ctx, "/poktroll.supplier.Query/AllSuppliers", in, out, opts...) + 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 Supplier items. + Supplier(context.Context, *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) + AllSuppliers(context.Context, *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, 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) Supplier(ctx context.Context, req *QueryGetSupplierRequest) (*QueryGetSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Supplier not implemented") +} +func (*UnimplementedQueryServer) AllSuppliers(ctx context.Context, req *QueryAllSuppliersRequest) (*QueryAllSuppliersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllSuppliers not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.supplier.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 _Query_Supplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSupplierRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Supplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.supplier.Query/Supplier", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Supplier(ctx, req.(*QueryGetSupplierRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllSuppliers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllSuppliersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllSuppliers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.supplier.Query/AllSuppliers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllSuppliers(ctx, req.(*QueryAllSuppliersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.supplier.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Supplier", + Handler: _Query_Supplier_Handler, + }, + { + MethodName: "AllSuppliers", + Handler: _Query_AllSuppliers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/supplier/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetSupplierRequest) 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 *QueryGetSupplierRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSupplierRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetSupplierResponse) 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 *QueryGetSupplierResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Supplier.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 *QueryAllSuppliersRequest) 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 *QueryAllSuppliersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllSuppliersRequest) 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 *QueryAllSuppliersResponse) 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 *QueryAllSuppliersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllSuppliersResponse) 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.Supplier) > 0 { + for iNdEx := len(m.Supplier) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Supplier[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 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 *QueryGetSupplierRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetSupplierResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Supplier.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllSuppliersRequest) 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 *QueryAllSuppliersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Supplier) > 0 { + for _, e := range m.Supplier { + 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 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 *QueryGetSupplierRequest) 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: QueryGetSupplierRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSupplierRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", 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.OperatorAddress = 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 *QueryGetSupplierResponse) 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: QueryGetSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier.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 *QueryAllSuppliersRequest) 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: QueryAllSuppliersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSuppliersRequest: 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 + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllSuppliersResponse) 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: QueryAllSuppliersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSuppliersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier = append(m.Supplier, types.Supplier{}) + if err := m.Supplier[len(m.Supplier)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/supplier/types/query.pb.gw.go b/x/supplier/types/query.pb.gw.go new file mode 100644 index 000000000..2114c1d77 --- /dev/null +++ b/x/supplier/types/query.pb.gw.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/supplier/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSupplierRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") + } + + protoReq.OperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) + } + + msg, err := client.Supplier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSupplierRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") + } + + protoReq.OperatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) + } + + msg, err := server.Supplier(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllSuppliers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllSuppliers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSuppliersRequest + 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_AllSuppliers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllSuppliers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllSuppliers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSuppliersRequest + 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_AllSuppliers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllSuppliers(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Supplier_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_Supplier_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_Supplier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllSuppliers_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_AllSuppliers_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_AllSuppliers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Supplier_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_Supplier_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_Supplier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllSuppliers_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_AllSuppliers_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_AllSuppliers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "supplier", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Supplier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "supplier", "operator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllSuppliers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "supplier"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Supplier_0 = runtime.ForwardResponseMessage + + forward_Query_AllSuppliers_0 = runtime.ForwardResponseMessage +) diff --git a/x/supplier/types/tx.pb.go b/x/supplier/types/tx.pb.go new file mode 100644 index 000000000..d08f9199e --- /dev/null +++ b/x/supplier/types/tx.pb.go @@ -0,0 +1,1515 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/supplier/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/pokt-network/poktroll/x/shared/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/supplier parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +type MsgStakeSupplier struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + OperatorAddress string `protobuf:"bytes,3,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + Stake *types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*types1.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` +} + +func (m *MsgStakeSupplier) Reset() { *m = MsgStakeSupplier{} } +func (m *MsgStakeSupplier) String() string { return proto.CompactTextString(m) } +func (*MsgStakeSupplier) ProtoMessage() {} +func (*MsgStakeSupplier) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{2} +} +func (m *MsgStakeSupplier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeSupplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeSupplier) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeSupplier.Merge(m, src) +} +func (m *MsgStakeSupplier) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeSupplier) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeSupplier.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeSupplier proto.InternalMessageInfo + +func (m *MsgStakeSupplier) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgStakeSupplier) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + +func (m *MsgStakeSupplier) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +func (m *MsgStakeSupplier) GetStake() *types.Coin { + if m != nil { + return m.Stake + } + return nil +} + +func (m *MsgStakeSupplier) GetServices() []*types1.SupplierServiceConfig { + if m != nil { + return m.Services + } + return nil +} + +type MsgStakeSupplierResponse struct { +} + +func (m *MsgStakeSupplierResponse) Reset() { *m = MsgStakeSupplierResponse{} } +func (m *MsgStakeSupplierResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStakeSupplierResponse) ProtoMessage() {} +func (*MsgStakeSupplierResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{3} +} +func (m *MsgStakeSupplierResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStakeSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgStakeSupplierResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStakeSupplierResponse.Merge(m, src) +} +func (m *MsgStakeSupplierResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStakeSupplierResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStakeSupplierResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStakeSupplierResponse proto.InternalMessageInfo + +type MsgUnstakeSupplier struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` +} + +func (m *MsgUnstakeSupplier) Reset() { *m = MsgUnstakeSupplier{} } +func (m *MsgUnstakeSupplier) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeSupplier) ProtoMessage() {} +func (*MsgUnstakeSupplier) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{4} +} +func (m *MsgUnstakeSupplier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeSupplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeSupplier) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeSupplier.Merge(m, src) +} +func (m *MsgUnstakeSupplier) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeSupplier) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeSupplier.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeSupplier proto.InternalMessageInfo + +func (m *MsgUnstakeSupplier) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgUnstakeSupplier) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +type MsgUnstakeSupplierResponse struct { +} + +func (m *MsgUnstakeSupplierResponse) Reset() { *m = MsgUnstakeSupplierResponse{} } +func (m *MsgUnstakeSupplierResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnstakeSupplierResponse) ProtoMessage() {} +func (*MsgUnstakeSupplierResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_63b974929807ef57, []int{5} +} +func (m *MsgUnstakeSupplierResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnstakeSupplierResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUnstakeSupplierResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnstakeSupplierResponse.Merge(m, src) +} +func (m *MsgUnstakeSupplierResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnstakeSupplierResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnstakeSupplierResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnstakeSupplierResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.supplier.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.supplier.MsgUpdateParamsResponse") + proto.RegisterType((*MsgStakeSupplier)(nil), "poktroll.supplier.MsgStakeSupplier") + proto.RegisterType((*MsgStakeSupplierResponse)(nil), "poktroll.supplier.MsgStakeSupplierResponse") + proto.RegisterType((*MsgUnstakeSupplier)(nil), "poktroll.supplier.MsgUnstakeSupplier") + proto.RegisterType((*MsgUnstakeSupplierResponse)(nil), "poktroll.supplier.MsgUnstakeSupplierResponse") +} + +func init() { proto.RegisterFile("poktroll/supplier/tx.proto", fileDescriptor_63b974929807ef57) } + +var fileDescriptor_63b974929807ef57 = []byte{ + // 588 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x31, 0x8f, 0x12, 0x41, + 0x18, 0x65, 0x41, 0x88, 0x0c, 0x77, 0xe1, 0x6e, 0x73, 0xc9, 0x2d, 0x1b, 0x5d, 0x09, 0x17, 0x0d, + 0xc1, 0xb0, 0x23, 0x98, 0x5c, 0x71, 0xd1, 0x42, 0xa8, 0x89, 0x06, 0x62, 0x63, 0xe1, 0x65, 0x80, + 0x71, 0xd8, 0x00, 0x3b, 0x9b, 0x99, 0x81, 0xbb, 0xeb, 0x8c, 0xa5, 0x95, 0xa5, 0x3f, 0xc1, 0x92, + 0xc2, 0xc2, 0xce, 0xf6, 0x62, 0x75, 0xb1, 0xba, 0xca, 0x18, 0x28, 0xf8, 0x1b, 0x66, 0x77, 0x67, + 0x40, 0x16, 0x94, 0x33, 0x36, 0xc0, 0xcc, 0x7b, 0xef, 0xfb, 0xde, 0xbc, 0xf9, 0x06, 0x60, 0x7a, + 0xb4, 0x2f, 0x18, 0x1d, 0x0c, 0x20, 0x1f, 0x79, 0xde, 0xc0, 0xc1, 0x0c, 0x8a, 0x73, 0xdb, 0x63, + 0x54, 0x50, 0x7d, 0x5f, 0x61, 0xb6, 0xc2, 0xcc, 0x7d, 0x34, 0x74, 0x5c, 0x0a, 0x83, 0xcf, 0x90, + 0x65, 0x1e, 0x76, 0x28, 0x1f, 0x52, 0x0e, 0x87, 0x9c, 0xc0, 0x71, 0xc5, 0xff, 0x92, 0x40, 0x2e, + 0x04, 0x4e, 0x83, 0x15, 0x0c, 0x17, 0x12, 0x3a, 0x20, 0x94, 0xd0, 0x70, 0xdf, 0xff, 0x25, 0x77, + 0x2d, 0x59, 0xa9, 0x8d, 0x38, 0x86, 0xe3, 0x4a, 0x1b, 0x0b, 0x54, 0x81, 0x1d, 0xea, 0xb8, 0x0a, + 0x5f, 0xf7, 0xea, 0x21, 0x86, 0x86, 0xaa, 0xea, 0xdd, 0x25, 0xde, 0x43, 0x0c, 0x77, 0x21, 0xc7, + 0x6c, 0xec, 0x74, 0x70, 0x08, 0x17, 0xbe, 0x6a, 0x20, 0xdb, 0xe0, 0xe4, 0xa5, 0xd7, 0x45, 0x02, + 0xbf, 0x08, 0x84, 0xfa, 0x31, 0x48, 0xa3, 0x91, 0xe8, 0x51, 0xe6, 0x88, 0x0b, 0x43, 0xcb, 0x6b, + 0xc5, 0x74, 0xcd, 0xf8, 0xfe, 0xb9, 0x7c, 0x20, 0xdd, 0x3e, 0xeb, 0x76, 0x19, 0xe6, 0xbc, 0x25, + 0x98, 0xe3, 0x92, 0xe6, 0x92, 0xaa, 0x3f, 0x01, 0xa9, 0xb0, 0xb5, 0x11, 0xcf, 0x6b, 0xc5, 0x4c, + 0x35, 0x67, 0xaf, 0x65, 0x65, 0x87, 0x2d, 0x6a, 0xe9, 0xcb, 0x1f, 0xf7, 0x62, 0x9f, 0xe6, 0x93, + 0x92, 0xd6, 0x94, 0x9a, 0x93, 0xe3, 0x77, 0xf3, 0x49, 0x69, 0x59, 0xed, 0xfd, 0x7c, 0x52, 0x3a, + 0x5a, 0x78, 0x3f, 0x5f, 0x9e, 0x2e, 0xe2, 0xb6, 0x90, 0x03, 0x87, 0x91, 0xad, 0x26, 0xe6, 0x1e, + 0x75, 0x39, 0x2e, 0x7c, 0x8b, 0x83, 0xbd, 0x06, 0x27, 0x2d, 0x81, 0xfa, 0xb8, 0x25, 0xf5, 0xfa, + 0x23, 0x90, 0xe2, 0x0e, 0x71, 0x31, 0xdb, 0x7a, 0x34, 0xc9, 0xd3, 0x9f, 0x82, 0x5d, 0x7a, 0xe6, + 0x62, 0x76, 0x8a, 0x42, 0x38, 0x38, 0xde, 0xdf, 0x84, 0x3b, 0x01, 0x5d, 0xee, 0xe9, 0x75, 0xb0, + 0x47, 0x3d, 0xcc, 0x90, 0xa0, 0xcb, 0x0a, 0x89, 0x2d, 0x15, 0xb2, 0x4a, 0xa1, 0x8a, 0x40, 0x90, + 0xe4, 0xfe, 0x31, 0x8c, 0x5b, 0x32, 0x5a, 0x29, 0xf3, 0xc7, 0xc2, 0x96, 0x63, 0x61, 0xd7, 0xa9, + 0xe3, 0x36, 0x43, 0x9e, 0x5e, 0x03, 0xb7, 0xe5, 0x4d, 0x73, 0x23, 0x99, 0x4f, 0x14, 0x33, 0xd5, + 0x07, 0xbf, 0x5d, 0x47, 0x30, 0x0a, 0xb6, 0xca, 0xa4, 0x15, 0x12, 0xeb, 0xd4, 0x7d, 0xe3, 0x90, + 0xe6, 0x42, 0x77, 0x92, 0xf1, 0xaf, 0x44, 0xa6, 0x50, 0x30, 0x81, 0x11, 0xcd, 0x72, 0x11, 0xf4, + 0x47, 0x0d, 0xe8, 0xfe, 0x25, 0xb8, 0xfc, 0x3f, 0xa3, 0xde, 0x94, 0x55, 0xfc, 0x1f, 0xb3, 0x5a, + 0xb5, 0x7d, 0x07, 0x98, 0xeb, 0xce, 0x94, 0xf1, 0xea, 0x97, 0x38, 0x48, 0x34, 0x38, 0xd1, 0x5f, + 0x83, 0x9d, 0x95, 0x27, 0x50, 0xd8, 0x30, 0xba, 0x91, 0x29, 0x33, 0x4b, 0xdb, 0x39, 0xaa, 0x8f, + 0x8e, 0xc0, 0xee, 0xea, 0x14, 0x1e, 0x6d, 0x16, 0xaf, 0x90, 0xcc, 0x87, 0x37, 0x20, 0x2d, 0x5a, + 0x10, 0x90, 0x8d, 0xe6, 0x7f, 0xff, 0x0f, 0x0e, 0x57, 0x69, 0x66, 0xf9, 0x46, 0x34, 0xd5, 0xc8, + 0x4c, 0xbe, 0xf5, 0xdf, 0x6d, 0xed, 0xf9, 0xe5, 0xd4, 0xd2, 0xae, 0xa6, 0x96, 0x76, 0x3d, 0xb5, + 0xb4, 0x9f, 0x53, 0x4b, 0xfb, 0x30, 0xb3, 0x62, 0x57, 0x33, 0x2b, 0x76, 0x3d, 0xb3, 0x62, 0xaf, + 0x2a, 0xc4, 0x11, 0xbd, 0x51, 0xdb, 0xee, 0xd0, 0x21, 0xf4, 0xab, 0x97, 0x5d, 0x2c, 0xce, 0x28, + 0xeb, 0xc3, 0x4d, 0x4f, 0x5a, 0x5c, 0x78, 0x98, 0xb7, 0x53, 0xc1, 0x3f, 0xd2, 0xe3, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xb5, 0x70, 0x92, 0x1e, 0x7e, 0x05, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) + UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StakeSupplier(ctx context.Context, in *MsgStakeSupplier, opts ...grpc.CallOption) (*MsgStakeSupplierResponse, error) { + out := new(MsgStakeSupplierResponse) + err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/StakeSupplier", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UnstakeSupplier(ctx context.Context, in *MsgUnstakeSupplier, opts ...grpc.CallOption) (*MsgUnstakeSupplierResponse, error) { + out := new(MsgUnstakeSupplierResponse) + err := c.cc.Invoke(ctx, "/poktroll.supplier.Msg/UnstakeSupplier", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + StakeSupplier(context.Context, *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) + UnstakeSupplier(context.Context, *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) StakeSupplier(ctx context.Context, req *MsgStakeSupplier) (*MsgStakeSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakeSupplier not implemented") +} +func (*UnimplementedMsgServer) UnstakeSupplier(ctx context.Context, req *MsgUnstakeSupplier) (*MsgUnstakeSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstakeSupplier not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.supplier.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStakeSupplier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StakeSupplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.supplier.Msg/StakeSupplier", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StakeSupplier(ctx, req.(*MsgStakeSupplier)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UnstakeSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnstakeSupplier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UnstakeSupplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.supplier.Msg/UnstakeSupplier", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UnstakeSupplier(ctx, req.(*MsgUnstakeSupplier)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.supplier.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "StakeSupplier", + Handler: _Msg_StakeSupplier_Handler, + }, + { + MethodName: "UnstakeSupplier", + Handler: _Msg_UnstakeSupplier_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/supplier/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgStakeSupplier) 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 *MsgStakeSupplier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Stake != nil { + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStakeSupplierResponse) 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 *MsgStakeSupplierResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeSupplier) 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 *MsgUnstakeSupplier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnstakeSupplierResponse) 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 *MsgUnstakeSupplierResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnstakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgStakeSupplier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Stake != nil { + l = m.Stake.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Services) > 0 { + for _, e := range m.Services { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgStakeSupplierResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUnstakeSupplier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnstakeSupplierResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeSupplier) 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 ErrIntOverflowTx + } + 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: MsgStakeSupplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeSupplier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stake == nil { + m.Stake = &types.Coin{} + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Services = append(m.Services, &types1.SupplierServiceConfig{}) + if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStakeSupplierResponse) 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 ErrIntOverflowTx + } + 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: MsgStakeSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeSupplier) 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 ErrIntOverflowTx + } + 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: MsgUnstakeSupplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeSupplier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUnstakeSupplierResponse) 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 ErrIntOverflowTx + } + 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: MsgUnstakeSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnstakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/event.pb.go b/x/tokenomics/types/event.pb.go new file mode 100644 index 000000000..85e281f24 --- /dev/null +++ b/x/tokenomics/types/event.pb.go @@ -0,0 +1,1736 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/event.proto + +package types + +import ( + fmt "fmt" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/pokt-network/poktroll/x/proof/types" + 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 + +type ClaimExpirationReason int32 + +const ( + ClaimExpirationReason_EXPIRATION_REASON_UNSPECIFIED ClaimExpirationReason = 0 + ClaimExpirationReason_PROOF_MISSING ClaimExpirationReason = 1 + ClaimExpirationReason_PROOF_INVALID ClaimExpirationReason = 2 +) + +var ClaimExpirationReason_name = map[int32]string{ + 0: "EXPIRATION_REASON_UNSPECIFIED", + 1: "PROOF_MISSING", + 2: "PROOF_INVALID", +} + +var ClaimExpirationReason_value = map[string]int32{ + "EXPIRATION_REASON_UNSPECIFIED": 0, + "PROOF_MISSING": 1, + "PROOF_INVALID": 2, +} + +func (x ClaimExpirationReason) String() string { + return proto.EnumName(ClaimExpirationReason_name, int32(x)) +} + +func (ClaimExpirationReason) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{0} +} + +// EventClaimExpired is an event emitted during settlement whenever a claim requiring +// an on-chain proof doesn't have one. The claim cannot be settled, leading to that work +// never being rewarded. +type EventClaimExpired struct { + Claim *types.Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + // TODO_MAINNET: Shold we include the proof here too? + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + ExpirationReason ClaimExpirationReason `protobuf:"varint,4,opt,name=expiration_reason,json=expirationReason,proto3,enum=poktroll.tokenomics.ClaimExpirationReason" json:"expiration_reason"` +} + +func (m *EventClaimExpired) Reset() { *m = EventClaimExpired{} } +func (m *EventClaimExpired) String() string { return proto.CompactTextString(m) } +func (*EventClaimExpired) ProtoMessage() {} +func (*EventClaimExpired) Descriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{0} +} +func (m *EventClaimExpired) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventClaimExpired) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventClaimExpired) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventClaimExpired.Merge(m, src) +} +func (m *EventClaimExpired) XXX_Size() int { + return m.Size() +} +func (m *EventClaimExpired) XXX_DiscardUnknown() { + xxx_messageInfo_EventClaimExpired.DiscardUnknown(m) +} + +var xxx_messageInfo_EventClaimExpired proto.InternalMessageInfo + +func (m *EventClaimExpired) GetClaim() *types.Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventClaimExpired) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventClaimExpired) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +func (m *EventClaimExpired) GetExpirationReason() ClaimExpirationReason { + if m != nil { + return m.ExpirationReason + } + return ClaimExpirationReason_EXPIRATION_REASON_UNSPECIFIED +} + +// EventClaimSettled is an event emitted whenever a claim is settled. +// The proof_required determines whether the claim requires a proof that has been submitted or not +type EventClaimSettled struct { + Claim *types.Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + ProofRequirement types.ProofRequirementReason `protobuf:"varint,4,opt,name=proof_requirement,json=proofRequirement,proto3,enum=poktroll.proof.ProofRequirementReason" json:"proof_requirement"` +} + +func (m *EventClaimSettled) Reset() { *m = EventClaimSettled{} } +func (m *EventClaimSettled) String() string { return proto.CompactTextString(m) } +func (*EventClaimSettled) ProtoMessage() {} +func (*EventClaimSettled) Descriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{1} +} +func (m *EventClaimSettled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventClaimSettled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventClaimSettled) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventClaimSettled.Merge(m, src) +} +func (m *EventClaimSettled) XXX_Size() int { + return m.Size() +} +func (m *EventClaimSettled) XXX_DiscardUnknown() { + xxx_messageInfo_EventClaimSettled.DiscardUnknown(m) +} + +var xxx_messageInfo_EventClaimSettled proto.InternalMessageInfo + +func (m *EventClaimSettled) GetClaim() *types.Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (m *EventClaimSettled) GetNumRelays() uint64 { + if m != nil { + return m.NumRelays + } + return 0 +} + +func (m *EventClaimSettled) GetNumComputeUnits() uint64 { + if m != nil { + return m.NumComputeUnits + } + return 0 +} + +func (m *EventClaimSettled) GetProofRequirement() types.ProofRequirementReason { + if m != nil { + return m.ProofRequirement + } + return types.ProofRequirementReason_NOT_REQUIRED +} + +// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated +// for a given service. +type EventRelayMiningDifficultyUpdated struct { + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` + NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` + PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` + NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` +} + +func (m *EventRelayMiningDifficultyUpdated) Reset() { *m = EventRelayMiningDifficultyUpdated{} } +func (m *EventRelayMiningDifficultyUpdated) String() string { return proto.CompactTextString(m) } +func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} +func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{2} +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRelayMiningDifficultyUpdated.Merge(m, src) +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventRelayMiningDifficultyUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRelayMiningDifficultyUpdated proto.InternalMessageInfo + +func (m *EventRelayMiningDifficultyUpdated) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { + if m != nil { + return m.PrevTargetHashHexEncoded + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { + if m != nil { + return m.NewTargetHashHexEncoded + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { + if m != nil { + return m.PrevNumRelaysEma + } + return 0 +} + +func (m *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { + if m != nil { + return m.NewNumRelaysEma + } + return 0 +} + +// EventApplicationOverserviced is emitted when an application has less stake than +// what a supplier is claiming (i.e. amount available for burning is insufficient). +// This means the following will ALWAYS be strictly true: effective_burn < expected_burn. +type EventApplicationOverserviced struct { + ApplicationAddr string `protobuf:"bytes,1,opt,name=application_addr,json=applicationAddr,proto3" json:"application_addr,omitempty"` + SupplierOperatorAddr string `protobuf:"bytes,2,opt,name=supplier_operator_addr,json=supplierOperatorAddr,proto3" json:"supplier_operator_addr,omitempty"` + // Expected burn is the amount the supplier is claiming for work done + // to service the application during the session. + // This is usually the amount in the Claim submitted. + ExpectedBurn *types1.Coin `protobuf:"bytes,3,opt,name=expected_burn,json=expectedBurn,proto3" json:"expected_burn,omitempty"` + // Effective burn is the amount that is actually being paid to the supplier + // for the work done. It is less than the expected burn (claim amount) and + // is a function of the relay mining algorithm. + // E.g. The application's stake divided by the number of suppliers in a session. + EffectiveBurn *types1.Coin `protobuf:"bytes,4,opt,name=effective_burn,json=effectiveBurn,proto3" json:"effective_burn,omitempty"` +} + +func (m *EventApplicationOverserviced) Reset() { *m = EventApplicationOverserviced{} } +func (m *EventApplicationOverserviced) String() string { return proto.CompactTextString(m) } +func (*EventApplicationOverserviced) ProtoMessage() {} +func (*EventApplicationOverserviced) Descriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{3} +} +func (m *EventApplicationOverserviced) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventApplicationOverserviced) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventApplicationOverserviced) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventApplicationOverserviced.Merge(m, src) +} +func (m *EventApplicationOverserviced) XXX_Size() int { + return m.Size() +} +func (m *EventApplicationOverserviced) XXX_DiscardUnknown() { + xxx_messageInfo_EventApplicationOverserviced.DiscardUnknown(m) +} + +var xxx_messageInfo_EventApplicationOverserviced proto.InternalMessageInfo + +func (m *EventApplicationOverserviced) GetApplicationAddr() string { + if m != nil { + return m.ApplicationAddr + } + return "" +} + +func (m *EventApplicationOverserviced) GetSupplierOperatorAddr() string { + if m != nil { + return m.SupplierOperatorAddr + } + return "" +} + +func (m *EventApplicationOverserviced) GetExpectedBurn() *types1.Coin { + if m != nil { + return m.ExpectedBurn + } + return nil +} + +func (m *EventApplicationOverserviced) GetEffectiveBurn() *types1.Coin { + if m != nil { + return m.EffectiveBurn + } + return nil +} + +// EventSupplierSlashed is emitted when a supplier is slashed for not providing, +// or provided invalid required proofs for claims. +type EventSupplierSlashed struct { + SupplierOperatorAddr string `protobuf:"bytes,1,opt,name=supplier_operator_addr,json=supplierOperatorAddr,proto3" json:"supplier_operator_addr,omitempty"` + // Number of expired claims (due to missing or invalid proof) that led to slashing. + NumExpiredClaims uint64 `protobuf:"varint,2,opt,name=num_expired_claims,json=numExpiredClaims,proto3" json:"num_expired_claims,omitempty"` + // Amount slashed from the supplier's stake due to the expired claims. + // This is a function of the number of expired claims and proof missing penalty. + SlashingAmount *types1.Coin `protobuf:"bytes,3,opt,name=slashing_amount,json=slashingAmount,proto3" json:"slashing_amount,omitempty"` +} + +func (m *EventSupplierSlashed) Reset() { *m = EventSupplierSlashed{} } +func (m *EventSupplierSlashed) String() string { return proto.CompactTextString(m) } +func (*EventSupplierSlashed) ProtoMessage() {} +func (*EventSupplierSlashed) Descriptor() ([]byte, []int) { + return fileDescriptor_a78874bbf91a58c7, []int{4} +} +func (m *EventSupplierSlashed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSupplierSlashed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSupplierSlashed) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSupplierSlashed.Merge(m, src) +} +func (m *EventSupplierSlashed) XXX_Size() int { + return m.Size() +} +func (m *EventSupplierSlashed) XXX_DiscardUnknown() { + xxx_messageInfo_EventSupplierSlashed.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSupplierSlashed proto.InternalMessageInfo + +func (m *EventSupplierSlashed) GetSupplierOperatorAddr() string { + if m != nil { + return m.SupplierOperatorAddr + } + return "" +} + +func (m *EventSupplierSlashed) GetNumExpiredClaims() uint64 { + if m != nil { + return m.NumExpiredClaims + } + return 0 +} + +func (m *EventSupplierSlashed) GetSlashingAmount() *types1.Coin { + if m != nil { + return m.SlashingAmount + } + return nil +} + +func init() { + proto.RegisterEnum("poktroll.tokenomics.ClaimExpirationReason", ClaimExpirationReason_name, ClaimExpirationReason_value) + proto.RegisterType((*EventClaimExpired)(nil), "poktroll.tokenomics.EventClaimExpired") + proto.RegisterType((*EventClaimSettled)(nil), "poktroll.tokenomics.EventClaimSettled") + proto.RegisterType((*EventRelayMiningDifficultyUpdated)(nil), "poktroll.tokenomics.EventRelayMiningDifficultyUpdated") + proto.RegisterType((*EventApplicationOverserviced)(nil), "poktroll.tokenomics.EventApplicationOverserviced") + proto.RegisterType((*EventSupplierSlashed)(nil), "poktroll.tokenomics.EventSupplierSlashed") +} + +func init() { proto.RegisterFile("poktroll/tokenomics/event.proto", fileDescriptor_a78874bbf91a58c7) } + +var fileDescriptor_a78874bbf91a58c7 = []byte{ + // 809 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcf, 0x72, 0xdb, 0x44, + 0x18, 0x8f, 0xdc, 0x94, 0x19, 0x6f, 0x49, 0x62, 0x6f, 0x13, 0x30, 0xa1, 0x55, 0x52, 0x1f, 0x98, + 0x50, 0x88, 0x34, 0x4d, 0x19, 0x4e, 0x4c, 0x07, 0x3b, 0x51, 0xa9, 0x66, 0xa8, 0x1d, 0xe4, 0x86, + 0x61, 0xb8, 0x2c, 0x6b, 0xe9, 0xb3, 0xbd, 0x44, 0xda, 0x15, 0xab, 0x95, 0xe3, 0x1c, 0x79, 0x03, + 0x1e, 0x80, 0x17, 0xe0, 0xc0, 0x2b, 0x70, 0xe6, 0xd8, 0x63, 0x4f, 0x19, 0x26, 0xb9, 0xe5, 0x29, + 0x98, 0x5d, 0xc9, 0xb1, 0x71, 0x42, 0x73, 0xee, 0xc5, 0x5e, 0x7f, 0xdf, 0xef, 0xf7, 0xfd, 0xf9, + 0xc9, 0xfb, 0x13, 0xda, 0x4a, 0xc5, 0xb1, 0x92, 0x22, 0x8e, 0x5d, 0x25, 0x8e, 0x81, 0x8b, 0x84, + 0x85, 0x99, 0x0b, 0x63, 0xe0, 0xca, 0x49, 0xa5, 0x50, 0x02, 0xdf, 0x9f, 0x02, 0x9c, 0x19, 0x60, + 0xd3, 0x0e, 0x45, 0x96, 0x88, 0xcc, 0xed, 0xd3, 0x0c, 0xdc, 0xf1, 0x93, 0x3e, 0x28, 0xfa, 0xc4, + 0x0d, 0x05, 0xe3, 0x05, 0x69, 0x73, 0x7d, 0x28, 0x86, 0xc2, 0x1c, 0x5d, 0x7d, 0x2a, 0xa3, 0x9b, + 0x57, 0xbd, 0x52, 0x29, 0xc4, 0xc0, 0x55, 0xa7, 0x29, 0x64, 0x45, 0xae, 0xf9, 0x67, 0x05, 0xd5, + 0x3d, 0xdd, 0x76, 0x3f, 0xa6, 0x2c, 0xf1, 0x26, 0x29, 0x93, 0x10, 0xe1, 0x2f, 0xd1, 0xdd, 0x50, + 0xff, 0x6e, 0x58, 0xdb, 0xd6, 0xce, 0xbd, 0xbd, 0x0d, 0xe7, 0x6a, 0x18, 0x53, 0xc1, 0x31, 0xe0, + 0x76, 0xf5, 0xf2, 0x6c, 0xab, 0xc0, 0x05, 0xc5, 0x17, 0xde, 0x45, 0x88, 0xe7, 0x09, 0x91, 0x10, + 0xd3, 0xd3, 0xac, 0x51, 0xd9, 0xb6, 0x76, 0x96, 0xdb, 0xab, 0x97, 0x67, 0x5b, 0x73, 0xd1, 0xa0, + 0xca, 0xf3, 0x24, 0x30, 0x47, 0xdc, 0x42, 0x75, 0x9d, 0x08, 0x45, 0x92, 0xe6, 0x0a, 0x48, 0xce, + 0x99, 0xca, 0x1a, 0x77, 0x0c, 0x6b, 0xe3, 0xf2, 0x6c, 0xeb, 0x7a, 0x32, 0x58, 0xe3, 0x79, 0xb2, + 0x5f, 0x44, 0x8e, 0x74, 0x00, 0x73, 0x54, 0x07, 0x3d, 0x34, 0x55, 0x4c, 0x70, 0x22, 0x81, 0x66, + 0x82, 0x37, 0x96, 0xb7, 0xad, 0x9d, 0xd5, 0xbd, 0xc7, 0xce, 0x0d, 0x12, 0x3a, 0xb3, 0x3d, 0x0d, + 0x25, 0x30, 0x8c, 0xa2, 0xdd, 0xb5, 0x42, 0x41, 0x0d, 0x16, 0x80, 0xcd, 0x3f, 0xfe, 0xa3, 0x57, + 0x0f, 0x94, 0x8a, 0xdf, 0x29, 0xbd, 0x7e, 0x46, 0x75, 0x33, 0x12, 0x91, 0xf0, 0x4b, 0xce, 0x24, + 0x24, 0xc0, 0x55, 0xa9, 0xd7, 0x27, 0x8b, 0x53, 0x1f, 0xea, 0xcf, 0x60, 0x86, 0x9b, 0xd7, 0xea, + 0x5a, 0x91, 0xa0, 0x96, 0x2e, 0xc0, 0x9b, 0xbf, 0x57, 0xd0, 0x23, 0xa3, 0x95, 0x19, 0xff, 0x25, + 0xe3, 0x8c, 0x0f, 0x0f, 0xd8, 0x60, 0xc0, 0xc2, 0x3c, 0x56, 0xa7, 0x47, 0x69, 0x44, 0x15, 0x44, + 0xf8, 0x21, 0x42, 0x19, 0xc8, 0x31, 0x0b, 0x81, 0xb0, 0xc8, 0x08, 0x58, 0x0d, 0xaa, 0x65, 0xc4, + 0x8f, 0xf0, 0x33, 0xf4, 0x20, 0x95, 0x30, 0x26, 0x8a, 0xca, 0x21, 0x28, 0x32, 0xa2, 0xd9, 0x88, + 0x8c, 0x60, 0x42, 0x80, 0x87, 0x22, 0x82, 0xc8, 0x88, 0x56, 0x0d, 0x1a, 0x1a, 0xf3, 0xca, 0x40, + 0x5e, 0xd0, 0x6c, 0xf4, 0x02, 0x26, 0x5e, 0x91, 0xc7, 0x5f, 0xa1, 0x8f, 0x39, 0x9c, 0xfc, 0x2f, + 0xfd, 0x8e, 0xa1, 0x7f, 0xc8, 0xe1, 0xe4, 0x46, 0xf6, 0x2e, 0xba, 0x6f, 0xba, 0xcf, 0x9e, 0x07, + 0x81, 0x84, 0x1a, 0xc1, 0x96, 0xf5, 0xc6, 0x30, 0xee, 0x4c, 0x9f, 0x8e, 0x97, 0x50, 0xfc, 0x19, + 0xc2, 0xba, 0xd9, 0x02, 0xfa, 0xae, 0x41, 0xaf, 0x71, 0x38, 0x99, 0x07, 0x37, 0x7f, 0xad, 0xa0, + 0x07, 0x46, 0x9e, 0x56, 0x9a, 0xc6, 0x2c, 0x34, 0xff, 0xb2, 0xee, 0x18, 0x64, 0xb9, 0x7b, 0x84, + 0x3f, 0x45, 0x35, 0x3a, 0x4b, 0x11, 0x1a, 0x45, 0xb2, 0xd4, 0x67, 0x6d, 0x2e, 0xde, 0x8a, 0x22, + 0x89, 0xbf, 0x40, 0x1f, 0x64, 0xb9, 0x8e, 0x81, 0x24, 0x22, 0x05, 0x49, 0x95, 0x90, 0x05, 0xa1, + 0xd0, 0x67, 0x7d, 0x9a, 0xed, 0x96, 0x49, 0xc3, 0x7a, 0x86, 0x56, 0x60, 0x92, 0x42, 0xa8, 0x20, + 0x22, 0xfd, 0x5c, 0x72, 0xa3, 0xc6, 0xbd, 0xbd, 0x8f, 0x9c, 0xc2, 0x66, 0x1c, 0x6d, 0x33, 0x4e, + 0x69, 0x33, 0xce, 0xbe, 0x60, 0x3c, 0x78, 0x7f, 0x8a, 0x6f, 0xe7, 0x92, 0xe3, 0xaf, 0xd1, 0x2a, + 0x0c, 0x06, 0x10, 0x2a, 0x36, 0x86, 0xa2, 0xc0, 0xf2, 0x6d, 0x05, 0x56, 0xae, 0x08, 0xba, 0x42, + 0xf3, 0x2f, 0x0b, 0xad, 0x1b, 0x0d, 0x7a, 0xe5, 0x7c, 0xbd, 0x98, 0x66, 0x23, 0x88, 0xde, 0xb2, + 0x90, 0xf5, 0x96, 0x85, 0x3e, 0x47, 0x58, 0x6b, 0x0f, 0x85, 0x8d, 0x11, 0x73, 0xc9, 0xca, 0x7b, + 0x15, 0xd4, 0x78, 0x3e, 0xf5, 0x37, 0x73, 0x1d, 0x33, 0xdc, 0x46, 0x6b, 0x99, 0x6e, 0xc7, 0xf8, + 0x90, 0xd0, 0x44, 0xe4, 0x5c, 0xdd, 0x2e, 0xc0, 0xea, 0x94, 0xd1, 0x32, 0x84, 0xc7, 0x3f, 0xa1, + 0x8d, 0x1b, 0x1d, 0x05, 0x3f, 0x42, 0x0f, 0xbd, 0x1f, 0x0e, 0xfd, 0xa0, 0xf5, 0xca, 0xef, 0x76, + 0x48, 0xe0, 0xb5, 0x7a, 0xdd, 0x0e, 0x39, 0xea, 0xf4, 0x0e, 0xbd, 0x7d, 0xff, 0xb9, 0xef, 0x1d, + 0xd4, 0x96, 0x70, 0x1d, 0xad, 0x1c, 0x06, 0xdd, 0xee, 0x73, 0xf2, 0xd2, 0xef, 0xf5, 0xfc, 0xce, + 0x37, 0x35, 0x6b, 0x16, 0xf2, 0x3b, 0xdf, 0xb7, 0xbe, 0xf5, 0x0f, 0x6a, 0x95, 0xf6, 0x77, 0x7f, + 0x9f, 0xdb, 0xd6, 0xeb, 0x73, 0xdb, 0x7a, 0x73, 0x6e, 0x5b, 0xff, 0x9c, 0xdb, 0xd6, 0x6f, 0x17, + 0xf6, 0xd2, 0xeb, 0x0b, 0x7b, 0xe9, 0xcd, 0x85, 0xbd, 0xf4, 0xe3, 0xd3, 0x21, 0x53, 0xa3, 0xbc, + 0xef, 0x84, 0x22, 0x71, 0xf5, 0xf5, 0xdd, 0xe5, 0xa0, 0x4e, 0x84, 0x3c, 0x76, 0xaf, 0x3c, 0x7f, + 0x32, 0xff, 0x86, 0x31, 0xd6, 0xdf, 0x7f, 0xcf, 0x78, 0xff, 0xd3, 0x7f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x69, 0x2d, 0x41, 0xba, 0x85, 0x06, 0x00, 0x00, +} + +func (m *EventClaimExpired) 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 *EventClaimExpired) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventClaimExpired) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExpirationReason != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.ExpirationReason)) + i-- + dAtA[i] = 0x20 + } + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x18 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x10 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventClaimSettled) 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 *EventClaimSettled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventClaimSettled) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProofRequirement != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.ProofRequirement)) + i-- + dAtA[i] = 0x20 + } + if m.NumComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + i-- + dAtA[i] = 0x18 + } + if m.NumRelays != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) + i-- + dAtA[i] = 0x10 + } + if m.Claim != nil { + { + size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventRelayMiningDifficultyUpdated) 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 *EventRelayMiningDifficultyUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRelayMiningDifficultyUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewNumRelaysEma != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NewNumRelaysEma)) + i-- + dAtA[i] = 0x28 + } + if m.PrevNumRelaysEma != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.PrevNumRelaysEma)) + i-- + dAtA[i] = 0x20 + } + if len(m.NewTargetHashHexEncoded) > 0 { + i -= len(m.NewTargetHashHexEncoded) + copy(dAtA[i:], m.NewTargetHashHexEncoded) + i = encodeVarintEvent(dAtA, i, uint64(len(m.NewTargetHashHexEncoded))) + i-- + dAtA[i] = 0x1a + } + if len(m.PrevTargetHashHexEncoded) > 0 { + i -= len(m.PrevTargetHashHexEncoded) + copy(dAtA[i:], m.PrevTargetHashHexEncoded) + i = encodeVarintEvent(dAtA, i, uint64(len(m.PrevTargetHashHexEncoded))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventApplicationOverserviced) 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 *EventApplicationOverserviced) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventApplicationOverserviced) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EffectiveBurn != nil { + { + size, err := m.EffectiveBurn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ExpectedBurn != nil { + { + size, err := m.ExpectedBurn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.SupplierOperatorAddr) > 0 { + i -= len(m.SupplierOperatorAddr) + copy(dAtA[i:], m.SupplierOperatorAddr) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SupplierOperatorAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.ApplicationAddr) > 0 { + i -= len(m.ApplicationAddr) + copy(dAtA[i:], m.ApplicationAddr) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ApplicationAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSupplierSlashed) 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 *EventSupplierSlashed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSupplierSlashed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SlashingAmount != nil { + { + size, err := m.SlashingAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.NumExpiredClaims != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumExpiredClaims)) + i-- + dAtA[i] = 0x10 + } + if len(m.SupplierOperatorAddr) > 0 { + i -= len(m.SupplierOperatorAddr) + copy(dAtA[i:], m.SupplierOperatorAddr) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SupplierOperatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventClaimExpired) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + if m.ExpirationReason != 0 { + n += 1 + sovEvent(uint64(m.ExpirationReason)) + } + return n +} + +func (m *EventClaimSettled) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claim != nil { + l = m.Claim.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumRelays != 0 { + n += 1 + sovEvent(uint64(m.NumRelays)) + } + if m.NumComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumComputeUnits)) + } + if m.ProofRequirement != 0 { + n += 1 + sovEvent(uint64(m.ProofRequirement)) + } + return n +} + +func (m *EventRelayMiningDifficultyUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.PrevTargetHashHexEncoded) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.NewTargetHashHexEncoded) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.PrevNumRelaysEma != 0 { + n += 1 + sovEvent(uint64(m.PrevNumRelaysEma)) + } + if m.NewNumRelaysEma != 0 { + n += 1 + sovEvent(uint64(m.NewNumRelaysEma)) + } + return n +} + +func (m *EventApplicationOverserviced) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ApplicationAddr) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.SupplierOperatorAddr) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.ExpectedBurn != nil { + l = m.ExpectedBurn.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.EffectiveBurn != nil { + l = m.EffectiveBurn.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventSupplierSlashed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SupplierOperatorAddr) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumExpiredClaims != 0 { + n += 1 + sovEvent(uint64(m.NumExpiredClaims)) + } + if m.SlashingAmount != nil { + l = m.SlashingAmount.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventClaimExpired) 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 ErrIntOverflowEvent + } + 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: EventClaimExpired: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventClaimExpired: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &types.Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationReason", wireType) + } + m.ExpirationReason = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpirationReason |= ClaimExpirationReason(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventClaimSettled) 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 ErrIntOverflowEvent + } + 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: EventClaimSettled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventClaimSettled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Claim == nil { + m.Claim = &types.Claim{} + } + if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) + } + m.NumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + } + m.NumComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofRequirement", wireType) + } + m.ProofRequirement = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProofRequirement |= types.ProofRequirementReason(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRelayMiningDifficultyUpdated) 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 ErrIntOverflowEvent + } + 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: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) + } + m.PrevNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrevNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) + } + m.NewNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventApplicationOverserviced) 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 ErrIntOverflowEvent + } + 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: EventApplicationOverserviced: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventApplicationOverserviced: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ApplicationAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedBurn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExpectedBurn == nil { + m.ExpectedBurn = &types1.Coin{} + } + if err := m.ExpectedBurn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EffectiveBurn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EffectiveBurn == nil { + m.EffectiveBurn = &types1.Coin{} + } + if err := m.EffectiveBurn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSupplierSlashed) 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 ErrIntOverflowEvent + } + 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: EventSupplierSlashed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSupplierSlashed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupplierOperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumExpiredClaims", wireType) + } + m.NumExpiredClaims = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumExpiredClaims |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashingAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlashingAmount == nil { + m.SlashingAmount = &types1.Coin{} + } + if err := m.SlashingAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/genesis.pb.go b/x/tokenomics/types/genesis.pb.go new file mode 100644 index 000000000..72f5188ed --- /dev/null +++ b/x/tokenomics/types/genesis.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// GenesisState defines the tokenomics module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + RelayMiningDifficultyList []RelayMiningDifficulty `protobuf:"bytes,2,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_a4de321d172b0811, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetRelayMiningDifficultyList() []RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficultyList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.tokenomics.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/tokenomics/genesis.proto", fileDescriptor_a4de321d172b0811) } + +var fileDescriptor_a4de321d172b0811 = []byte{ + // 289 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, + 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, + 0x29, 0xd1, 0x43, 0x28, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, + 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x55, 0xc0, 0x66, 0x41, + 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x7c, 0x29, 0x43, 0x6c, 0x2a, 0x8a, 0x52, 0x73, 0x12, 0x2b, + 0xe3, 0x73, 0x33, 0xf3, 0x32, 0xf3, 0xd2, 0xe3, 0x53, 0x32, 0xd3, 0xd2, 0x32, 0x93, 0x4b, 0x73, + 0x4a, 0x2a, 0x21, 0x5a, 0x94, 0xf6, 0x31, 0x72, 0xf1, 0xb8, 0x43, 0x1c, 0x19, 0x5c, 0x92, 0x58, + 0x92, 0x2a, 0x64, 0xc7, 0xc5, 0x06, 0x31, 0x53, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x5a, + 0x0f, 0x8b, 0xa3, 0xf5, 0x02, 0xc0, 0x4a, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, + 0x83, 0x16, 0x63, 0x10, 0x54, 0x97, 0x50, 0x1e, 0x97, 0x24, 0xd8, 0x46, 0x5f, 0xb0, 0x85, 0x2e, + 0x70, 0xfb, 0x7c, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xb4, 0xb0, 0x1a, + 0x19, 0x84, 0x4d, 0x97, 0x13, 0x0b, 0xc8, 0x86, 0x20, 0xdc, 0x46, 0x3a, 0x05, 0x9e, 0x78, 0x24, + 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, + 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xc6, 0xe9, 0x99, 0x25, + 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x4b, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, + 0x8b, 0xb2, 0xf5, 0xe1, 0x21, 0x55, 0x81, 0x1c, 0x56, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, + 0xe0, 0xa0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xac, 0xa4, 0x6f, 0xd2, 0x01, 0x00, + 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RelayMiningDifficultyList) > 0 { + for iNdEx := len(m.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RelayMiningDifficultyList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + 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 *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.RelayMiningDifficultyList) > 0 { + for _, e := range m.RelayMiningDifficultyList { + l = e.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 *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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficultyList", 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.RelayMiningDifficultyList = append(m.RelayMiningDifficultyList, RelayMiningDifficulty{}) + if err := m.RelayMiningDifficultyList[len(m.RelayMiningDifficultyList)-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 skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/params.pb.go b/x/tokenomics/types/params.pb.go new file mode 100644 index 000000000..909476b25 --- /dev/null +++ b/x/tokenomics/types/params.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// Params defines the parameters for the tokenomics module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_df10a06914fc6eee, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.tokenomics.Params") +} + +func init() { proto.RegisterFile("poktroll/tokenomics/params.proto", fileDescriptor_df10a06914fc6eee) } + +var fileDescriptor_df10a06914fc6eee = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, + 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xa9, + 0xd0, 0x43, 0xa8, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, 0x52, + 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xd2, 0xe7, 0x62, 0x0b, + 0x00, 0x9b, 0x66, 0xa5, 0xfa, 0x62, 0x81, 0x3c, 0x63, 0xd7, 0xf3, 0x0d, 0x5a, 0x32, 0x70, 0x2b, + 0x2b, 0x90, 0x2d, 0x85, 0x28, 0x73, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x1b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, + 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x8c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, + 0x73, 0xf5, 0x41, 0xc6, 0xe8, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0x63, 0x37, 0xb3, + 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x14, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x45, 0xfa, 0x9e, 0x90, 0xec, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/query.pb.go b/x/tokenomics/types/query.pb.go new file mode 100644 index 000000000..70675f20f --- /dev/null +++ b/x/tokenomics/types/query.pb.go @@ -0,0 +1,1369 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetRelayMiningDifficultyRequest struct { + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` +} + +func (m *QueryGetRelayMiningDifficultyRequest) Reset() { *m = QueryGetRelayMiningDifficultyRequest{} } +func (m *QueryGetRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} +func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{2} +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.Merge(m, src) +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRelayMiningDifficultyRequest proto.InternalMessageInfo + +func (m *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +type QueryGetRelayMiningDifficultyResponse struct { + RelayMiningDifficulty RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` +} + +func (m *QueryGetRelayMiningDifficultyResponse) Reset() { *m = QueryGetRelayMiningDifficultyResponse{} } +func (m *QueryGetRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} +func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{3} +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.Merge(m, src) +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRelayMiningDifficultyResponse proto.InternalMessageInfo + +func (m *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficulty + } + return RelayMiningDifficulty{} +} + +type QueryAllRelayMiningDifficultyRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRelayMiningDifficultyRequest) Reset() { *m = QueryAllRelayMiningDifficultyRequest{} } +func (m *QueryAllRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} +func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{4} +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.Merge(m, src) +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRelayMiningDifficultyRequest proto.InternalMessageInfo + +func (m *QueryAllRelayMiningDifficultyRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRelayMiningDifficultyResponse struct { + RelayMiningDifficulty []RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRelayMiningDifficultyResponse) Reset() { *m = QueryAllRelayMiningDifficultyResponse{} } +func (m *QueryAllRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} +func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19d6daded0c54373, []int{5} +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.Merge(m, src) +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRelayMiningDifficultyResponse proto.InternalMessageInfo + +func (m *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficulty + } + return nil +} + +func (m *QueryAllRelayMiningDifficultyResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.tokenomics.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.tokenomics.QueryParamsResponse") + proto.RegisterType((*QueryGetRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest") + proto.RegisterType((*QueryGetRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse") + proto.RegisterType((*QueryAllRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest") + proto.RegisterType((*QueryAllRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse") +} + +func init() { proto.RegisterFile("poktroll/tokenomics/query.proto", fileDescriptor_19d6daded0c54373) } + +var fileDescriptor_19d6daded0c54373 = []byte{ + // 575 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0xb5, 0x06, 0x32, 0x9e, 0x9c, 0xb6, 0x50, 0x63, 0xd9, 0x96, 0x45, 0x6d, 0x08, + 0xb8, 0x63, 0xda, 0x53, 0x15, 0x84, 0x84, 0x6a, 0xf0, 0x50, 0x68, 0x17, 0xbc, 0x78, 0x09, 0x93, + 0xed, 0x64, 0x1d, 0xb2, 0x3b, 0xb3, 0xdd, 0x9d, 0x54, 0x83, 0x78, 0xf1, 0x2e, 0x0a, 0x7e, 0x09, + 0x8f, 0x7e, 0x8c, 0x9e, 0xa4, 0xa0, 0x87, 0x5c, 0x14, 0x49, 0x04, 0xbf, 0x86, 0xec, 0xcc, 0xa4, + 0x49, 0x71, 0x37, 0x0b, 0xc5, 0xcb, 0xb2, 0x3b, 0xf3, 0xde, 0xfb, 0xff, 0x7f, 0x6f, 0xde, 0x0e, + 0xdc, 0x8c, 0x44, 0x5f, 0xc6, 0x22, 0x08, 0xb0, 0x14, 0x7d, 0xca, 0x45, 0xc8, 0xbc, 0x04, 0x9f, + 0x0c, 0x68, 0x3c, 0x74, 0xa2, 0x58, 0x48, 0x81, 0x56, 0xa6, 0x01, 0xce, 0x2c, 0xa0, 0x7a, 0x93, + 0x84, 0x8c, 0x0b, 0xac, 0x9e, 0x3a, 0xae, 0xba, 0xea, 0x0b, 0x5f, 0xa8, 0x57, 0x9c, 0xbe, 0x99, + 0xd5, 0x0d, 0x5f, 0x08, 0x3f, 0xa0, 0x98, 0x44, 0x0c, 0x13, 0xce, 0x85, 0x24, 0x92, 0x09, 0x9e, + 0x98, 0xdd, 0x5b, 0x9e, 0x48, 0x42, 0x91, 0x74, 0x74, 0x9a, 0xfe, 0x30, 0x5b, 0x75, 0xfd, 0x85, + 0xbb, 0x24, 0xa1, 0xda, 0x0f, 0x3e, 0x6d, 0x74, 0xa9, 0x24, 0x0d, 0x1c, 0x11, 0x9f, 0x71, 0x55, + 0xc7, 0xc4, 0x5a, 0xf3, 0xb1, 0xd3, 0x28, 0x4f, 0xb0, 0xe9, 0xfe, 0x56, 0x16, 0x63, 0x44, 0x62, + 0x12, 0x4e, 0xd5, 0x1a, 0x59, 0x11, 0x31, 0x0d, 0xc8, 0xb0, 0x13, 0x32, 0xce, 0xb8, 0xdf, 0x39, + 0x66, 0xbd, 0x1e, 0xf3, 0x06, 0x81, 0x34, 0x7d, 0xb1, 0x57, 0x21, 0x3a, 0x4a, 0x6d, 0x1d, 0xaa, + 0x3a, 0x2e, 0x3d, 0x19, 0xd0, 0x44, 0xda, 0xcf, 0xe1, 0xca, 0xa5, 0xd5, 0x24, 0x12, 0x3c, 0xa1, + 0xe8, 0x31, 0x2c, 0x6b, 0xbd, 0x75, 0xb0, 0x05, 0x6a, 0x37, 0x76, 0x6e, 0x3b, 0x19, 0x5d, 0x75, + 0x74, 0x52, 0xab, 0x72, 0xf6, 0x73, 0xb3, 0xf4, 0xf9, 0xcf, 0x97, 0x3a, 0x70, 0x4d, 0x96, 0xbd, + 0x0f, 0xef, 0xa8, 0xb2, 0x6d, 0x2a, 0xdd, 0xd4, 0xd5, 0x81, 0x32, 0xb5, 0x7f, 0xe1, 0xc9, 0xc8, + 0xa3, 0x0d, 0x58, 0x49, 0x68, 0x7c, 0xca, 0x3c, 0xfa, 0xec, 0x58, 0x49, 0x55, 0xdc, 0xd9, 0x82, + 0xfd, 0x01, 0xc0, 0xbb, 0x05, 0x65, 0x8c, 0xdf, 0x1e, 0x5c, 0x8b, 0xb3, 0x02, 0x8c, 0xfd, 0x7a, + 0xa6, 0xfd, 0xcc, 0x92, 0xad, 0xe5, 0x94, 0xc6, 0xcd, 0x2e, 0x67, 0x73, 0xc3, 0xd5, 0x0c, 0x82, + 0x85, 0x5c, 0x4f, 0x21, 0x9c, 0x9d, 0xba, 0x31, 0x71, 0xcf, 0x31, 0x03, 0x93, 0x1e, 0xbb, 0xa3, + 0x47, 0xd6, 0x1c, 0xbe, 0x73, 0x48, 0x7c, 0x6a, 0x72, 0xdd, 0xb9, 0x4c, 0x7b, 0x34, 0xed, 0x40, + 0xbe, 0x60, 0x71, 0x07, 0xae, 0xfd, 0xc7, 0x0e, 0xa0, 0xf6, 0x25, 0xb2, 0x25, 0x45, 0xb6, 0x5d, + 0x48, 0xa6, 0x4d, 0xce, 0xa3, 0xed, 0x7c, 0x5d, 0x86, 0xd7, 0x15, 0x1a, 0x7a, 0x0f, 0x60, 0x59, + 0x8f, 0x12, 0xda, 0xce, 0xb4, 0xf9, 0xef, 0xdc, 0x56, 0x6b, 0xc5, 0x81, 0x5a, 0xd3, 0x7e, 0xf0, + 0xee, 0xdb, 0xef, 0x4f, 0x4b, 0x75, 0x54, 0xc3, 0x69, 0xc6, 0x7d, 0x4e, 0xe5, 0x2b, 0x11, 0xf7, + 0x71, 0xfe, 0x2f, 0x86, 0x7e, 0x00, 0xb8, 0x96, 0xd9, 0x19, 0xb4, 0x97, 0xaf, 0x5a, 0x30, 0xe9, + 0xd5, 0x87, 0x57, 0x49, 0x35, 0x08, 0x07, 0x0a, 0xa1, 0x8d, 0x9e, 0x14, 0x23, 0xe4, 0xdc, 0x01, + 0xf8, 0xcd, 0xc5, 0x5f, 0xf5, 0x16, 0x7d, 0x07, 0x70, 0x3d, 0x53, 0xb0, 0x19, 0x04, 0x8b, 0x10, + 0x0b, 0x86, 0x7e, 0x11, 0x62, 0xd1, 0xf8, 0xda, 0x4d, 0x85, 0xf8, 0x08, 0xed, 0x5d, 0x19, 0xb1, + 0x75, 0x74, 0x36, 0xb6, 0xc0, 0xf9, 0xd8, 0x02, 0xa3, 0xb1, 0x05, 0x7e, 0x8d, 0x2d, 0xf0, 0x71, + 0x62, 0x95, 0xce, 0x27, 0x56, 0x69, 0x34, 0xb1, 0x4a, 0x2f, 0x76, 0x7d, 0x26, 0x5f, 0x0e, 0xba, + 0x8e, 0x27, 0xc2, 0x1c, 0x89, 0xd7, 0xf3, 0x22, 0x72, 0x18, 0xd1, 0xa4, 0x5b, 0x56, 0x57, 0xe7, + 0xee, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x5a, 0x86, 0x05, 0x75, 0x06, 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 RelayMiningDifficulty items. + RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +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, "/poktroll.tokenomics.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { + out := new(QueryGetRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficulty", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { + out := new(QueryAllRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", in, out, opts...) + 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 RelayMiningDifficulty items. + RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, 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) RelayMiningDifficulty(ctx context.Context, req *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") +} +func (*UnimplementedQueryServer) RelayMiningDifficultyAll(ctx context.Context, req *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/poktroll.tokenomics.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 _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficulty(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficulty", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.tokenomics.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "RelayMiningDifficulty", + Handler: _Query_RelayMiningDifficulty_Handler, + }, + { + MethodName: "RelayMiningDifficultyAll", + Handler: _Query_RelayMiningDifficultyAll_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/tokenomics/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 { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +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 dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 (m *QueryGetRelayMiningDifficultyRequest) 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 *QueryGetRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRelayMiningDifficultyResponse) 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 *QueryGetRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RelayMiningDifficulty.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 *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyResponse) 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 *QueryAllRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRelayMiningDifficultyResponse) 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.RelayMiningDifficulty) > 0 { + for iNdEx := len(m.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RelayMiningDifficulty[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 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 *QueryGetRelayMiningDifficultyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRelayMiningDifficultyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RelayMiningDifficulty.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RelayMiningDifficulty) > 0 { + for _, e := range m.RelayMiningDifficulty { + 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 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 *QueryGetRelayMiningDifficultyRequest) 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: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = 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 *QueryGetRelayMiningDifficultyResponse) 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: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty.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 *QueryAllRelayMiningDifficultyRequest) 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: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: 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 + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRelayMiningDifficultyResponse) 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: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty = append(m.RelayMiningDifficulty, RelayMiningDifficulty{}) + if err := m.RelayMiningDifficulty[len(m.RelayMiningDifficulty)-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:]) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/query.pb.gw.go b/x/tokenomics/types/query.pb.gw.go new file mode 100644 index 000000000..15d7f5446 --- /dev/null +++ b/x/tokenomics/types/query.pb.gw.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/tokenomics/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["serviceId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") + } + + protoReq.ServiceId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) + } + + msg, err := client.RelayMiningDifficulty(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["serviceId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") + } + + protoReq.ServiceId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) + } + + msg, err := server.RelayMiningDifficulty(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RelayMiningDifficultyAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRelayMiningDifficultyRequest + 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_RelayMiningDifficultyAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RelayMiningDifficultyAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRelayMiningDifficultyRequest + 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_RelayMiningDifficultyAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RelayMiningDifficultyAll(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficulty_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_RelayMiningDifficulty_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_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficulty_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_RelayMiningDifficulty_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_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_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_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RelayMiningDifficulty_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty", "serviceId"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RelayMiningDifficultyAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_RelayMiningDifficulty_0 = runtime.ForwardResponseMessage + + forward_Query_RelayMiningDifficultyAll_0 = runtime.ForwardResponseMessage +) diff --git a/x/tokenomics/types/relay_mining_difficulty.pb.go b/x/tokenomics/types/relay_mining_difficulty.pb.go new file mode 100644 index 000000000..981a19384 --- /dev/null +++ b/x/tokenomics/types/relay_mining_difficulty.pb.go @@ -0,0 +1,456 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/relay_mining_difficulty.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + 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 + +// RelayMiningDifficulty is a message used to store the on-chain Relay Mining +// difficulty associated with a specific service ID. +type RelayMiningDifficulty struct { + // The service ID the relay mining difficulty is associated with. + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // The block height at which this relay mining difficulty was computed. + // This is needed to determine how much time has passed since the last time + // the exponential moving average was computed. + BlockHeight int64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // The exponential moving average of the number of relays for this service. + NumRelaysEma uint64 `protobuf:"varint,3,opt,name=num_relays_ema,json=numRelaysEma,proto3" json:"num_relays_ema,omitempty"` + // The target hash determining the difficulty to mine relays for this service. + // For example, if we use sha256 to hash the (RelayRequest,ReqlayResponse) tuple, + // and the difficulty has 4 leading zero bits, then the target hash would be: + // 0b0000111... (until 32 bytes are filled up). + TargetHash []byte `protobuf:"bytes,4,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"` +} + +func (m *RelayMiningDifficulty) Reset() { *m = RelayMiningDifficulty{} } +func (m *RelayMiningDifficulty) String() string { return proto.CompactTextString(m) } +func (*RelayMiningDifficulty) ProtoMessage() {} +func (*RelayMiningDifficulty) Descriptor() ([]byte, []int) { + return fileDescriptor_1777fca7cd39aaea, []int{0} +} +func (m *RelayMiningDifficulty) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayMiningDifficulty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RelayMiningDifficulty) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayMiningDifficulty.Merge(m, src) +} +func (m *RelayMiningDifficulty) XXX_Size() int { + return m.Size() +} +func (m *RelayMiningDifficulty) XXX_DiscardUnknown() { + xxx_messageInfo_RelayMiningDifficulty.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayMiningDifficulty proto.InternalMessageInfo + +func (m *RelayMiningDifficulty) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *RelayMiningDifficulty) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *RelayMiningDifficulty) GetNumRelaysEma() uint64 { + if m != nil { + return m.NumRelaysEma + } + return 0 +} + +func (m *RelayMiningDifficulty) GetTargetHash() []byte { + if m != nil { + return m.TargetHash + } + return nil +} + +func init() { + proto.RegisterType((*RelayMiningDifficulty)(nil), "poktroll.tokenomics.RelayMiningDifficulty") +} + +func init() { + proto.RegisterFile("poktroll/tokenomics/relay_mining_difficulty.proto", fileDescriptor_1777fca7cd39aaea) +} + +var fileDescriptor_1777fca7cd39aaea = []byte{ + // 292 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0xeb, 0xbf, 0xd5, 0x2f, 0xd5, 0xad, 0x18, 0x02, 0x48, 0x11, 0x12, 0x26, 0x20, 0x86, + 0x2c, 0x34, 0x42, 0x7d, 0x03, 0x04, 0x52, 0x19, 0x18, 0xc8, 0xc8, 0x62, 0x39, 0x89, 0x6b, 0x5b, + 0x89, 0xed, 0xc8, 0x76, 0x80, 0xbc, 0x05, 0x8f, 0xc0, 0xe3, 0x30, 0x76, 0xec, 0x88, 0x92, 0x17, + 0x41, 0x71, 0xa1, 0xb0, 0x59, 0x9f, 0xef, 0x39, 0xf7, 0x9e, 0x03, 0xaf, 0x6b, 0x5d, 0x3a, 0xa3, + 0xab, 0x2a, 0x71, 0xba, 0xa4, 0x4a, 0x4b, 0x91, 0xdb, 0xc4, 0xd0, 0x8a, 0xb4, 0x58, 0x0a, 0x25, + 0x14, 0xc3, 0x85, 0x58, 0xaf, 0x45, 0xde, 0x54, 0xae, 0x5d, 0xd4, 0x46, 0x3b, 0x1d, 0x1c, 0xfe, + 0x48, 0x16, 0xbf, 0x92, 0x93, 0x23, 0xa6, 0x99, 0xf6, 0xff, 0xc9, 0xf0, 0xda, 0x8d, 0x5e, 0xbc, + 0x03, 0x78, 0x9c, 0x0e, 0x66, 0x0f, 0xde, 0xeb, 0x76, 0x6f, 0x15, 0x9c, 0x42, 0x68, 0xa9, 0x79, + 0x16, 0x39, 0xc5, 0xa2, 0x08, 0x41, 0x04, 0xe2, 0x69, 0x3a, 0xfd, 0x26, 0xf7, 0x45, 0x70, 0x0e, + 0xe7, 0x59, 0xa5, 0xf3, 0x12, 0x73, 0x2a, 0x18, 0x77, 0xe1, 0xbf, 0x08, 0xc4, 0xe3, 0x74, 0xe6, + 0xd9, 0xca, 0xa3, 0xe0, 0x12, 0x1e, 0xa8, 0x46, 0x62, 0x7f, 0xab, 0xc5, 0x54, 0x92, 0x70, 0x1c, + 0x81, 0x78, 0x92, 0xce, 0x55, 0x23, 0xfd, 0x4e, 0x7b, 0x27, 0x49, 0x70, 0x06, 0x67, 0x8e, 0x18, + 0x46, 0x1d, 0xe6, 0xc4, 0xf2, 0x70, 0x12, 0x81, 0x78, 0x9e, 0xc2, 0x1d, 0x5a, 0x11, 0xcb, 0x6f, + 0x1e, 0x3f, 0x3a, 0x04, 0x36, 0x1d, 0x02, 0xdb, 0x0e, 0x81, 0xcf, 0x0e, 0x81, 0xb7, 0x1e, 0x8d, + 0x36, 0x3d, 0x1a, 0x6d, 0x7b, 0x34, 0x7a, 0x5a, 0x32, 0xe1, 0x78, 0x93, 0x2d, 0x72, 0x2d, 0x93, + 0x21, 0xf6, 0x95, 0xa2, 0xee, 0x45, 0x9b, 0x32, 0xd9, 0xd7, 0xf6, 0xfa, 0xb7, 0x38, 0xd7, 0xd6, + 0xd4, 0x66, 0xff, 0x7d, 0xf8, 0xe5, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x9e, 0x74, 0x57, + 0x5c, 0x01, 0x00, 0x00, +} + +func (m *RelayMiningDifficulty) 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 *RelayMiningDifficulty) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayMiningDifficulty) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TargetHash) > 0 { + i -= len(m.TargetHash) + copy(dAtA[i:], m.TargetHash) + i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(len(m.TargetHash))) + i-- + dAtA[i] = 0x22 + } + if m.NumRelaysEma != 0 { + i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(m.NumRelaysEma)) + i-- + dAtA[i] = 0x18 + } + if m.BlockHeight != 0 { + i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintRelayMiningDifficulty(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRelayMiningDifficulty(dAtA []byte, offset int, v uint64) int { + offset -= sovRelayMiningDifficulty(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RelayMiningDifficulty) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovRelayMiningDifficulty(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovRelayMiningDifficulty(uint64(m.BlockHeight)) + } + if m.NumRelaysEma != 0 { + n += 1 + sovRelayMiningDifficulty(uint64(m.NumRelaysEma)) + } + l = len(m.TargetHash) + if l > 0 { + n += 1 + l + sovRelayMiningDifficulty(uint64(l)) + } + return n +} + +func sovRelayMiningDifficulty(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRelayMiningDifficulty(x uint64) (n int) { + return sovRelayMiningDifficulty(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RelayMiningDifficulty) 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 ErrIntOverflowRelayMiningDifficulty + } + 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: RelayMiningDifficulty: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayMiningDifficulty: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayMiningDifficulty + } + 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 ErrInvalidLengthRelayMiningDifficulty + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRelayMiningDifficulty + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayMiningDifficulty + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumRelaysEma", wireType) + } + m.NumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayMiningDifficulty + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayMiningDifficulty + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRelayMiningDifficulty + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRelayMiningDifficulty + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetHash = append(m.TargetHash[:0], dAtA[iNdEx:postIndex]...) + if m.TargetHash == nil { + m.TargetHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelayMiningDifficulty(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelayMiningDifficulty + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRelayMiningDifficulty(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, ErrIntOverflowRelayMiningDifficulty + } + 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, ErrIntOverflowRelayMiningDifficulty + } + 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, ErrIntOverflowRelayMiningDifficulty + } + 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, ErrInvalidLengthRelayMiningDifficulty + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRelayMiningDifficulty + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRelayMiningDifficulty + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRelayMiningDifficulty = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRelayMiningDifficulty = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRelayMiningDifficulty = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go new file mode 100644 index 000000000..e4fec264c --- /dev/null +++ b/x/tokenomics/types/tx.pb.go @@ -0,0 +1,1266 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/tokenomics/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type to update all params at once. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/tokenomics parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_aa0f2fdbd9b6d7eb, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_aa0f2fdbd9b6d7eb, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgUpdateParam is the Msg/UpdateParam request type to update a single param. +type MsgUpdateParam struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // The (name, as_type) tuple must match the corresponding name and type as + // specified in the `Params` message in `proof/params.proto.` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Types that are valid to be assigned to AsType: + // + // *MsgUpdateParam_AsString + // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsBytes + AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` +} + +func (m *MsgUpdateParam) Reset() { *m = MsgUpdateParam{} } +func (m *MsgUpdateParam) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParam) ProtoMessage() {} +func (*MsgUpdateParam) Descriptor() ([]byte, []int) { + return fileDescriptor_aa0f2fdbd9b6d7eb, []int{2} +} +func (m *MsgUpdateParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParam.Merge(m, src) +} +func (m *MsgUpdateParam) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParam) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParam.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParam proto.InternalMessageInfo + +type isMsgUpdateParam_AsType interface { + isMsgUpdateParam_AsType() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateParam_AsString struct { + AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` +} +type MsgUpdateParam_AsInt64 struct { + AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` +} +type MsgUpdateParam_AsBytes struct { + AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` +} + +func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} + +func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { + if m != nil { + return m.AsType + } + return nil +} + +func (m *MsgUpdateParam) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParam) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpdateParam) GetAsString() string { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { + return x.AsString + } + return "" +} + +func (m *MsgUpdateParam) GetAsInt64() int64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { + return x.AsInt64 + } + return 0 +} + +func (m *MsgUpdateParam) GetAsBytes() []byte { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { + return x.AsBytes + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateParam_AsString)(nil), + (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsBytes)(nil), + } +} + +// MsgUpdateParamResponse defines the response structure for executing a +// MsgUpdateParam message after a single param update. +type MsgUpdateParamResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgUpdateParamResponse) Reset() { *m = MsgUpdateParamResponse{} } +func (m *MsgUpdateParamResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamResponse) ProtoMessage() {} +func (*MsgUpdateParamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_aa0f2fdbd9b6d7eb, []int{3} +} +func (m *MsgUpdateParamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUpdateParamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamResponse.Merge(m, src) +} +func (m *MsgUpdateParamResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamResponse proto.InternalMessageInfo + +func (m *MsgUpdateParamResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.tokenomics.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.tokenomics.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParam)(nil), "poktroll.tokenomics.MsgUpdateParam") + proto.RegisterType((*MsgUpdateParamResponse)(nil), "poktroll.tokenomics.MsgUpdateParamResponse") +} + +func init() { proto.RegisterFile("poktroll/tokenomics/tx.proto", fileDescriptor_aa0f2fdbd9b6d7eb) } + +var fileDescriptor_aa0f2fdbd9b6d7eb = []byte{ + // 508 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xf6, 0x11, 0x48, 0xea, 0x6b, 0x28, 0xc2, 0x54, 0xd4, 0x35, 0xc8, 0xb1, 0x02, 0x48, 0x21, + 0xb4, 0xb6, 0x68, 0x50, 0x85, 0x3a, 0x20, 0xe1, 0xa9, 0x0c, 0x91, 0xc0, 0x88, 0x85, 0xc5, 0xba, + 0x24, 0x27, 0xd7, 0x4a, 0xed, 0xb3, 0xfc, 0xae, 0xd0, 0x6c, 0x88, 0x91, 0x89, 0x9f, 0xc1, 0x98, + 0x81, 0x7f, 0xc0, 0xd2, 0xb1, 0x30, 0x75, 0x8a, 0x50, 0x32, 0x44, 0xea, 0x5f, 0x60, 0x41, 0x3e, + 0x3b, 0x4e, 0x13, 0x59, 0x22, 0x62, 0x49, 0xde, 0x7d, 0xdf, 0xf7, 0xde, 0xdd, 0xf7, 0xde, 0x33, + 0xbe, 0x1f, 0xb1, 0x3e, 0x8f, 0xd9, 0xf1, 0xb1, 0xc5, 0x59, 0x9f, 0x86, 0x2c, 0xf0, 0xbb, 0x60, + 0xf1, 0x53, 0x33, 0x8a, 0x19, 0x67, 0xca, 0x9d, 0x19, 0x6b, 0xce, 0x59, 0xed, 0x36, 0x09, 0xfc, + 0x90, 0x59, 0xe2, 0x37, 0xd5, 0x69, 0x5b, 0x5d, 0x06, 0x01, 0x03, 0x2b, 0x00, 0xcf, 0xfa, 0xf0, + 0x34, 0xf9, 0xcb, 0x88, 0xed, 0x94, 0x70, 0xc5, 0xc9, 0x4a, 0x0f, 0x19, 0xb5, 0xe9, 0x31, 0x8f, + 0xa5, 0x78, 0x12, 0x65, 0xa8, 0x51, 0xf4, 0x9e, 0x88, 0xc4, 0x24, 0xc8, 0xf2, 0xea, 0x3f, 0x10, + 0xbe, 0xd5, 0x06, 0xef, 0x5d, 0xd4, 0x23, 0x9c, 0xbe, 0x16, 0x8c, 0xb2, 0x8f, 0x65, 0x72, 0xc2, + 0x8f, 0x58, 0xec, 0xf3, 0x81, 0x8a, 0x0c, 0xd4, 0x90, 0x6d, 0xf5, 0xd7, 0xf7, 0xdd, 0xcd, 0xec, + 0xc2, 0x97, 0xbd, 0x5e, 0x4c, 0x01, 0xde, 0xf2, 0xd8, 0x0f, 0x3d, 0x67, 0x2e, 0x55, 0x5e, 0xe0, + 0x72, 0x5a, 0x5b, 0xbd, 0x66, 0xa0, 0xc6, 0xfa, 0xde, 0x3d, 0xb3, 0xc0, 0xb0, 0x99, 0x5e, 0x62, + 0xcb, 0x67, 0xa3, 0x9a, 0xf4, 0x6d, 0x3a, 0x6c, 0x22, 0x27, 0xcb, 0x3a, 0x78, 0xfe, 0x79, 0x3a, + 0x6c, 0xce, 0xeb, 0x7d, 0x99, 0x0e, 0x9b, 0x8f, 0x72, 0x03, 0xa7, 0x57, 0x2d, 0x2c, 0xbd, 0xb8, + 0xbe, 0x8d, 0xb7, 0x96, 0x20, 0x87, 0x42, 0xc4, 0x42, 0xa0, 0xf5, 0x3f, 0x08, 0x6f, 0x2c, 0x72, + 0xff, 0xed, 0x4f, 0xc1, 0xd7, 0x43, 0x12, 0x50, 0xe1, 0x4e, 0x76, 0x44, 0xac, 0xec, 0x60, 0x99, + 0x80, 0x0b, 0x42, 0xab, 0x96, 0x44, 0xad, 0x9b, 0x97, 0xa3, 0xda, 0x1c, 0x3c, 0x94, 0x9c, 0x35, + 0x92, 0x15, 0x53, 0x1e, 0xe3, 0x35, 0x02, 0xae, 0x1f, 0xf2, 0xfd, 0x67, 0x6a, 0xd9, 0x40, 0x8d, + 0x92, 0x5d, 0xbd, 0x1c, 0xd5, 0x72, 0xec, 0x50, 0x72, 0x2a, 0x04, 0x5e, 0x25, 0x61, 0x26, 0xed, + 0x0c, 0x38, 0x05, 0xb5, 0x62, 0xa0, 0x46, 0x35, 0x97, 0x0a, 0x2c, 0x95, 0xda, 0x49, 0x78, 0xb0, + 0xb1, 0xd8, 0x37, 0x5b, 0xc6, 0x15, 0x02, 0x2e, 0x1f, 0x44, 0xb4, 0xde, 0xc6, 0x77, 0x17, 0xcd, + 0xcf, 0xfa, 0xa2, 0xb4, 0xf2, 0x61, 0xa1, 0x7f, 0x0e, 0x6b, 0x36, 0xa1, 0xbd, 0x9f, 0x08, 0x97, + 0xda, 0xe0, 0x29, 0x1d, 0x5c, 0x5d, 0xd8, 0x98, 0x87, 0x85, 0xc9, 0x4b, 0x23, 0xd1, 0x76, 0x56, + 0x51, 0xe5, 0x0f, 0x74, 0xf1, 0xfa, 0xd5, 0xa1, 0x3d, 0x58, 0x21, 0x59, 0x7b, 0xb2, 0x82, 0x68, + 0x76, 0x81, 0x76, 0xe3, 0x53, 0xb2, 0x7d, 0xf6, 0x9b, 0xb3, 0xb1, 0x8e, 0xce, 0xc7, 0x3a, 0xba, + 0x18, 0xeb, 0xe8, 0xf7, 0x58, 0x47, 0x5f, 0x27, 0xba, 0x74, 0x3e, 0xd1, 0xa5, 0x8b, 0x89, 0x2e, + 0xbd, 0x6f, 0x79, 0x3e, 0x3f, 0x3a, 0xe9, 0x98, 0x5d, 0x16, 0x58, 0x49, 0xed, 0xdd, 0x90, 0xf2, + 0x8f, 0x2c, 0xee, 0x5b, 0xc5, 0x8b, 0x99, 0x34, 0x1d, 0x3a, 0x65, 0xf1, 0x6d, 0xb5, 0xfe, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x02, 0x3d, 0xf2, 0x43, 0x0f, 0x04, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, error) { + out := new(MsgUpdateParamResponse) + err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Msg/UpdateParam", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) UpdateParam(ctx context.Context, req *MsgUpdateParam) (*MsgUpdateParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParam not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.tokenomics.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParam_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParam(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.tokenomics.Msg/UpdateParam", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParam(ctx, req.(*MsgUpdateParam)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.tokenomics.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "UpdateParam", + Handler: _Msg_UpdateParam_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/tokenomics/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam) 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 *MsgUpdateParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AsType != nil { + { + size := m.AsType.Size() + i -= size + if _, err := m.AsType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.AsString) + copy(dAtA[i:], m.AsString) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AsBytes != nil { + i -= len(m.AsBytes) + copy(dAtA[i:], m.AsBytes) + i = encodeVarintTx(dAtA, i, uint64(len(m.AsBytes))) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *MsgUpdateParamResponse) 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 *MsgUpdateParamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AsType != nil { + n += m.AsType.Size() + } + return n +} + +func (m *MsgUpdateParam_AsString) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AsString) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgUpdateParam_AsInt64) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.AsInt64)) + return n +} +func (m *MsgUpdateParam_AsBytes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsBytes != nil { + l = len(m.AsBytes) + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUpdateParamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParam) 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 ErrIntOverflowTx + } + 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: MsgUpdateParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsString", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AsType = &MsgUpdateParam_AsInt64{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.AsType = &MsgUpdateParam_AsBytes{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamResponse: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 53d5fcb4edeb97c4b890e4dd4171b80c4a2c8872 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 16:08:56 +0200 Subject: [PATCH 49/77] chore: review feedback improvements Co-authored-by: red-0ne --- testutil/events/attributes.go | 22 ++++++++++++++++++++ testutil/integration/app.go | 4 ++-- testutil/integration/options.go | 14 ++++++------- testutil/integration/suites/base.go | 26 ++++++------------------ testutil/integration/suites/base_test.go | 11 +++++++--- testutil/integration/suites/interface.go | 8 ++------ 6 files changed, 47 insertions(+), 38 deletions(-) create mode 100644 testutil/events/attributes.go diff --git a/testutil/events/attributes.go b/testutil/events/attributes.go new file mode 100644 index 000000000..bcee58ab3 --- /dev/null +++ b/testutil/events/attributes.go @@ -0,0 +1,22 @@ +package events + +import ( + "strings" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" +) + +// GetAttributeValue returns the value of the attribute with the given key in the +// event. The returned attribute value is trimmed of any quotation marks. If the +// attribute does not exist, hasAttr is false. +func GetAttributeValue( + event *cosmostypes.Event, + key string, +) (value string, hasAttr bool) { + attr, hasAttr := event.GetAttribute(key) + if !hasAttr { + return "", false + } + + return strings.Trim(attr.GetValue(), "\""), true +} diff --git a/testutil/integration/app.go b/testutil/integration/app.go index d79d33b7a..f5c3c2ff9 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -144,7 +144,7 @@ func NewIntegrationApp( keys map[string]*storetypes.KVStoreKey, msgRouter *baseapp.MsgServiceRouter, queryHelper *baseapp.QueryServiceTestHelper, - opts ...IntegrationAppOption, + opts ...IntegrationAppOptionFn, ) *App { t.Helper() @@ -231,7 +231,7 @@ func NewIntegrationApp( // TODO_TECHDEBT: Not all of the modules are created here (e.g. minting module), // so it is up to the developer to add / improve / update this function over time // as the need arises. -func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOption) *App { +func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *App { t.Helper() // Prepare & register the codec for all the interfaces diff --git a/testutil/integration/options.go b/testutil/integration/options.go index b96847189..518bd8735 100644 --- a/testutil/integration/options.go +++ b/testutil/integration/options.go @@ -8,7 +8,7 @@ import ( ) // IntegrationAppConfig is a configuration struct for an integration App. Its fields -// are intended to be set/updated by IntegrationAppOption functions which are passed +// are intended to be set/updated by IntegrationAppOptionFn functions which are passed // during integration App construction. type IntegrationAppConfig struct { // InitChainerModuleFns are called for each module during the integration App's @@ -16,28 +16,28 @@ type IntegrationAppConfig struct { InitChainerModuleFns []InitChainerModuleFn } -// IntegrationAppOption is a function that receives and has the opportunity to +// IntegrationAppOptionFn is a function that receives and has the opportunity to // modify the IntegrationAppConfig. It is intended to be passed during integration // App construction to modify the behavior of the integration App. -type IntegrationAppOption func(*IntegrationAppConfig) +type IntegrationAppOptionFn func(*IntegrationAppConfig) // InitChainerModuleFn is a function that is called for each module during the // integration App's InitChainer function. type InitChainerModuleFn func(cosmostypes.Context, codec.Codec, appmodule.AppModule) -// WithInitChainerModuleFn returns an IntegrationAppOption that appends the given +// WithInitChainerModuleFn returns an IntegrationAppOptionFn that appends the given // InitChainerModuleFn to the IntegrationAppConfig's InitChainerModuleFns. -func WithInitChainerModuleFn(fn InitChainerModuleFn) IntegrationAppOption { +func WithInitChainerModuleFn(fn InitChainerModuleFn) IntegrationAppOptionFn { return func(config *IntegrationAppConfig) { config.InitChainerModuleFns = append(config.InitChainerModuleFns, fn) } } -// WithModuleGenesisState returns an IntegrationAppOption that appends an +// WithModuleGenesisState returns an IntegrationAppOptionFn that appends an // InitChainerModuleFn to the IntegrationAppConfig's InitChainerModuleFns which // initializes the module's genesis state with the given genesisState. T is expected // to be the module's AppModule type. -func WithModuleGenesisState[T module.HasGenesis](genesisState cosmostypes.Msg) IntegrationAppOption { +func WithModuleGenesisState[T module.HasGenesis](genesisState cosmostypes.Msg) IntegrationAppOptionFn { return WithInitChainerModuleFn( NewInitChainerModuleGenesisStateOptionFn[T](genesisState), ) diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index a4328566a..748873fe9 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -34,11 +34,11 @@ type BaseIntegrationSuite struct { } // NewApp constructs a new integration app and sets it on the suite. -func (s *BaseIntegrationSuite) NewApp(t *testing.T, opts ...integration.IntegrationAppOption) *integration.App { +func (s *BaseIntegrationSuite) NewApp(t *testing.T, opts ...integration.IntegrationAppOptionFn) *integration.App { t.Helper() defaultIntegrationAppOption := integration.WithInitChainerModuleFn(newInitChainerCollectModuleNamesFn(s)) - opts = append([]integration.IntegrationAppOption{defaultIntegrationAppOption}, opts...) + opts = append([]integration.IntegrationAppOptionFn{defaultIntegrationAppOption}, opts...) s.app = integration.NewCompleteIntegrationApp(t, opts...) return s.app } @@ -100,9 +100,10 @@ func (s *BaseIntegrationSuite) GetBankQueryClient() banktypes.QueryClient { return banktypes.NewQueryClient(s.GetApp().QueryHelper()) } -// FilterLatestEvents returns the most recent events in the event manager that -// match the given matchFn. -func (s *BaseIntegrationSuite) FilterLatestEvents( +// FilterEvents returns the events from the event manager which match the given +// matchFn. Events are returned in reverse order, i.e. the most recent event is +// first. +func (s *BaseIntegrationSuite) FilterEvents( matchFn func(*cosmostypes.Event) bool, ) (matchedEvents []*cosmostypes.Event) { return s.filterEvents(matchFn, false) @@ -122,21 +123,6 @@ func (s *BaseIntegrationSuite) LatestMatchingEvent( return filteredEvents[0] } -// GetAttributeValue returns the value of the attribute with the given key in the -// event. The returned attribute value is trimmed of any quotation marks. If the -// attribute does not exist, hasAttr is false. -func (s *BaseIntegrationSuite) GetAttributeValue( - event *cosmostypes.Event, - key string, -) (value string, hasAttr bool) { - attr, hasAttr := event.GetAttribute(key) - if !hasAttr { - return "", false - } - - return strings.Trim(attr.GetValue(), "\""), true -} - // filterEvents returns the events from the event manager that match the given matchFn. // If latestOnly is true, then only the most recent matching event is returned. // diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index f9d6974ee..ea93209fe 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -57,6 +57,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetApp_ReturnsApp() { app := s.NewApp(s.T()) require.Same(s.T(), app, s.GetApp()) } + func (s *BaseIntegrationSuiteTestSuite) TestSetApp() { // Construct an app. app := s.NewApp(s.T()) @@ -124,7 +125,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMat // Filter for the "message" type event with "action" attribute value // equal to the MsgSend TypeURL. msgSendTypeURL := cosmostypes.MsgTypeURL(&banktypes.MsgSend{}) - matchedEvents := s.FilterLatestEvents(events.NewMsgEventMatchFn(msgSendTypeURL)) + matchedEvents := s.FilterEvents(events.NewMsgEventMatchFn(msgSendTypeURL)) require.Equal(s.T(), expectedNumEvents, len(matchedEvents), "unexpected number of matched events") @@ -135,13 +136,17 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMat func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMatchFn() { expectedNumEvents := 3 - s.NewApp(s.T()) + + // Assert that the event manager is empty before emitting events. + require.Equal(s.T(), 0, len(s.SdkCtx().EventManager().Events())) + + // Emit the expected number of EventGatewayUnstaked events. s.emitPoktrollGatewayUnstakedEvents(expectedNumEvents) // Filter for the event with type equal to the EventGatewayUnstaked TypeURL. eventGatewayUnstakedTypeURL := cosmostypes.MsgTypeURL(&gatewaytypes.EventGatewayUnstaked{}) - matchedEvents := s.FilterLatestEvents(events.NewEventTypeMatchFn(eventGatewayUnstakedTypeURL)) + matchedEvents := s.FilterEvents(events.NewEventTypeMatchFn(eventGatewayUnstakedTypeURL)) require.Equal(s.T(), expectedNumEvents, len(matchedEvents), "unexpected number of matched events") diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index 54555c6ce..c09b2cf28 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -15,7 +15,7 @@ import ( // exercise an integration.App. type IntegrationSuite interface { // NewApp constructs a new integration app and sets it on the suite. - NewApp(*testing.T, ...integration.IntegrationAppOption) *integration.App + NewApp(*testing.T, ...integration.IntegrationAppOptionFn) *integration.App // SetApp sets the integration app on the suite. SetApp(*integration.App) // GetApp returns the integration app from the suite. @@ -37,12 +37,8 @@ type IntegrationSuite interface { // FilterLatestEvents returns the most recent events in the event manager that // match the given matchFn. - FilterLatestEvents(matchFn func(*cosmostypes.Event) bool) []*cosmostypes.Event + FilterEvents(matchFn func(*cosmostypes.Event) bool) []*cosmostypes.Event // LatestMatchingEvent returns the most recent event in the event manager that // matches the given matchFn. LatestMatchingEvent(matchFn func(*cosmostypes.Event) bool) *cosmostypes.Event - // GetAttributeValue returns the value of the attribute with the given key in the - // event. The returned attribute value is trimmed of any quotation marks. If the - // attribute does not exist, hasAttr is false. - GetAttributeValue(event *cosmostypes.Event, key string) (value string, hasAttr bool) } From 836bbe3e2ce34f1c95873a3ecfb89b306bc2d5ef Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 16:47:36 +0200 Subject: [PATCH 50/77] fixup: HEAD^ --- testutil/integration/suites/base_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index ea93209fe..caa2f3fc0 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -171,7 +171,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { // Get the "message" event and check its "module" attribute. Cosmos-sdk emits // a "message" event alongside other txResult events for each message in a tx. event := testEvents[0] - value, hasAttr := s.GetAttributeValue(&event, "module") + value, hasAttr := events.GetAttributeValue(&event, "module") require.True(s.T(), hasAttr) require.Equal(s.T(), banktypes.ModuleName, value) } From 912c09efd7f1b9e9fea97c210f27dc42c0fce349 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 18:33:45 +0200 Subject: [PATCH 51/77] fix: post-merge --- tests/integration/params/update_param_test.go | 21 ++++------ .../integration/params/update_params_test.go | 25 +++++------ testutil/integration/suites/authz.go | 41 +++++++++---------- testutil/integration/suites/update_params.go | 26 ++++++------ 4 files changed, 50 insertions(+), 63 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index ab999db1c..8efbe6305 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -1,3 +1,5 @@ +//go:build integration + package params import ( @@ -11,7 +13,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/testutil/cases" - "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/integration/suites" ) @@ -24,7 +25,7 @@ func (s *MsgUpdateParamSuite) SetupTest() { s.UpdateParamsSuite.SetupTest() // Allocate an address for unauthorized user. - nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() + nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") unauthorizedAddr = nextAcct.Address } @@ -90,17 +91,10 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) - // Set up assertion that the MsgExec will fail. - errAssertionOpt := integration.WithErrorAssertion( - func(err error) { - require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) - }, - ) - // Send an authz MsgExec from an unauthorized address. - runOpts := integration.RunUntilNextBlockOpts.Append(errAssertionOpt) execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) - anyRes := s.GetApp(t).RunMsg(t, &execMsg, runOpts...) + anyRes, err := s.GetApp().RunMsg(t, &execMsg) + require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) require.Nil(t, anyRes) }) } @@ -174,8 +168,9 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { // Send an authz MsgExec from an unauthorized address. execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) - anyRes := s.GetApp(t).RunMsg(t, &execMsg, integration.RunUntilNextBlockOpts...) - require.NotNil(t, anyRes) + authzExecResps := s.RunAuthzExecMsg(t, suites.AuthorizedAddr, &execMsg) + require.Equal(t, 1, len(authzExecResps)) + //authzExecResps[0].(*) // Query for the module's params. params, err := s.QueryModuleParams(t, moduleName) diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index 320ee93fc..17010347f 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -1,3 +1,5 @@ +//go:build integration + package params import ( @@ -9,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/integration/suites" ) @@ -24,13 +25,13 @@ func (s *MsgUpdateParamsSuite) SetupTest() { s.UpdateParamsSuite.SetupTest() // Allocate an address for unauthorized user. - nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() + nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") unauthorizedAddr = nextAcct.Address } func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { - for _, moduleName := range s.GetModuleNames() { + for _, moduleName := range s.GetPoktrollModuleNames() { s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) @@ -49,24 +50,17 @@ func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { SetString(suites.AuthorityAddr.String()) msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) - // Set up assertion that the MsgExec will fail. - errAssertionOpt := integration.WithErrorAssertion( - func(err error) { - require.ErrorIs(t, err, authz.ErrNoAuthorizationFound) - }, - ) - // Send an authz MsgExec from an unauthorized address. - runOpts := integration.RunUntilNextBlockOpts.Append(errAssertionOpt) execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - anyRes := s.GetApp(t).RunMsg(t, &execMsg, runOpts...) + anyRes, err := s.GetApp().RunMsg(t, &execMsg) + require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) require.Nil(t, anyRes) }) } } func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { - for _, moduleName := range s.GetModuleNames() { + for _, moduleName := range s.GetPoktrollModuleNames() { s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) @@ -89,7 +83,10 @@ func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { // Send an authz MsgExec from an unauthorized address. execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - anyRes := s.GetApp(t).RunMsg(t, &execMsg, integration.RunUntilNextBlockOpts...) + s.RunAuthzExecMsg(t, suites.AuthorizedAddr, &execMsg) + + anyRes, err := s.GetApp().RunMsg(t, &execMsg) + require.NoError(t, err) require.NotNil(t, anyRes) // Query for the module's params. diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index 5dfc18dd5..a90e14e57 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -7,11 +7,10 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" - - "github.com/pokt-network/poktroll/testutil/integration" ) const ( @@ -32,25 +31,19 @@ type AuthzIntegrationSuite struct { // TODO_IN_THIS_COMMIT: godoc func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( t *testing.T, - granterAddr, granteeAddr types.AccAddress, + granterAddr, granteeAddr cosmostypes.AccAddress, msgName string, moduleNames ...string, ) { t.Helper() var ( - runOpts []integration.RunOption foundModuleGrants = make(map[string]int) ) - for moduleIdx, moduleName := range moduleNames { - // Commit and finalize the block after the last module's grant. - if moduleIdx == len(moduleNames)-1 { - runOpts = append(runOpts, integration.RunUntilNextBlockOpts...) - } - + for _, moduleName := range moduleNames { msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) authorization := &authz.GenericAuthorization{Msg: msgType} - s.RunAuthzGrantMsg(t, granterAddr, granteeAddr, authorization, runOpts...) + s.RunAuthzGrantMsg(t, granterAddr, granteeAddr, authorization) // Query for the created grant to assert that they were created. authzQueryClient := authz.NewQueryClient(s.app.QueryHelper()) @@ -78,32 +71,36 @@ func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( t *testing.T, granterAddr, - granteeAddr types.AccAddress, + granteeAddr cosmostypes.AccAddress, authorization authz.Authorization, - runOpts ...integration.RunOption, ) { t.Helper() grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &defaultAuthzGrantExpiration) require.NoError(t, err) - anyRes := s.app.RunMsg(s.T(), grantMsg, runOpts...) + anyRes, err := s.app.RunMsg(s.T(), grantMsg) + require.NoError(t, err) require.NotNil(t, anyRes) } // TODO_IN_THIS_COMMIT: godoc func (s *AuthzIntegrationSuite) RunAuthzExecMsg( t *testing.T, - fromAddr types.AccAddress, - msgs ...types.Msg, -) { + fromAddr cosmostypes.AccAddress, + msgs ...cosmostypes.Msg, +) (msgRespsBz []tx.MsgResponse) { t.Helper() execMsg := authz.NewMsgExec(fromAddr, msgs) - anyRes := s.GetApp(t).RunMsg(s.T(), &execMsg, integration.RunUntilNextBlockOpts...) + anyRes, err := s.GetApp().RunMsg(s.T(), &execMsg) + require.NoError(t, err) require.NotNil(t, anyRes) - execRes := new(authz.MsgExecResponse) - err := s.GetApp(t).GetCodec().UnpackAny(anyRes, &execRes) - require.NoError(t, err) + execRes := anyRes.(*authz.MsgExecResponse) + for _, msgResBz := range execRes.Results { + msgRespsBz = append(msgRespsBz, msgResBz) + } + + return msgRespsBz } diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index e54cfde31..f7c0dfe3f 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -38,6 +38,7 @@ var ( ProofWindowCloseOffsetBlocks: 5, SupplierUnbondingPeriodSessions: 9, ApplicationUnbondingPeriodSessions: 9, + ComputeUnitsToTokensMultiplier: 420, } ValidSessionParams = sessiontypes.Params{} @@ -51,26 +52,23 @@ var ( MaxDelegatedGateways: 999, } - ValidGatewayParams = gatewaytypes.Params{} - - ValidSupplierParams = suppliertypes.Params{} + ValidGatewayParams = gatewaytypes.Params{} + ValidSupplierParams = suppliertypes.Params{} + ValidTokenomicsParams = tokenomicstypes.Params{} ValidMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) ValidSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") - ValidProofParams = prooftypes.Params{ + ValidProofRequirementThresholdCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100) + ValidProofParams = prooftypes.Params{ RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, ProofRequestProbability: 0.1, - ProofRequirementThreshold: 100, + ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, ProofMissingPenalty: &ValidMissingPenaltyCoin, ProofSubmissionFee: &ValidSubmissionFeeCoin, } - ValidTokenomicsParams = tokenomicstypes.Params{ - ComputeUnitsToTokensMultiplier: 420, - } - // TODO_IN_THIS_COMMIT: godoc... // NB: Authority fields are intentionally omitted and expected to be added // to a **copy** of the respective message by the test. @@ -193,9 +191,9 @@ func (s *UpdateParamsSuite) SetupTest() { s.NewApp(s.T()) // Set the authority, authorized, and unauthorized addresses. - AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp(s.T()).GetAuthority()) + AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) - nextAcct, ok := s.GetApp(s.T()).GetPreGeneratedAccounts().Next() + nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") AuthorizedAddr = nextAcct.Address @@ -204,7 +202,7 @@ func (s *UpdateParamsSuite) SetupTest() { AuthorityAddr, AuthorizedAddr, MsgUpdateParamsName, - s.GetModuleNames()..., + s.GetPoktrollModuleNames()..., ) // Create authz grants for all poktroll modules' MsgUpdateParam messages. @@ -234,14 +232,14 @@ func (s *UpdateParamsSuite) QueryModuleParams(t *testing.T, moduleName string) ( // Construct a new param client. newParamClientFn := reflect.ValueOf(NewParamClientFns[moduleName]) newParamClientFnArgs := []reflect.Value{ - reflect.ValueOf(s.GetApp(t).QueryHelper()), + reflect.ValueOf(s.GetApp().QueryHelper()), } paramClient := newParamClientFn.Call(newParamClientFnArgs)[0] // Query for the module's params. paramsQueryReqValue := reflect.New(reflect.TypeOf(QueryParamsRequestByModule[moduleName])) callParamsArgs := []reflect.Value{ - reflect.ValueOf(s.GetApp(t).GetSdkCtx()), + reflect.ValueOf(s.GetApp().GetSdkCtx()), paramsQueryReqValue, } callParamsReturnValues := paramClient.MethodByName("Params").Call(callParamsArgs) From c0847c2b20263b635656af19aa41ef426268b3c4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 18:34:36 +0200 Subject: [PATCH 52/77] fix: bugs discovered --- testutil/integration/app.go | 24 ++++++++++++++---------- testutil/integration/suites/base.go | 3 +++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index f5c3c2ff9..3c5ac9d5d 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -90,15 +90,15 @@ var ( // FaucetAmountUpokt is the number of upokt coins that the faucet account // is funded with. FaucetAmountUpokt = int64(math2.MaxInt64) - - // defaultIntegrationAppConfig is the default configuration for the integration app. - defaultIntegrationAppConfig = IntegrationAppConfig{ - InitChainerModuleFns: []InitChainerModuleFn{ - newFaucetInitChainerFn(FaucetAddrStr, FaucetAmountUpokt), - }, - } ) +// defaultIntegrationAppOptionFn is the default integration module function for the +// integration app. It ensures that the bank module genesis state includes the faucet +// account with a large balance. +func defaultIntegrationAppOptionFn(cfg *IntegrationAppConfig) { + WithInitChainerModuleFn(newFaucetInitChainerFn(FaucetAddrStr, FaucetAmountUpokt))(cfg) +} + // App is a test application that can be used to test the behaviour when none // of the modules are mocked and their integration (cross module interaction) // needs to be validated. @@ -148,7 +148,8 @@ func NewIntegrationApp( ) *App { t.Helper() - cfg := &defaultIntegrationAppConfig + cfg := &IntegrationAppConfig{} + opts = append(opts, defaultIntegrationAppOptionFn) for _, opt := range opts { opt(cfg) } @@ -664,8 +665,11 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg) (tx.MsgResponse, error) { t.Helper() txMsgRes, err := app.RunMsgs(t, msg) - require.Equal(t, 1, len(txMsgRes), "expected exactly 1 tx msg response") + if err != nil { + return nil, err + } + require.Equal(t, 1, len(txMsgRes), "expected exactly 1 tx msg response") return txMsgRes[0], err } @@ -682,7 +686,7 @@ func (app *App) RunMsgs(t *testing.T, msgs ...sdk.Msg) (txMsgResps []tx.MsgRespo // Commit the updated state after the message has been handled. var finalizeBlockRes *abci.ResponseFinalizeBlock defer func() { - if _, commitErr := app.Commit(); err != nil { + if _, commitErr := app.Commit(); commitErr != nil { err = fmt.Errorf("committing state: %w", commitErr) return } diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 748873fe9..8af7e5e24 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -37,6 +37,9 @@ type BaseIntegrationSuite struct { func (s *BaseIntegrationSuite) NewApp(t *testing.T, opts ...integration.IntegrationAppOptionFn) *integration.App { t.Helper() + s.poktrollModuleNames = nil + s.cosmosModuleNames = nil + defaultIntegrationAppOption := integration.WithInitChainerModuleFn(newInitChainerCollectModuleNamesFn(s)) opts = append([]integration.IntegrationAppOptionFn{defaultIntegrationAppOption}, opts...) s.app = integration.NewCompleteIntegrationApp(t, opts...) From 79b18da3e9519b22461ad0f82c863c3a08c3fc35 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 18:51:11 +0200 Subject: [PATCH 53/77] chore: add missing build constraint --- testutil/integration/suites/update_params.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index f7c0dfe3f..45e7cc2dc 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -1,3 +1,5 @@ +//go:build integration + package suites import ( From cbbef674fb5c5ff8379901e43335ac30012555aa Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 09:07:22 +0200 Subject: [PATCH 54/77] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- x/supplier/keeper/msg_server_stake_supplier.go | 1 + x/supplier/keeper/msg_server_unstake_supplier.go | 1 + x/supplier/keeper/unbond_suppliers.go | 1 + 3 files changed, 3 insertions(+) diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index a31ea9db8..d3478cab7 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -123,6 +123,7 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie logger.Info(fmt.Sprintf("Successfully updated supplier stake for supplier: %+v", supplier)) sdkCtx := sdk.UnwrapSDKContext(ctx) + // Emit an event which signals that the supplier staked. event := &types.EventSupplierStaked{ Supplier: &supplier, } diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index e6c04685f..c96feb66b 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -69,6 +69,7 @@ func (k msgServer) UnstakeSupplier( supplier.UnstakeSessionEndHeight = uint64(shared.GetSessionEndHeight(&sharedParams, currentHeight)) k.SetSupplier(ctx, supplier) + // Emit an event which signals that the supplier successfully began unbonding their stake. unbondingHeight := shared.GetSupplierUnbondingHeight(&sharedParams, &supplier) event := &types.EventSupplierUnbondingBegin{ Supplier: &supplier, diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index 24f4f2dd0..1a3198ee7 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -69,6 +69,7 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { k.RemoveSupplier(ctx, supplierOperatorAddress.String()) logger.Info(fmt.Sprintf("Successfully removed the supplier: %+v", supplier)) + // Emit an event which signals that the supplier has sucessfully unbonded. event := &types.EventSupplierUnbondingEnd{ Supplier: &supplier, UnbondingHeight: unbondingHeight, From cf3e04c4810d5f197f5ca053a095a8dbb527caf7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 10:40:52 +0200 Subject: [PATCH 55/77] resolve: merge conflict --- .../relay_mining_integration_test.go | 74 +++++++++++++------ 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index a13fe512e..4def06029 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -1,18 +1,21 @@ +//go:build integration + package integration_test import ( "context" "testing" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/integration/suites" "github.com/pokt-network/poktroll/testutil/testrelayer" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -21,28 +24,52 @@ import ( tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -func TestComputeNewDifficultyHash_RewardsReflectWorkCompleted(t *testing.T) { - // Test params - globalComputeUnitsToTokensMultiplier := uint64(1) // keeping the math simple - // serviceComputeUnitsPerRelay := uint64(1) // keeping the math simple +var ( + // Test params. + computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple + proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) + //serviceComputeUnitsPerRelay = uint64(1) // keeping the math simple +) - // Prepare the keepers and integration app - integrationApp := integration.NewCompleteIntegrationApp(t) - sdkCtx := integrationApp.GetSdkCtx() - keepers := integrationApp.GetKeepers() +type RelayMiningIntegrationTestSuite struct { + suites.UpdateParamsSuite +} - // Set the global tokenomics params - err := keepers.SharedKeeper.SetParams(sdkCtx, sharedtypes.Params{ - ComputeUnitsToTokensMultiplier: globalComputeUnitsToTokensMultiplier, - }) - require.NoError(t, err) +func (s *RelayMiningIntegrationTestSuite) SetupTest() { + // Construct a fresh integration app for each test. + // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. + //s.NewApp(s.T()) + //s.SetupTestAccounts() + //s.SetupTestAuthzGrants() +} - // Set the global proof params so we never need a proof (for simplicity of this test) - err = keepers.ProofKeeper.SetParams(sdkCtx, prooftypes.Params{ - ProofRequestProbability: 0, // we never need a proof randomly - ProofRequirementThreshold: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(1e18)}, // a VERY high threshold - }) - require.NoError(t, err) +func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { + // Set the shared module param compute_units_to_tokens_multiplier. + // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. + //_, err := s.RunUpdateParam(s.T(), + // sharedtypes.ModuleName, + // sharedtypes.ParamComputeUnitsToTokensMultiplier, + // computeUnitsToTokensMultiplier, + //) + //require.NoError(s.T(), err) + + // Set the proof params so we never need a proof (for simplicity of this test) + // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. + //_, err = s.RunUpdateParam(s.T(), + // prooftypes.ModuleName, + // prooftypes.ParamProofRequestProbability, + // float32(0), + //) + //require.NoError(s.T(), err) + + // Set the proof requirement threshold to be VERY high. + // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. + //_, err = s.RunUpdateParam(s.T(), + // prooftypes.ModuleName, + // prooftypes.ParamProofRequirementThreshold, + // &proofRequirementThreshold, + //) + //require.NoError(s.T(), err) // TODO(@red-0ne, #781): Implement this test after the business logic is done. @@ -84,7 +111,7 @@ func TestComputeNewDifficultyHash_RewardsReflectWorkCompleted(t *testing.T) { require.NoError(t, err) // Compute the expected reward - expectedReward := numRelays * serviceComputeUnitsPerRelay * globalComputeUnitsToTokensMultiplier + expectedReward := numRelays * serviceComputeUnitsPerRelay * computeUnitsToTokensMultiplier fmt.Println("Expected reward:", expectedReward) // Compute the new difficulty hash @@ -154,3 +181,8 @@ func prepareRealClaim( RootHash: trie.Root(), } } + +func TestRelayMiningIntegrationSuite(t *testing.T) { + t.Skip("TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged.") + suite.Run(t, new(RelayMiningIntegrationTestSuite)) +} From 2cda72ae163b5d48512068bd2aa4e52e12dcb804 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 10:45:21 +0200 Subject: [PATCH 56/77] wip: improvements... --- tests/integration/params/update_param_test.go | 115 +++----------- testutil/integration/suites/authz.go | 18 ++- testutil/integration/suites/update_params.go | 144 +++++++++++++++--- 3 files changed, 151 insertions(+), 126 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 8efbe6305..7e2d01cbc 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -7,12 +7,10 @@ import ( "reflect" "testing" - cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/pokt-network/poktroll/testutil/cases" "github.com/pokt-network/poktroll/testutil/integration/suites" ) @@ -21,8 +19,11 @@ type MsgUpdateParamSuite struct { } func (s *MsgUpdateParamSuite) SetupTest() { + s.NewApp(s.T()) + // Call the SetupTest() of the inherited UpdateParamsSuite. - s.UpdateParamsSuite.SetupTest() + s.SetupTestAccounts() + s.SetupTestAuthzGrants() // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() @@ -49,53 +50,14 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] - require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) - - msgValue := reflect.ValueOf(msgIface) - msgType := msgValue.Type() - - // Copy the message and set the authority field. - msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue) - msgValueCopy.Elem(). - FieldByName("Authority"). - SetString(suites.AuthorityAddr.String()) - - msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(fieldName)) - - msgAsTypeStruct := suites.MsgUpdateParamTypesByModuleName[moduleName][fieldType] - msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) - t.Logf("fieldType: %q", fieldType) - t.Logf("msgAsTypeType: %+v", msgAsTypeType) - msgAsTypeValue := reflect.New(msgAsTypeType) - switch fieldType { - case "uint64": - msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(fieldValue.Interface().(uint64))) - case "int64": - msgAsTypeValue.Elem().FieldByName("AsInt64").Set(fieldValue) - case "float32": - msgAsTypeValue.Elem().FieldByName("AsFloat").Set(fieldValue) - case "string": - msgAsTypeValue.Elem().FieldByName("AsString").Set(fieldValue) - case "uint8": - msgAsTypeValue.Elem().FieldByName("AsBytes").Set(fieldValue) - // TODO_IN_THIS_COMMIT: check type name... - case "Coin": - msgAsTypeValue.Elem().FieldByName("AsCoin").Set(fieldValue) - default: - t.Fatalf("ERROR: unknown field type %q", fieldType) - } - - msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) - - msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) - - // Send an authz MsgExec from an unauthorized address. - execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) - anyRes, err := s.GetApp().RunMsg(t, &execMsg) + updateParamResAny, err := s.RunUpdateParamAsSigner(t, + moduleName, + fieldName, + fieldValue.Interface(), + unauthorizedAddr, + ) require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) - require.Nil(t, anyRes) + require.Nil(t, updateParamResAny) }) } } @@ -124,53 +86,14 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - msgIface, isMsgTypeFound := suites.MsgUpdateParamByModule[moduleName] - require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) - - msgValue := reflect.ValueOf(msgIface) - msgType := msgValue.Type() - - // Copy the message and set the authority field. - msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue) - msgValueCopy.Elem(). - FieldByName("Authority"). - SetString(suites.AuthorityAddr.String()) - - msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(fieldName)) - // TODO_IN_THIS_COMMIT: merge expected param value with defaults... - //expectedParamsValue := msgValueCopy.Elem().FieldByName("Params") - - msgAsTypeStruct := suites.MsgUpdateParamTypesByModuleName[moduleName][fieldType] - msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) - msgAsTypeValue := reflect.New(msgAsTypeType) - switch fieldType { - case "uint64": - msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(fieldValue.Interface().(uint64))) - case "int64": - msgAsTypeValue.Elem().FieldByName("AsInt64").Set(fieldValue) - case "float32": - msgAsTypeValue.Elem().FieldByName("AsFloat").Set(fieldValue) - case "string": - msgAsTypeValue.Elem().FieldByName("AsString").Set(fieldValue) - case "uint8": - msgAsTypeValue.Elem().FieldByName("AsBytes").Set(fieldValue) - // TODO_IN_THIS_COMMIT: check type name... - case "Coin": - msgAsTypeValue.Elem().FieldByName("AsCoin").Set(fieldValue) - default: - t.Fatalf("ERROR: unknown field type %q", fieldType) - } - - msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) - - msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) - - // Send an authz MsgExec from an unauthorized address. - execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParam}) - authzExecResps := s.RunAuthzExecMsg(t, suites.AuthorizedAddr, &execMsg) - require.Equal(t, 1, len(authzExecResps)) - //authzExecResps[0].(*) + updateParamResAny, err := s.RunUpdateParamAsSigner(t, + moduleName, + fieldName, + fieldValue.Interface(), + suites.AuthorizedAddr, + ) + require.NoError(t, err) + require.NotNil(t, updateParamResAny) // Query for the module's params. params, err := s.QueryModuleParams(t, moduleName) diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index a90e14e57..bd6064324 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -79,9 +79,9 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &defaultAuthzGrantExpiration) require.NoError(t, err) - anyRes, err := s.app.RunMsg(s.T(), grantMsg) + grantResAny, err := s.app.RunMsg(s.T(), grantMsg) require.NoError(t, err) - require.NotNil(t, anyRes) + require.NotNil(t, grantResAny) } // TODO_IN_THIS_COMMIT: godoc @@ -89,18 +89,20 @@ func (s *AuthzIntegrationSuite) RunAuthzExecMsg( t *testing.T, fromAddr cosmostypes.AccAddress, msgs ...cosmostypes.Msg, -) (msgRespsBz []tx.MsgResponse) { +) (msgRespsBz []tx.MsgResponse, err error) { t.Helper() execMsg := authz.NewMsgExec(fromAddr, msgs) - anyRes, err := s.GetApp().RunMsg(s.T(), &execMsg) - require.NoError(t, err) - require.NotNil(t, anyRes) + execResAny, err := s.GetApp().RunMsg(s.T(), &execMsg) + if err != nil { + return nil, err + } - execRes := anyRes.(*authz.MsgExecResponse) + require.NotNil(t, execResAny) + execRes := execResAny.(*authz.MsgExecResponse) for _, msgResBz := range execRes.Results { msgRespsBz = append(msgRespsBz, msgResBz) } - return msgRespsBz + return msgRespsBz, nil } diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index 45e7cc2dc..de2439826 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -8,9 +8,12 @@ import ( "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/cases" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -21,6 +24,18 @@ import ( tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) +// TODO_IN_THIS_COMMIT: godoc... +type ParamType = string + +const ( + ParamTypeInt64 ParamType = "int64" + ParamTypeUint64 ParamType = "uint64" + ParamTypeFloat32 ParamType = "float32" + ParamTypeString ParamType = "string" + ParamTypeBytes ParamType = "uint8" + ParamTypeCoin ParamType = "Coin" +) + const ( MsgUpdateParamsName = "MsgUpdateParams" MsgUpdateParamName = "MsgUpdateParam" @@ -101,6 +116,7 @@ var ( }, } + // TODO_IN_THIS_COMMIT: godoc... MsgUpdateParamByModule = map[string]any{ sharedtypes.ModuleName: sharedtypes.MsgUpdateParam{}, servicetypes.ModuleName: servicetypes.MsgUpdateParam{}, @@ -112,35 +128,38 @@ var ( //suppliertypes.ModuleName: suppliertypes.MsgUpdateParam{}, } - MsgUpdateParamTypesByModuleName = map[string]map[string]any{ + // TODO_IN_THIS_COMMIT: ... each module defines its own MsgUpdateParam_As* structs + // ... not every module has all types... + MsgUpdateParamTypesByModuleName = map[string]map[ParamType]any{ sharedtypes.ModuleName: { - "uint64": sharedtypes.MsgUpdateParam_AsInt64{}, - "int64": sharedtypes.MsgUpdateParam_AsInt64{}, - "string": sharedtypes.MsgUpdateParam_AsString{}, - "uint8": sharedtypes.MsgUpdateParam_AsBytes{}, + ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, }, servicetypes.ModuleName: { - "Coin": servicetypes.MsgUpdateParam_AsCoin{}, + ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, }, prooftypes.ModuleName: { - "uint64": prooftypes.MsgUpdateParam_AsInt64{}, - "int64": prooftypes.MsgUpdateParam_AsInt64{}, - "string": prooftypes.MsgUpdateParam_AsString{}, - "uint8": prooftypes.MsgUpdateParam_AsBytes{}, - "float32": prooftypes.MsgUpdateParam_AsFloat{}, - //"float64": prooftypes.MsgUpdateParam_AsFloat{}, - "Coin": prooftypes.MsgUpdateParam_AsCoin{}, + ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, + ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, + ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, }, tokenomicstypes.ModuleName: { - "uint64": tokenomicstypes.MsgUpdateParam_AsInt64{}, - "int64": tokenomicstypes.MsgUpdateParam_AsInt64{}, - "string": tokenomicstypes.MsgUpdateParam_AsString{}, - "uint8": tokenomicstypes.MsgUpdateParam_AsBytes{}, + ParamTypeUint64: tokenomicstypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: tokenomicstypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: tokenomicstypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: tokenomicstypes.MsgUpdateParam_AsBytes{}, }, } + // TODO_IN_THIS_COMMIT: godoc... MsgUpdateParamEnabledModuleNames []string + // TODO_IN_THIS_COMMIT: godoc... NewParamClientFns = map[string]any{ sharedtypes.ModuleName: sharedtypes.NewQueryClient, sessiontypes.ModuleName: sessiontypes.NewQueryClient, @@ -152,6 +171,7 @@ var ( tokenomicstypes.ModuleName: tokenomicstypes.NewQueryClient, } + // TODO_IN_THIS_COMMIT: godoc... QueryParamsRequestByModule = map[string]any{ sharedtypes.ModuleName: sharedtypes.QueryParamsRequest{}, sessiontypes.ModuleName: sessiontypes.QueryParamsRequest{}, @@ -163,6 +183,7 @@ var ( tokenomicstypes.ModuleName: tokenomicstypes.QueryParamsRequest{}, } + // TODO_IN_THIS_COMMIT: godoc... DefaultParamsByModule = map[string]any{ sharedtypes.ModuleName: sharedtypes.DefaultParams(), sessiontypes.ModuleName: sessiontypes.DefaultParams(), @@ -178,6 +199,7 @@ var ( ) func init() { + // TODO_IN_THIS_COMMIT: godoc... for moduleName := range MsgUpdateParamByModule { MsgUpdateParamEnabledModuleNames = append(MsgUpdateParamEnabledModuleNames, moduleName) } @@ -187,18 +209,20 @@ type UpdateParamsSuite struct { AuthzIntegrationSuite } -// SetupTest runs before each test in the suite. -func (s *UpdateParamsSuite) SetupTest() { - // Construct a fresh integration app for each test. - s.NewApp(s.T()) - +// TODO_IN_THIS_COMMIT: godoc +// SetupTestAccounts ... expected to be called after s.NewApp() ... accounts ... and module names... +func (s *UpdateParamsSuite) SetupTestAccounts() { // Set the authority, authorized, and unauthorized addresses. AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") AuthorizedAddr = nextAcct.Address +} +// TODO_IN_THIS_COMMIT: godoc +// SetupTestAuthzGrants ... expected to be called after s.NewApp() ... authority and authorized addresses... +func (s *UpdateParamsSuite) SetupTestAuthzGrants() { // Create authz grants for all poktroll modules' MsgUpdateParams messages. s.SendAuthzGrantMsgForPoktrollModules(s.T(), AuthorityAddr, @@ -216,6 +240,82 @@ func (s *UpdateParamsSuite) SetupTest() { ) } +func (s *UpdateParamsSuite) RunUpdateParam( + t *testing.T, + moduleName string, + paramName string, + paramValue any, +) (tx.MsgResponse, error) { + return s.RunUpdateParamAsSigner(t, + moduleName, + paramName, + paramValue, + AuthorizedAddr, + ) +} + +func (s *UpdateParamsSuite) RunUpdateParamAsSigner( + t *testing.T, + moduleName string, + paramName string, + paramValue any, + signerAddr cosmostypes.AccAddress, +) (tx.MsgResponse, error) { + paramReflectValue := reflect.ValueOf(paramValue) + paramType := paramReflectValue.Type().Name() + if paramReflectValue.Kind() == reflect.Pointer { + paramType = paramReflectValue.Elem().Type().Name() + } + + msgIface, isMsgTypeFound := MsgUpdateParamByModule[moduleName] + require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) + + msgValue := reflect.ValueOf(msgIface) + msgType := msgValue.Type() + + // Copy the message and set the authority field. + msgValueCopy := reflect.New(msgType) + msgValueCopy.Elem().Set(msgValue) + msgValueCopy.Elem(). + FieldByName("Authority"). + SetString(AuthorityAddr.String()) + + msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(paramName)) + + msgAsTypeStruct := MsgUpdateParamTypesByModuleName[moduleName][paramType] + msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) + msgAsTypeValue := reflect.New(msgAsTypeType) + switch paramType { + case ParamTypeUint64: + // NB: MsgUpdateParam doesn't currently support uint64 param type. + msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(paramReflectValue.Interface().(uint64))) + case ParamTypeInt64: + msgAsTypeValue.Elem().FieldByName("AsInt64").Set(paramReflectValue) + case ParamTypeFloat32: + msgAsTypeValue.Elem().FieldByName("AsFloat").Set(paramReflectValue) + case ParamTypeString: + msgAsTypeValue.Elem().FieldByName("AsString").Set(paramReflectValue) + case ParamTypeBytes: + msgAsTypeValue.Elem().FieldByName("AsBytes").Set(paramReflectValue) + case ParamTypeCoin: + msgAsTypeValue.Elem().FieldByName("AsCoin").Set(paramReflectValue) + default: + t.Fatalf("ERROR: unknown field type %q", paramType) + } + + msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) + + msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) + + // Send an authz MsgExec from the authority address. + execMsg := authz.NewMsgExec(signerAddr, []cosmostypes.Msg{msgUpdateParam}) + execResps, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) + + require.Equal(t, 1, len(execResps), "expected exactly one MsgResponse") + + return execResps[0], err +} + // TODO_IN_THIS_COMMIT: godoc func (s *UpdateParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleName string) { t.Helper() From 24e72348a4fb60019871cdc5dc398534fbc722a8 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 10:45:49 +0200 Subject: [PATCH 57/77] Empty commit From 463b47488a4da4c5a716390aae7be636c8c322e9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 16:03:00 +0200 Subject: [PATCH 58/77] chore: cleanup & comment --- tests/integration/params/update_param_test.go | 84 ++-- .../integration/params/update_params_test.go | 74 ++-- testutil/integration/suites/authz.go | 31 +- testutil/integration/suites/update_params.go | 399 ++++++++++-------- 4 files changed, 329 insertions(+), 259 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 7e2d01cbc..6a5b18ce1 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -19,10 +19,11 @@ type MsgUpdateParamSuite struct { } func (s *MsgUpdateParamSuite) SetupTest() { + // Create a fresh integration app for each test. s.NewApp(s.T()) - // Call the SetupTest() of the inherited UpdateParamsSuite. - s.SetupTestAccounts() + // Initialize the test accounts and create authz grants. + s.SetupTestAuthzAccounts() s.SetupTestAuthzGrants() // Allocate an address for unauthorized user. @@ -33,31 +34,29 @@ func (s *MsgUpdateParamSuite) SetupTest() { func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { - // TODO_IN_THIS_COMMIT: improve comment... - // iterate over each field in the current module's MsgUpdateParam... - // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... - defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) - for fieldIdx := 0; fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { - fieldValue := defaultParamsValue.Field(fieldIdx) - fieldName := defaultParamsValue.Type().Field(fieldIdx).Name - fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() - if fieldType == "" { - fieldType = defaultParamsValue.Type().Field(fieldIdx).Type.Elem().Name() - } + moduleCfg := suites.ModuleParamConfigMap[moduleName] + + // Iterate over each field in the current module's MsgUpdateParam, for each + // field, send a new MsgUpdateParam which would update the corresponding param + // to that field's value. + validParamsValue := reflect.ValueOf(moduleCfg.ValidParams) + for fieldIdx := 0; fieldIdx < validParamsValue.NumField(); fieldIdx++ { + fieldValue := validParamsValue.Field(fieldIdx) + fieldName := validParamsValue.Type().Field(fieldIdx).Name testName := fmt.Sprintf("%s_%s", moduleName, fieldName) s.T().Run(testName, func(t *testing.T) { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - updateParamResAny, err := s.RunUpdateParamAsSigner(t, + updateResBz, err := s.RunUpdateParamAsSigner(t, moduleName, fieldName, fieldValue.Interface(), unauthorizedAddr, ) require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) - require.Nil(t, updateParamResAny) + require.Nil(t, updateResBz) }) } } @@ -65,17 +64,15 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { - // TODO_IN_THIS_COMMIT: improve comment... - // iterate over each field in the current module's MsgUpdateParam... - // for each field, send a new MsgUpdateParam populated with the corresopnding field from that module's "validParams" struct... - defaultParamsValue := reflect.ValueOf(suites.DefaultParamsByModule[moduleName]) - for fieldIdx := 0; fieldIdx < defaultParamsValue.NumField(); fieldIdx++ { - fieldValue := defaultParamsValue.Field(fieldIdx) - fieldName := defaultParamsValue.Type().Field(fieldIdx).Name - fieldType := defaultParamsValue.Type().Field(fieldIdx).Type.Name() - if fieldType == "" { - fieldType = defaultParamsValue.Type().Field(fieldIdx).Type.Elem().Name() - } + moduleCfg := suites.ModuleParamConfigMap[moduleName] + + // Iterate over each field in the current module's MsgUpdateParam, for each + // field, send a new MsgUpdateParam which would update the corresponding param + // to that field's value. + validParamsValue := reflect.ValueOf(moduleCfg.ValidParams) + for fieldIdx := 0; fieldIdx < validParamsValue.NumField(); fieldIdx++ { + fieldExpectedValue := validParamsValue.Field(fieldIdx) + fieldName := validParamsValue.Type().Field(fieldIdx).Name testName := fmt.Sprintf("%s_%s", moduleName, fieldName) s.T().Run(testName, func(t *testing.T) { @@ -86,27 +83,38 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - updateParamResAny, err := s.RunUpdateParamAsSigner(t, + updateResBz, err := s.RunUpdateParam(t, moduleName, fieldName, - fieldValue.Interface(), - suites.AuthorizedAddr, + fieldExpectedValue.Interface(), ) require.NoError(t, err) - require.NotNil(t, updateParamResAny) + require.NotNil(t, updateResBz) + + // TODO_TECHDEBT / TODO_TEST: It seems like the response objects are encoded in + // an unexpected way. It's unclear whether this is the result of being + // executed via authz. Looking at the code, it seems like authz utilizes the + // sdk.Result#Data field of the result which is returned from the message handler. + // These result byte slices are accumulated for each message in the MsgExec and + // set on the MsgExecResponse#Results field. + // + //I would've expected the following to work, but it does not: + // + // updateResValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParamResponse)) + // // NB: using proto.Unmarshal here because authz seems to use + // // proto.Marshal to serialize each message response. + // err = proto.Unmarshal(updateResBz, updateResValue.Interface().(cosmostypes.Msg)) + // require.NoError(t, err) + // updateResParamValue := updateResValue.Elem().FieldByName("Params").Elem().FieldByName(fieldName) + // require.Equal(t, fieldExpectedValue.Interface(), updateResParamValue.Interface()) // Query for the module's params. params, err := s.QueryModuleParams(t, moduleName) require.NoError(t, err) - // Assert that the module's params are updated. - // TODO_IN_THIS_COMMIT: update... - _ = params - //require.True(t, - // reflect.DeepEqual(params, expectedParamValue.Interface()), - // "expected:\n%+v\nto deeply equal:\n%+v", - // params, suites.ValidSharedParams, - //) + paramsValue := reflect.ValueOf(params) + paramValue := paramsValue.FieldByName(fieldName) + require.Equal(t, fieldExpectedValue.Interface(), paramValue.Interface()) }) } } diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index 17010347f..00130cc0e 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -21,8 +21,12 @@ type MsgUpdateParamsSuite struct { } func (s *MsgUpdateParamsSuite) SetupTest() { - // Call the SetupTest() of the inherited UpdateParamsSuite. - s.UpdateParamsSuite.SetupTest() + // Create a fresh integration app for each test. + s.NewApp(s.T()) + + // Initialize the test accounts and create authz grants. + s.SetupTestAuthzAccounts() + s.SetupTestAuthzGrants() // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() @@ -32,62 +36,54 @@ func (s *MsgUpdateParamsSuite) SetupTest() { func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { for _, moduleName := range s.GetPoktrollModuleNames() { + moduleCfg := suites.ModuleParamConfigMap[moduleName] + s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - msgIface, isMsgTypeFound := suites.MsgUpdateParamsByModule[moduleName] - require.Truef(t, isMsgTypeFound, "unknown message type for module %q", moduleName) - - msgValue := reflect.ValueOf(msgIface) - msgType := msgValue.Type() - - // Copy the message and set the authority field. - msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue) - msgValueCopy.Elem(). + // Construct a new MsgUpdateParams and set its authority and params fields. + expectedParams := moduleCfg.ValidParams + msgUpdateParamsValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParams)) + msgUpdateParamsValue.Elem(). FieldByName("Authority"). SetString(suites.AuthorityAddr.String()) - msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) + msgUpdateParamsValue.Elem(). + FieldByName("Params"). + Set(reflect.ValueOf(expectedParams)) - // Send an authz MsgExec from an unauthorized address. - execMsg := authz.NewMsgExec(unauthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - anyRes, err := s.GetApp().RunMsg(t, &execMsg) + msgUpdateParams := msgUpdateParamsValue.Interface().(cosmostypes.Msg) + updateRes, err := s.RunUpdateParamsAsSigner(t, msgUpdateParams, unauthorizedAddr) require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) - require.Nil(t, anyRes) + require.Nil(t, updateRes) }) } } func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { for _, moduleName := range s.GetPoktrollModuleNames() { + moduleCfg := suites.ModuleParamConfigMap[moduleName] + s.T().Run(moduleName, func(t *testing.T) { // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) - msgIface, isMsgTypeFound := suites.MsgUpdateParamsByModule[moduleName] - require.Truef(t, isMsgTypeFound, "unknown message type for module %q", moduleName) - - msgValue := reflect.ValueOf(msgIface) - msgType := msgValue.Type() - - // Copy the message and set the authority field. - msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue) - msgValueCopy.Elem(). + // Construct a new MsgUpdateParams and set its authority and params fields. + expectedParams := moduleCfg.ValidParams + msgUpdateParamsValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParams)) + msgUpdateParamsValue.Elem(). FieldByName("Authority"). SetString(suites.AuthorityAddr.String()) - expectedParamsValue := msgValueCopy.Elem().FieldByName("Params") - - msgUpdateParams := msgValueCopy.Interface().(cosmostypes.Msg) - - // Send an authz MsgExec from an unauthorized address. - execMsg := authz.NewMsgExec(suites.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) - s.RunAuthzExecMsg(t, suites.AuthorizedAddr, &execMsg) - - anyRes, err := s.GetApp().RunMsg(t, &execMsg) + msgUpdateParamsValue.Elem(). + FieldByName("Params"). + Set(reflect.ValueOf(expectedParams)) + //expectedParams := reflect.ValueOf(moduleCfg.ValidParams).FieldByName("Params") + + // TODO_IMPROVE: add a Params field to the MsgUpdateParamsResponse + // and assert that it reflects the updated params. + msgUpdateParams := msgUpdateParamsValue.Interface().(cosmostypes.Msg) + _, err := s.RunUpdateParams(t, msgUpdateParams) require.NoError(t, err) - require.NotNil(t, anyRes) // Query for the module's params. params, err := s.QueryModuleParams(t, moduleName) @@ -95,9 +91,9 @@ func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { // Assert that the module's params are updated. require.True(t, - reflect.DeepEqual(params, expectedParamsValue.Interface()), + reflect.DeepEqual(expectedParams, params), "expected:\n%+v\nto deeply equal:\n%+v", - params, suites.ValidSharedParams, + expectedParams, params, ) }) } diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index bd6064324..4af6e24c4 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -8,7 +8,6 @@ import ( "time" cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" ) @@ -19,17 +18,19 @@ const ( poktrollMsgTypeFormat = "/poktroll.%s.%s" ) -var ( - defaultAuthzGrantExpiration = time.Now().Add(time.Hour) -) +var defaultAuthzGrantExpiration = time.Now().Add(time.Hour) -// TODO_IN_THIS_COMMIT: move... +// AuthzIntegrationSuite is an integration test suite that provides helper functions for +// running authz grant and exec messages. It is intended to be embedded in other integration +// test suites which are dependent on authz. type AuthzIntegrationSuite struct { BaseIntegrationSuite } -// TODO_IN_THIS_COMMIT: godoc -func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( +// RunAuthzGrantMsgForPoktrollModules creates an on-chain authz grant for the given +// granter and grantee addresses for the specified message name in each of the poktroll +// modules present in the integration app. +func (s *AuthzIntegrationSuite) RunAuthzGrantMsgForPoktrollModules( t *testing.T, granterAddr, granteeAddr cosmostypes.AccAddress, msgName string, @@ -37,9 +38,7 @@ func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( ) { t.Helper() - var ( - foundModuleGrants = make(map[string]int) - ) + var foundModuleGrants = make(map[string]int) for _, moduleName := range moduleNames { msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) authorization := &authz.GenericAuthorization{Msg: msgType} @@ -67,7 +66,8 @@ func (s *AuthzIntegrationSuite) SendAuthzGrantMsgForPoktrollModules( } } -// TODO_IN_THIS_COMMIT: godoc +// RunAuthzGrantMsg creates an on-chain authz grant for the given granter and +// grantee addresses and authorization object. func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( t *testing.T, granterAddr, @@ -84,15 +84,16 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( require.NotNil(t, grantResAny) } -// TODO_IN_THIS_COMMIT: godoc +// RunAuthzExecMsg executes the given messag(es) using authz. It assumes that an +// authorization exists for which signerAdder is the grantee. func (s *AuthzIntegrationSuite) RunAuthzExecMsg( t *testing.T, - fromAddr cosmostypes.AccAddress, + signerAddr cosmostypes.AccAddress, msgs ...cosmostypes.Msg, -) (msgRespsBz []tx.MsgResponse, err error) { +) (msgRespsBz [][]byte, err error) { t.Helper() - execMsg := authz.NewMsgExec(fromAddr, msgs) + execMsg := authz.NewMsgExec(signerAddr, msgs) execResAny, err := s.GetApp().RunMsg(s.T(), &execMsg) if err != nil { return nil, err diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index de2439826..a25856180 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -8,7 +8,6 @@ import ( "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" @@ -24,7 +23,8 @@ import ( tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -// TODO_IN_THIS_COMMIT: godoc... +// ParamType is a type alias for a module parameter type. It is the string that +// is returned when calling reflect.Value#Type()#Name() on a module parameter. type ParamType = string const ( @@ -41,177 +41,186 @@ const ( MsgUpdateParamName = "MsgUpdateParam" ) +// ModuleParamConfig holds a set of valid parameters and type information for a +// given module. It uses any instead of cosmostypes.Msg to mitigate easy mistakes +// that could result from using pointers instead (unintended mutation). It is still +// possible to mutate this global variable; however, it is less likely to happen +// unintentionally. +type ModuleParamConfig struct { + ValidParams any + MsgUpdateParams any + MsgUpdateParamsResponse any + MsgUpdateParam any + MsgUpdateParamResponse any + ParamTypes map[ParamType]any + QueryParamsRequest any + QueryParamsResponse any + DefaultParams any + NewParamClientFn any +} + var ( + // AuthorityAddr is the cosmos account address of the authority for the integration app. AuthorityAddr cosmostypes.AccAddress - + // AuthorizedAddr is the cosmos account address which is the grantee of authz + // grants for parameter update messages. AuthorizedAddr cosmostypes.AccAddress - ValidSharedParams = sharedtypes.Params{ - NumBlocksPerSession: 5, - GracePeriodEndOffsetBlocks: 2, - ClaimWindowOpenOffsetBlocks: 5, - ClaimWindowCloseOffsetBlocks: 5, - ProofWindowOpenOffsetBlocks: 2, - ProofWindowCloseOffsetBlocks: 5, - SupplierUnbondingPeriodSessions: 9, - ApplicationUnbondingPeriodSessions: 9, - ComputeUnitsToTokensMultiplier: 420, - } - - ValidSessionParams = sessiontypes.Params{} - - ValidServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000001) - ValidServiceParams = servicetypes.Params{ - AddServiceFee: &ValidServiceFeeCoin, - } - - ValidApplicationParams = apptypes.Params{ - MaxDelegatedGateways: 999, - } - - ValidGatewayParams = gatewaytypes.Params{} - ValidSupplierParams = suppliertypes.Params{} - ValidTokenomicsParams = tokenomicstypes.Params{} - - ValidMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) - ValidSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) - ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") - + ValidServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000001) + ValidMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) + ValidSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) + ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") ValidProofRequirementThresholdCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100) - ValidProofParams = prooftypes.Params{ - RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, - ProofRequestProbability: 0.1, - ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, - ProofMissingPenalty: &ValidMissingPenaltyCoin, - ProofSubmissionFee: &ValidSubmissionFeeCoin, - } - // TODO_IN_THIS_COMMIT: godoc... - // NB: Authority fields are intentionally omitted and expected to be added - // to a **copy** of the respective message by the test. - MsgUpdateParamsByModule = map[string]any{ - sharedtypes.ModuleName: sharedtypes.MsgUpdateParams{ - Params: ValidSharedParams, - }, - sessiontypes.ModuleName: sessiontypes.MsgUpdateParams{ - Params: ValidSessionParams, - }, - servicetypes.ModuleName: servicetypes.MsgUpdateParams{ - Params: ValidServiceParams, + // ModuleParamConfigMap is a map of module names to their respective parameter + // configurations. It is used by the UpdateParamsSuite, mostly via reflection, + // to construct and send parameter update messages and assert on their results. + ModuleParamConfigMap = map[string]ModuleParamConfig{ + sharedtypes.ModuleName: { + ValidParams: sharedtypes.Params{ + NumBlocksPerSession: 12, + GracePeriodEndOffsetBlocks: 0, + ClaimWindowOpenOffsetBlocks: 2, + ClaimWindowCloseOffsetBlocks: 3, + ProofWindowOpenOffsetBlocks: 1, + ProofWindowCloseOffsetBlocks: 3, + SupplierUnbondingPeriodSessions: 9, + ApplicationUnbondingPeriodSessions: 9, + ComputeUnitsToTokensMultiplier: 420, + }, + MsgUpdateParams: sharedtypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: sharedtypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: sharedtypes.MsgUpdateParam{}, + MsgUpdateParamResponse: sharedtypes.MsgUpdateParamResponse{}, + ParamTypes: map[ParamType]any{ + ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, + }, + QueryParamsRequest: sharedtypes.QueryParamsRequest{}, + QueryParamsResponse: sharedtypes.QueryParamsResponse{}, + DefaultParams: sharedtypes.DefaultParams(), + NewParamClientFn: sharedtypes.NewQueryClient, }, - apptypes.ModuleName: apptypes.MsgUpdateParams{ - Params: ValidApplicationParams, + sessiontypes.ModuleName: { + ValidParams: sessiontypes.Params{}, + MsgUpdateParams: sessiontypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: sessiontypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: sessiontypes.QueryParamsRequest{}, + QueryParamsResponse: sessiontypes.QueryParamsResponse{}, + DefaultParams: sessiontypes.DefaultParams(), + NewParamClientFn: sessiontypes.NewQueryClient, }, - gatewaytypes.ModuleName: gatewaytypes.MsgUpdateParams{ - Params: ValidGatewayParams, + servicetypes.ModuleName: { + ValidParams: servicetypes.Params{ + AddServiceFee: &ValidServiceFeeCoin, + }, + MsgUpdateParams: servicetypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: servicetypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: servicetypes.MsgUpdateParam{}, + MsgUpdateParamResponse: servicetypes.MsgUpdateParamResponse{}, + ParamTypes: map[ParamType]any{ + ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, + }, + QueryParamsRequest: servicetypes.QueryParamsRequest{}, + QueryParamsResponse: servicetypes.QueryParamsResponse{}, + DefaultParams: servicetypes.DefaultParams(), + NewParamClientFn: servicetypes.NewQueryClient, }, - suppliertypes.ModuleName: suppliertypes.MsgUpdateParams{ - Params: ValidSupplierParams, + apptypes.ModuleName: { + ValidParams: apptypes.Params{ + MaxDelegatedGateways: 999, + }, + MsgUpdateParams: apptypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: apptypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: apptypes.QueryParamsRequest{}, + QueryParamsResponse: apptypes.QueryParamsResponse{}, + DefaultParams: apptypes.DefaultParams(), + NewParamClientFn: apptypes.NewQueryClient, }, - prooftypes.ModuleName: prooftypes.MsgUpdateParams{ - Params: ValidProofParams, + gatewaytypes.ModuleName: { + ValidParams: gatewaytypes.Params{}, + MsgUpdateParams: gatewaytypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: gatewaytypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: gatewaytypes.QueryParamsRequest{}, + QueryParamsResponse: gatewaytypes.QueryParamsResponse{}, + DefaultParams: gatewaytypes.DefaultParams(), + NewParamClientFn: gatewaytypes.NewQueryClient, }, - tokenomicstypes.ModuleName: tokenomicstypes.MsgUpdateParams{ - Params: ValidTokenomicsParams, - }, - } - - // TODO_IN_THIS_COMMIT: godoc... - MsgUpdateParamByModule = map[string]any{ - sharedtypes.ModuleName: sharedtypes.MsgUpdateParam{}, - servicetypes.ModuleName: servicetypes.MsgUpdateParam{}, - prooftypes.ModuleName: prooftypes.MsgUpdateParam{}, - tokenomicstypes.ModuleName: tokenomicstypes.MsgUpdateParam{}, - //sessiontypes.ModuleName: sessiontypes.MsgUpdateParam{}, - //apptypes.ModuleName: apptypes.MsgUpdateParam{}, - //gatewaytypes.ModuleName: gatewaytypes.MsgUpdateParam{}, - //suppliertypes.ModuleName: suppliertypes.MsgUpdateParam{}, - } - - // TODO_IN_THIS_COMMIT: ... each module defines its own MsgUpdateParam_As* structs - // ... not every module has all types... - MsgUpdateParamTypesByModuleName = map[string]map[ParamType]any{ - sharedtypes.ModuleName: { - ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, - ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, - }, - servicetypes.ModuleName: { - ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, + suppliertypes.ModuleName: { + ValidParams: suppliertypes.Params{}, + MsgUpdateParams: suppliertypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: suppliertypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: suppliertypes.QueryParamsRequest{}, + QueryParamsResponse: suppliertypes.QueryParamsResponse{}, + DefaultParams: suppliertypes.DefaultParams(), + NewParamClientFn: suppliertypes.NewQueryClient, }, prooftypes.ModuleName: { - ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, - ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, - ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, - ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, + ValidParams: prooftypes.Params{ + RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, + ProofRequestProbability: 0.1, + ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, + ProofMissingPenalty: &ValidMissingPenaltyCoin, + ProofSubmissionFee: &ValidSubmissionFeeCoin, + }, + MsgUpdateParams: prooftypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: prooftypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: prooftypes.MsgUpdateParam{}, + MsgUpdateParamResponse: prooftypes.MsgUpdateParamResponse{}, + ParamTypes: map[ParamType]any{ + ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, + ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, + ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, + }, + QueryParamsRequest: prooftypes.QueryParamsRequest{}, + QueryParamsResponse: prooftypes.QueryParamsResponse{}, + DefaultParams: prooftypes.DefaultParams(), + NewParamClientFn: prooftypes.NewQueryClient, }, tokenomicstypes.ModuleName: { - ParamTypeUint64: tokenomicstypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: tokenomicstypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: tokenomicstypes.MsgUpdateParam_AsString{}, - ParamTypeBytes: tokenomicstypes.MsgUpdateParam_AsBytes{}, + ValidParams: tokenomicstypes.Params{}, + MsgUpdateParams: tokenomicstypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: tokenomicstypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: tokenomicstypes.QueryParamsRequest{}, + QueryParamsResponse: tokenomicstypes.QueryParamsResponse{}, + DefaultParams: tokenomicstypes.DefaultParams(), + NewParamClientFn: tokenomicstypes.NewQueryClient, }, } - // TODO_IN_THIS_COMMIT: godoc... + // MsgUpdateParamEnabledModuleNames is a list of module names which support + // individual parameter updates (i.e. MsgUpdateParam). It is initialized in + // init(). MsgUpdateParamEnabledModuleNames []string - // TODO_IN_THIS_COMMIT: godoc... - NewParamClientFns = map[string]any{ - sharedtypes.ModuleName: sharedtypes.NewQueryClient, - sessiontypes.ModuleName: sessiontypes.NewQueryClient, - servicetypes.ModuleName: servicetypes.NewQueryClient, - apptypes.ModuleName: apptypes.NewQueryClient, - gatewaytypes.ModuleName: gatewaytypes.NewQueryClient, - suppliertypes.ModuleName: suppliertypes.NewQueryClient, - prooftypes.ModuleName: prooftypes.NewQueryClient, - tokenomicstypes.ModuleName: tokenomicstypes.NewQueryClient, - } - - // TODO_IN_THIS_COMMIT: godoc... - QueryParamsRequestByModule = map[string]any{ - sharedtypes.ModuleName: sharedtypes.QueryParamsRequest{}, - sessiontypes.ModuleName: sessiontypes.QueryParamsRequest{}, - servicetypes.ModuleName: servicetypes.QueryParamsRequest{}, - apptypes.ModuleName: apptypes.QueryParamsRequest{}, - gatewaytypes.ModuleName: gatewaytypes.QueryParamsRequest{}, - suppliertypes.ModuleName: suppliertypes.QueryParamsRequest{}, - prooftypes.ModuleName: prooftypes.QueryParamsRequest{}, - tokenomicstypes.ModuleName: tokenomicstypes.QueryParamsRequest{}, - } - - // TODO_IN_THIS_COMMIT: godoc... - DefaultParamsByModule = map[string]any{ - sharedtypes.ModuleName: sharedtypes.DefaultParams(), - sessiontypes.ModuleName: sessiontypes.DefaultParams(), - servicetypes.ModuleName: servicetypes.DefaultParams(), - apptypes.ModuleName: apptypes.DefaultParams(), - gatewaytypes.ModuleName: gatewaytypes.DefaultParams(), - suppliertypes.ModuleName: suppliertypes.DefaultParams(), - prooftypes.ModuleName: prooftypes.DefaultParams(), - tokenomicstypes.ModuleName: tokenomicstypes.DefaultParams(), - } - _ IntegrationSuite = (*UpdateParamsSuite)(nil) ) func init() { - // TODO_IN_THIS_COMMIT: godoc... - for moduleName := range MsgUpdateParamByModule { - MsgUpdateParamEnabledModuleNames = append(MsgUpdateParamEnabledModuleNames, moduleName) + for moduleName, moduleThing := range ModuleParamConfigMap { + if moduleThing.MsgUpdateParam != nil { + MsgUpdateParamEnabledModuleNames = append(MsgUpdateParamEnabledModuleNames, moduleName) + } } } +// UpdateParamsSuite is an integration test suite that provides helper functions for +// running parameter update messages. It is intended to be embedded in other integration +// test suites which are dependent on parameter updates. type UpdateParamsSuite struct { AuthzIntegrationSuite } -// TODO_IN_THIS_COMMIT: godoc -// SetupTestAccounts ... expected to be called after s.NewApp() ... accounts ... and module names... -func (s *UpdateParamsSuite) SetupTestAccounts() { +// SetupTestAuthzAccounts sets AuthorityAddr for the suite by getting the authority +// from the integration app. It also assigns a new pre-generated identity to be used +// as the AuthorizedAddr for the suite. It is expected to be called after s.NewApp() +// as it depends on the integration app and its pre-generated account iterator. +func (s *UpdateParamsSuite) SetupTestAuthzAccounts() { // Set the authority, authorized, and unauthorized addresses. AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) @@ -220,11 +229,12 @@ func (s *UpdateParamsSuite) SetupTestAccounts() { AuthorizedAddr = nextAcct.Address } -// TODO_IN_THIS_COMMIT: godoc -// SetupTestAuthzGrants ... expected to be called after s.NewApp() ... authority and authorized addresses... +// SetupTestAuthzGrants creates on-chain authz grants for the MsgUpdateUpdateParam and +// MsgUpdateParams message for each module. It is expected to be called after s.NewApp() +// as it depends on the authority and authorized addresses having been set. func (s *UpdateParamsSuite) SetupTestAuthzGrants() { // Create authz grants for all poktroll modules' MsgUpdateParams messages. - s.SendAuthzGrantMsgForPoktrollModules(s.T(), + s.RunAuthzGrantMsgForPoktrollModules(s.T(), AuthorityAddr, AuthorizedAddr, MsgUpdateParamsName, @@ -232,20 +242,61 @@ func (s *UpdateParamsSuite) SetupTestAuthzGrants() { ) // Create authz grants for all poktroll modules' MsgUpdateParam messages. - s.SendAuthzGrantMsgForPoktrollModules(s.T(), + s.RunAuthzGrantMsgForPoktrollModules(s.T(), AuthorityAddr, AuthorizedAddr, MsgUpdateParamName, + // NB: only modules with params are expected to support MsgUpdateParam. MsgUpdateParamEnabledModuleNames..., ) } +// RunUpdateParams runs the given MsgUpdateParams message via an authz exec as the +// AuthorizedAddr and returns the response bytes and error. It is expected to be called +// after s.SetupTestAuthzGrants() as it depends on an on-chain authz grant to AuthorizedAddr +// for MsgUpdateParams for the given module. +func (s *UpdateParamsSuite) RunUpdateParams( + t *testing.T, + msgUpdateParams cosmostypes.Msg, +) (msgResponseBz []byte, err error) { + t.Helper() + + return s.RunUpdateParamsAsSigner(t, msgUpdateParams, AuthorizedAddr) +} + +// RunUpdateParamsAsSigner runs the given MsgUpdateParams message via an authz exec +// as signerAddr and returns the response bytes and error. It depends on an on-chain +// authz grant to signerAddr for MsgUpdateParams for the given module. +func (s *UpdateParamsSuite) RunUpdateParamsAsSigner( + t *testing.T, + msgUpdateParams cosmostypes.Msg, + signerAddr cosmostypes.AccAddress, +) (msgResponseBz []byte, err error) { + t.Helper() + + // Send an authz MsgExec from an unauthorized address. + execMsg := authz.NewMsgExec(AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) + msgRespsBz, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) + if err != nil { + return nil, err + } + + require.Equal(t, 1, len(msgRespsBz), "expected exactly 1 message response") + return msgRespsBz[0], err +} + +// RunUpdateParam constructs and runs an MsgUpdateParam message via an authz exec +// as the AuthorizedAddr for the given module, parameter name, and value. It returns +// the response bytes and error. It is expected to be called after s.SetupTestAuthzGrants() +// as it depends on an on-chain authz grant to AuthorizedAddr for MsgUpdateParam for the given module. func (s *UpdateParamsSuite) RunUpdateParam( t *testing.T, moduleName string, paramName string, paramValue any, -) (tx.MsgResponse, error) { +) (msgResponseBz []byte, err error) { + t.Helper() + return s.RunUpdateParamAsSigner(t, moduleName, paramName, @@ -254,35 +305,43 @@ func (s *UpdateParamsSuite) RunUpdateParam( ) } +// RunUpdateParamAsSigner constructs and runs an MsgUpdateParam message via an authz exec +// as the given signerAddr for the given module, parameter name, and value. It returns +// the response bytes and error. It depends on an on-chain authz grant to signerAddr for +// MsgUpdateParam for the given module. func (s *UpdateParamsSuite) RunUpdateParamAsSigner( t *testing.T, moduleName string, paramName string, paramValue any, signerAddr cosmostypes.AccAddress, -) (tx.MsgResponse, error) { +) (msgResponseBz []byte, err error) { + t.Helper() + + moduleCfg := ModuleParamConfigMap[moduleName] + paramReflectValue := reflect.ValueOf(paramValue) paramType := paramReflectValue.Type().Name() - if paramReflectValue.Kind() == reflect.Pointer { + switch paramReflectValue.Kind() { + case reflect.Pointer: paramType = paramReflectValue.Elem().Type().Name() + case reflect.Slice: + paramType = paramReflectValue.Type().Elem().Name() } - msgIface, isMsgTypeFound := MsgUpdateParamByModule[moduleName] - require.Truef(t, isMsgTypeFound, "unknown message type for module %q: %T", moduleName, msgIface) - + msgIface := moduleCfg.MsgUpdateParam msgValue := reflect.ValueOf(msgIface) msgType := msgValue.Type() // Copy the message and set the authority field. - msgValueCopy := reflect.New(msgType) - msgValueCopy.Elem().Set(msgValue) - msgValueCopy.Elem(). + msgUpdateParamValue := reflect.New(msgType) + msgUpdateParamValue.Elem(). FieldByName("Authority"). SetString(AuthorityAddr.String()) - msgValueCopy.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(paramName)) + msgUpdateParamValue.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(paramName)) - msgAsTypeStruct := MsgUpdateParamTypesByModuleName[moduleName][paramType] + msgAsTypeStruct := moduleCfg.ParamTypes[paramType] msgAsTypeType := reflect.TypeOf(msgAsTypeStruct) msgAsTypeValue := reflect.New(msgAsTypeType) switch paramType { @@ -303,43 +362,49 @@ func (s *UpdateParamsSuite) RunUpdateParamAsSigner( t.Fatalf("ERROR: unknown field type %q", paramType) } - msgValueCopy.Elem().FieldByName("AsType").Set(msgAsTypeValue) + msgUpdateParamValue.Elem().FieldByName("AsType").Set(msgAsTypeValue) - msgUpdateParam := msgValueCopy.Interface().(cosmostypes.Msg) + msgUpdateParam := msgUpdateParamValue.Interface().(cosmostypes.Msg) // Send an authz MsgExec from the authority address. execMsg := authz.NewMsgExec(signerAddr, []cosmostypes.Msg{msgUpdateParam}) execResps, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) + if err != nil { + return nil, err + } - require.Equal(t, 1, len(execResps), "expected exactly one MsgResponse") - + require.Equal(t, 1, len(execResps), "expected exactly 1 message response") return execResps[0], err } -// TODO_IN_THIS_COMMIT: godoc +// RequireModuleHasDefaultParams asserts that the given module's parameters are set +// to their default values. func (s *UpdateParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleName string) { t.Helper() params, err := s.QueryModuleParams(t, moduleName) require.NoError(t, err) - defaultParams := DefaultParamsByModule[moduleName] - require.EqualValues(t, defaultParams, params) + moduleCfg := ModuleParamConfigMap[moduleName] + require.EqualValues(t, moduleCfg.DefaultParams, params) } -// TODO_IN_THIS_COMMIT: godoc +// QueryModuleParams queries the given module's parameters and returns them. It is +// expected to be called after s.NewApp() as it depends on the app's query helper. func (s *UpdateParamsSuite) QueryModuleParams(t *testing.T, moduleName string) (params any, err error) { t.Helper() + moduleCfg := ModuleParamConfigMap[moduleName] + // Construct a new param client. - newParamClientFn := reflect.ValueOf(NewParamClientFns[moduleName]) + newParamClientFn := reflect.ValueOf(moduleCfg.NewParamClientFn) newParamClientFnArgs := []reflect.Value{ reflect.ValueOf(s.GetApp().QueryHelper()), } paramClient := newParamClientFn.Call(newParamClientFnArgs)[0] // Query for the module's params. - paramsQueryReqValue := reflect.New(reflect.TypeOf(QueryParamsRequestByModule[moduleName])) + paramsQueryReqValue := reflect.New(reflect.TypeOf(moduleCfg.QueryParamsRequest)) callParamsArgs := []reflect.Value{ reflect.ValueOf(s.GetApp().GetSdkCtx()), paramsQueryReqValue, From a70a084cf9156126960073a3e915c72f230b4f7b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 16:04:34 +0200 Subject: [PATCH 59/77] chore: delete E2E params tests --- e2e/tests/update_params.feature | 95 --------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 e2e/tests/update_params.feature diff --git a/e2e/tests/update_params.feature b/e2e/tests/update_params.feature deleted file mode 100644 index a84cad537..000000000 --- a/e2e/tests/update_params.feature +++ /dev/null @@ -1,95 +0,0 @@ -Feature: Params Namespace - - # Why do we have this scenario? - # During development, if one of these tests fails along the way, we get into a - # state where LocalNet is inconsistent w/ expectations and needs to be restarted. - # Rather than using a `Background` set of commands that rerun on every scenario, - # we add one to prepare for everything downstream. - Scenario: All params are reset to their default values - Given the user has the pocketd binary installed - And an authz grant from the "gov" "module" account to the "pnf" "user" account for each module MsgUpdateParam message exists - Then all module params are reset to their default values - - # NB: If you are reading this and the proof module has parameters - # that are not being updated in this test, please update the test. - Scenario: An authorized user updates all "proof" module params - Given the user has the pocketd binary installed - And all "proof" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.proof.MsgUpdateParams" message exists - When the "pnf" account sends an authz exec message to update all "proof" module params - | name | value | type | - | relay_difficulty_target_hash | 00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff | bytes | - | proof_request_probability | 0.1 | float | - | proof_requirement_threshold | 100 | coin | - | proof_missing_penalty | 500 | coin | - | proof_submission_fee | 5000000 | coin | - Then all "proof" module params should be updated - - # NB: If you are reading this and the proof module has parameters - # that are not being updated in this test, please update the test. - Scenario: An authorized user updates all "shared" module params - Given the user has the pocketd binary installed - And all "shared" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.shared.MsgUpdateParams" message exists - When the "pnf" account sends an authz exec message to update all "shared" module params - | name | value | type | - | num_blocks_per_session | 5 | int64 | - | grace_period_end_offset_blocks | 2 | int64 | - | claim_window_open_offset_blocks | 2 | int64 | - | claim_window_close_offset_blocks | 3 | int64 | - | proof_window_open_offset_blocks | 1 | int64 | - | proof_window_close_offset_blocks | 5 | int64 | - | supplier_unbonding_period_sessions | 5 | int64 | - | application_unbonding_period_sessions | 5 | int64 | - | compute_units_to_tokens_multiplier | 666 | int64 | - Then all "shared" module params should be updated - - - # NB: If you are reading this and any module has parameters that - # are not being updated in this test, please update the test. - Scenario: An authorized user updates all "service" module params - Given the user has the pocketd binary installed - And all "service" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.service.MsgUpdateParams" message exists - When the "pnf" account sends an authz exec message to update all "service" module params - | name | value | type | - | add_service_fee | 1000000001 | coin | - Then all "service" module params should be updated - - # NB: If you are reading this and any module has parameters that - # are not being updated in this test, please update the test. - Scenario Outline: An authorized user updates individual module params - Given the user has the pocketd binary installed - And all "" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "" message exists - When the "pnf" account sends an authz exec message to update "" the module param - | name | value | type | - | | | | - Then the "" module param "" should be updated - - Examples: - | module | message_type | param_name | param_value | param_type | - | proof | /poktroll.proof.MsgUpdateParam | min_relay_difficulty_bits | 12 | int64 | - | proof | /poktroll.proof.MsgUpdateParam | proof_request_probability | 0.1 | float | - | proof | /poktroll.proof.MsgUpdateParam | proof_requirement_threshold | 100 | coin | - | proof | /poktroll.proof.MsgUpdateParam | proof_missing_penalty | 500 | coin | - | proof | /poktroll.proof.MsgUpdateParam | proof_submission_fee | 5000000 | coin | - | shared | /poktroll.shared.MsgUpdateParam | num_blocks_per_session | 9 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | grace_period_end_offset_blocks | 0 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | claim_window_open_offset_blocks | 2 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | claim_window_close_offset_blocks | 3 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | proof_window_open_offset_blocks | 1 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | proof_window_close_offset_blocks | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | supplier_unbonding_period_sessions | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | application_unbonding_period_sessions | 5 | int64 | - | shared | /poktroll.shared.MsgUpdateParam | compute_units_to_tokens_multiplier | 68 | int64 | - | service | /poktroll.service.MsgUpdateParam | add_service_fee | 1000000001 | coin | - - Scenario: An unauthorized user cannot update individual module params - Given the user has the pocketd binary installed - And all "proof" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.proof.MsgUpdateParams" message exists - When the "unauthorized" account sends an authz exec message to update "proof" the module param - | name | value | type | - | proof_request_probability | 0.1 | float | - Then the "proof" module param "min_relay_difficulty_bits" should be set to its default value From 21f822b048ab53a8bdef8d05278c3e3c95488fcb Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 16:21:51 +0200 Subject: [PATCH 60/77] fix: add missing steps and update module name for moved param (cherry picked from commit bd2e4ae0d05162f7c6e89b76c2a57e4027641355) --- e2e/tests/0_settlement.feature | 5 ++--- e2e/tests/session.feature | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/e2e/tests/0_settlement.feature b/e2e/tests/0_settlement.feature index 4829c4aa9..2cefdd9c8 100644 --- a/e2e/tests/0_settlement.feature +++ b/e2e/tests/0_settlement.feature @@ -26,10 +26,9 @@ Feature: Tokenomics Namespace | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | And all "proof" module params should be updated - # TODO_IN_THIS_COMMIT: param moved to shared module? - And the "tokenomics" module parameters are set as follows + And the "shared" module parameters are set as follows | compute_units_to_tokens_multiplier | 42 | int64 | - # TODO_IN_THIS_COMMIT: all module params should be updated + And all "shared" module params should be updated When the supplier "supplier1" has serviced a session with "20" relays for service "anvil" for application "app1" # Wait for the Claim & Proof lifecycle And the user should wait for the "proof" module "CreateClaim" Message to be submitted diff --git a/e2e/tests/session.feature b/e2e/tests/session.feature index d695dc5bc..715e7319a 100644 --- a/e2e/tests/session.feature +++ b/e2e/tests/session.feature @@ -12,10 +12,9 @@ Feature: Session Namespace | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | And all "proof" module params should be updated - # TODO_IN_THIS_COMMIT: param moved to shared module? - And the "tokenomics" module parameters are set as follows + And the "shared" module parameters are set as follows | compute_units_to_tokens_multiplier | 42 | int64 | - # TODO_IN_THIS_COMMIT: all module params should be updated + And all "shared" module params should be updated When the supplier "supplier1" has serviced a session with "5" relays for service "anvil" for application "app1" And the user should wait for the "proof" module "CreateClaim" Message to be submitted And the user should wait for the "proof" module "ClaimCreated" tx event to be broadcast From 52003cd6b03ee8c062a995ed164e62621f52c72d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 16:33:41 +0200 Subject: [PATCH 61/77] fixup: HEAD^ --- e2e/tests/0_settlement.feature | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/e2e/tests/0_settlement.feature b/e2e/tests/0_settlement.feature index 2cefdd9c8..a4f84e62c 100644 --- a/e2e/tests/0_settlement.feature +++ b/e2e/tests/0_settlement.feature @@ -61,10 +61,9 @@ Feature: Tokenomics Namespace | proof_missing_penalty | 320 | coin | | proof_submission_fee | 1000000 | coin | And all "proof" module params should be updated - # TODO_IN_THIS_COMMIT: param moved to shared module? - And the "tokenomics" module parameters are set as follows + And the "shared" module parameters are set as follows | compute_units_to_tokens_multiplier | 42 | int64 | - # TODO_IN_THIS_COMMIT: all module params should be updated + And all "shared" module params should be updated # Start servicing When the supplier "supplier1" has serviced a session with "10" relays for service "anvil" for application "app1" # Wait for the Claim & Proof lifecycle From 52902d93c651de554cb1144a3e42bcc8851b7224 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 16:52:44 +0200 Subject: [PATCH 62/77] chore: self-review improvements --- testutil/integration/suites/base_test.go | 2 -- testutil/integration/suites/interface.go | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index caa2f3fc0..b3f87f7ec 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -17,8 +17,6 @@ import ( gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" ) -var gatewayStakeAmount = int64(1000) - type BaseIntegrationSuiteTestSuite struct { BaseIntegrationSuite } diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index c09b2cf28..d2d47f96f 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -35,8 +35,9 @@ type IntegrationSuite interface { // of the integration app. GetBankQueryClient() banktypes.QueryClient - // FilterLatestEvents returns the most recent events in the event manager that - // match the given matchFn. + // FilterEvents returns the events from the event manager which match the given + // matchFn. Events are returned in reverse order, i.e. the most recent event is + // first. FilterEvents(matchFn func(*cosmostypes.Event) bool) []*cosmostypes.Event // LatestMatchingEvent returns the most recent event in the event manager that // matches the given matchFn. From afd9a6071f280922aaa81a0ea8ca07869bb258e1 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 20:50:25 +0200 Subject: [PATCH 63/77] revert: unintentional unfactoring --- e2e/tests/update_params_test.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 78b9b5453..63f3b4c01 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -217,16 +217,9 @@ func (s *suite) AllModuleParamsShouldBeSetToTheirDefaultValues(moduleName string // TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams sends an authz exec // message to update all module params for the given module. func (s *suite) TheAccountSendsAnAuthzExecMessageToUpdateAllModuleParams(accountName, moduleName string, table gocuke.DataTable) { - // NB: set s#moduleParamsMap for later assertion. - s.expectedModuleParams = moduleParamsMap{ - moduleName: s.parseParamsTable(table), - } - - // Use the map of params to populate a tx JSON template & write it to a file. - txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) + paramsTableMap := s.parseParamsTable(table) - // Send the authz exec tx to update all module params. - s.sendAuthzExecTx(accountName, txJSONFile.Name()) + s.sendAuthzExecToUpdateAllModuleParams(accountName, moduleName, paramsTableMap) } // AllModuleParamsShouldBeUpdated asserts that all module params have been updated as expected. @@ -481,6 +474,21 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { } } +// sendAuthzExecToUpdateAllModuleParams constructs and sends an authz exec +// tx to update all params for moduleName the given params. +func (s *suite) sendAuthzExecToUpdateAllModuleParams(accountName, moduleName string, params paramsAnyMap) { + // NB: set s#moduleParamsMap for later assertion. + s.expectedModuleParams = moduleParamsMap{ + moduleName: params, + } + + // Use the map of params to populate a tx JSON template & write it to a file. + txJSONFile := s.newTempUpdateParamsTxJSONFile(s.expectedModuleParams) + + // Send the authz exec tx to update all module params. + s.sendAuthzExecTx(accountName, txJSONFile.Name()) +} + // assertUpdatedParams deserializes the param query response JSON into a // MsgUpdateParams of type P & asserts that it matches the expected params. func assertUpdatedParams[P cosmostypes.Msg]( From 1372cd30eb27e27034654118ec527ffc744a5f67 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 10:31:56 +0200 Subject: [PATCH 64/77] chore: review feedback improvements --- tests/integration/params/update_param_test.go | 38 ++- .../integration/params/update_params_test.go | 59 ++-- .../relay_mining_integration_test.go | 2 +- testutil/integration/suites/authz.go | 12 +- testutil/integration/suites/param_configs.go | 164 +++++++++++ testutil/integration/suites/update_params.go | 261 ++++++------------ 6 files changed, 324 insertions(+), 212 deletions(-) create mode 100644 testutil/integration/suites/param_configs.go diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 6a5b18ce1..104755a63 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -14,11 +15,22 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) +// MsgUpdateParamSuite is a test suite which exercises the MsgUpdateParam message +// for each poktroll module via authz, as would be done in a live network in order +// to update **individual** parameter values for a given module. +// NB: Not to be confused with MsgUpdateParams (plural), which updates all parameter +// values for a module. type MsgUpdateParamSuite struct { - suites.UpdateParamsSuite + suites.ParamsSuite + + unauthorizedAddr cosmostypes.AccAddress } -func (s *MsgUpdateParamSuite) SetupTest() { +func TestUpdateParamSuite(t *testing.T) { + suite.Run(t, new(MsgUpdateParamSuite)) +} + +func (s *MsgUpdateParamSuite) SetupSubTest() { // Create a fresh integration app for each test. s.NewApp(s.T()) @@ -29,7 +41,7 @@ func (s *MsgUpdateParamSuite) SetupTest() { // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") - unauthorizedAddr = nextAcct.Address + s.unauthorizedAddr = nextAcct.Address } func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { @@ -46,6 +58,10 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { testName := fmt.Sprintf("%s_%s", moduleName, fieldName) s.T().Run(testName, func(t *testing.T) { + // Reset the app state in order to assert that each module + // param is updated correctly. + s.SetupSubTest() + // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) @@ -53,7 +69,7 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { moduleName, fieldName, fieldValue.Interface(), - unauthorizedAddr, + s.unauthorizedAddr, ) require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) require.Nil(t, updateResBz) @@ -78,7 +94,7 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { s.T().Run(testName, func(t *testing.T) { // Reset the app state in order to assert that each module // param is updated correctly. - s.SetupTest() + s.SetupSubTest() // Assert that the module's params are set to their default values. s.RequireModuleHasDefaultParams(t, moduleName) @@ -98,7 +114,13 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { // These result byte slices are accumulated for each message in the MsgExec and // set on the MsgExecResponse#Results field. // - //I would've expected the following to work, but it does not: + // - https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/x/authz/keeper/msg_server.go#L120 + // - https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/x/authz/keeper/keeper.go#L166 + // - https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/baseapp/msg_service_router.go#L55 + // - https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/baseapp/msg_service_router.go#L198 + // - https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/types/result.go#L213 + // + // I (@bryanchriswhite) would've expected the following to work, but it does not: // // updateResValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParamResponse)) // // NB: using proto.Unmarshal here because authz seems to use @@ -119,7 +141,3 @@ func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { } } } - -func TestUpdateParamSuite(t *testing.T) { - suite.Run(t, new(MsgUpdateParamSuite)) -} diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index 00130cc0e..19cf43270 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -14,10 +14,24 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) -var unauthorizedAddr cosmostypes.AccAddress - +// MsgUpdateParamsSuite is a test suite which exercises the MsgUpdateParams message +// for each poktroll module via authz, as would be done in a live network in order +// to update **all** parameter values for a given module. +// NB: Not to be confused with MsgUpdateParam (singular), which updates a single +// parameter value for a module. type MsgUpdateParamsSuite struct { - suites.UpdateParamsSuite + suites.ParamsSuite + + unauthorizedAddr cosmostypes.AccAddress +} + +// TestUpdateParamsSuite uses the ModuleParamConfig for each module to test the +// MsgUpdateParams message execution via authz on an integration app, as would be +// done in a live network in order to update module parameter values. It uses +// reflection to construct the messages and make assertions about the results to +// improve maintainability and reduce boilerplate. +func TestUpdateParamsSuite(t *testing.T) { + suite.Run(t, &MsgUpdateParamsSuite{}) } func (s *MsgUpdateParamsSuite) SetupTest() { @@ -31,7 +45,7 @@ func (s *MsgUpdateParamsSuite) SetupTest() { // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") - unauthorizedAddr = nextAcct.Address + s.unauthorizedAddr = nextAcct.Address } func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { @@ -44,16 +58,13 @@ func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { // Construct a new MsgUpdateParams and set its authority and params fields. expectedParams := moduleCfg.ValidParams - msgUpdateParamsValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParams)) - msgUpdateParamsValue.Elem(). - FieldByName("Authority"). - SetString(suites.AuthorityAddr.String()) - msgUpdateParamsValue.Elem(). - FieldByName("Params"). - Set(reflect.ValueOf(expectedParams)) - - msgUpdateParams := msgUpdateParamsValue.Interface().(cosmostypes.Msg) - updateRes, err := s.RunUpdateParamsAsSigner(t, msgUpdateParams, unauthorizedAddr) + msgUpdateParamsType := reflect.TypeOf(moduleCfg.ParamsMsgs.MsgUpdateParams) + msgUpdateParams := suites.NewMsgUpdateParams( + msgUpdateParamsType, + s.AuthorityAddr.String(), + expectedParams, + ) + updateRes, err := s.RunUpdateParamsAsSigner(t, msgUpdateParams, s.unauthorizedAddr) require.ErrorContains(t, err, authz.ErrNoAuthorizationFound.Error()) require.Nil(t, updateRes) }) @@ -70,18 +81,14 @@ func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { // Construct a new MsgUpdateParams and set its authority and params fields. expectedParams := moduleCfg.ValidParams - msgUpdateParamsValue := reflect.New(reflect.TypeOf(moduleCfg.MsgUpdateParams)) - msgUpdateParamsValue.Elem(). - FieldByName("Authority"). - SetString(suites.AuthorityAddr.String()) - msgUpdateParamsValue.Elem(). - FieldByName("Params"). - Set(reflect.ValueOf(expectedParams)) - //expectedParams := reflect.ValueOf(moduleCfg.ValidParams).FieldByName("Params") - + msgUpdateParamsType := reflect.TypeOf(moduleCfg.ParamsMsgs.MsgUpdateParams) + msgUpdateParams := suites.NewMsgUpdateParams( + msgUpdateParamsType, + s.AuthorityAddr.String(), + expectedParams, + ) // TODO_IMPROVE: add a Params field to the MsgUpdateParamsResponse // and assert that it reflects the updated params. - msgUpdateParams := msgUpdateParamsValue.Interface().(cosmostypes.Msg) _, err := s.RunUpdateParams(t, msgUpdateParams) require.NoError(t, err) @@ -98,7 +105,3 @@ func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { }) } } - -func TestUpdateParamsSuite(t *testing.T) { - suite.Run(t, &MsgUpdateParamsSuite{}) -} diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 4def06029..e33f873b3 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -32,7 +32,7 @@ var ( ) type RelayMiningIntegrationTestSuite struct { - suites.UpdateParamsSuite + suites.ParamsSuite } func (s *RelayMiningIntegrationTestSuite) SetupTest() { diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index 4af6e24c4..82399ab53 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -40,7 +40,7 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsgForPoktrollModules( var foundModuleGrants = make(map[string]int) for _, moduleName := range moduleNames { - msgType := fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) + msgType := fmtPoktrollMsgType(moduleName, msgName) authorization := &authz.GenericAuthorization{Msg: msgType} s.RunAuthzGrantMsg(t, granterAddr, granteeAddr, authorization) @@ -55,6 +55,7 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsgForPoktrollModules( require.NoError(t, err) require.NotNil(t, queryGrantsRes) + // Count the number of grants found for each module. for range queryGrantsRes.GetGrants() { foundModuleGrants[moduleName]++ } @@ -66,8 +67,8 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsgForPoktrollModules( } } -// RunAuthzGrantMsg creates an on-chain authz grant for the given granter and -// grantee addresses and authorization object. +// RunAuthzGrantMsg creates an on-chain authz grant from the given granter to the +// grantee addresses for the authorization object provided. func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( t *testing.T, granterAddr, @@ -107,3 +108,8 @@ func (s *AuthzIntegrationSuite) RunAuthzExecMsg( return msgRespsBz, nil } + +// fmtPoktrollMsgType returns the formatted message type for a poktroll module. +func fmtPoktrollMsgType(moduleName, msgName string) string { + return fmt.Sprintf(poktrollMsgTypeFormat, moduleName, msgName) +} diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go new file mode 100644 index 000000000..2e95a7c41 --- /dev/null +++ b/testutil/integration/suites/param_configs.go @@ -0,0 +1,164 @@ +package suites + +import ( + "encoding/hex" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/app/volatile" + apptypes "github.com/pokt-network/poktroll/x/application/types" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" +) + +var ( + ValidAddServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000001) + ValidProofMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) + ValidProofSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) + ValidProofRequirementThresholdCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100) + ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") + + SharedModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: sharedtypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: sharedtypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: sharedtypes.MsgUpdateParam{}, + MsgUpdateParamResponse: sharedtypes.MsgUpdateParamResponse{}, + QueryParamsRequest: sharedtypes.QueryParamsRequest{}, + QueryParamsResponse: sharedtypes.QueryParamsResponse{}, + }, + ParamTypes: map[ParamType]any{ + ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, + }, + ValidParams: sharedtypes.Params{ + NumBlocksPerSession: 12, + GracePeriodEndOffsetBlocks: 0, + ClaimWindowOpenOffsetBlocks: 2, + ClaimWindowCloseOffsetBlocks: 3, + ProofWindowOpenOffsetBlocks: 1, + ProofWindowCloseOffsetBlocks: 3, + SupplierUnbondingPeriodSessions: 9, + ApplicationUnbondingPeriodSessions: 9, + ComputeUnitsToTokensMultiplier: 420, + }, + DefaultParams: sharedtypes.DefaultParams(), + NewParamClientFn: sharedtypes.NewQueryClient, + } + + SessionModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: sessiontypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: sessiontypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: sessiontypes.QueryParamsRequest{}, + QueryParamsResponse: sessiontypes.QueryParamsResponse{}, + }, + ValidParams: sessiontypes.Params{}, + DefaultParams: sessiontypes.DefaultParams(), + NewParamClientFn: sessiontypes.NewQueryClient, + } + + ServiceModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: servicetypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: servicetypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: servicetypes.MsgUpdateParam{}, + MsgUpdateParamResponse: servicetypes.MsgUpdateParamResponse{}, + QueryParamsRequest: servicetypes.QueryParamsRequest{}, + QueryParamsResponse: servicetypes.QueryParamsResponse{}, + }, + ValidParams: servicetypes.Params{ + AddServiceFee: &ValidAddServiceFeeCoin, + }, + ParamTypes: map[ParamType]any{ + ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, + }, + DefaultParams: servicetypes.DefaultParams(), + NewParamClientFn: servicetypes.NewQueryClient, + } + + ApplicationModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: apptypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: apptypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: apptypes.QueryParamsRequest{}, + QueryParamsResponse: apptypes.QueryParamsResponse{}, + }, + ValidParams: apptypes.Params{ + MaxDelegatedGateways: 999, + }, + DefaultParams: apptypes.DefaultParams(), + NewParamClientFn: apptypes.NewQueryClient, + } + + GatewayModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: gatewaytypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: gatewaytypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: gatewaytypes.QueryParamsRequest{}, + QueryParamsResponse: gatewaytypes.QueryParamsResponse{}, + }, + ValidParams: gatewaytypes.Params{}, + DefaultParams: gatewaytypes.DefaultParams(), + NewParamClientFn: gatewaytypes.NewQueryClient, + } + + SupplierModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: suppliertypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: suppliertypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: suppliertypes.QueryParamsRequest{}, + QueryParamsResponse: suppliertypes.QueryParamsResponse{}, + }, + ValidParams: suppliertypes.Params{}, + DefaultParams: suppliertypes.DefaultParams(), + NewParamClientFn: suppliertypes.NewQueryClient, + } + + ProofModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: prooftypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: prooftypes.MsgUpdateParamsResponse{}, + MsgUpdateParam: prooftypes.MsgUpdateParam{}, + MsgUpdateParamResponse: prooftypes.MsgUpdateParamResponse{}, + QueryParamsRequest: prooftypes.QueryParamsRequest{}, + QueryParamsResponse: prooftypes.QueryParamsResponse{}, + }, + ValidParams: prooftypes.Params{ + RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, + ProofRequestProbability: 0.1, + ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, + ProofMissingPenalty: &ValidProofMissingPenaltyCoin, + ProofSubmissionFee: &ValidProofSubmissionFeeCoin, + }, + ParamTypes: map[ParamType]any{ + ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, + ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, + ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, + ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, + ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, + }, + DefaultParams: prooftypes.DefaultParams(), + NewParamClientFn: prooftypes.NewQueryClient, + } + + TokenomicsModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: tokenomicstypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: tokenomicstypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: tokenomicstypes.QueryParamsRequest{}, + QueryParamsResponse: tokenomicstypes.QueryParamsResponse{}, + }, + ValidParams: tokenomicstypes.Params{}, + DefaultParams: tokenomicstypes.DefaultParams(), + NewParamClientFn: tokenomicstypes.NewQueryClient, + } +) diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index a25856180..c92ae05e6 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -3,7 +3,6 @@ package suites import ( - "encoding/hex" "reflect" "testing" @@ -11,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" - "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/cases" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" @@ -41,210 +39,133 @@ const ( MsgUpdateParamName = "MsgUpdateParam" ) -// ModuleParamConfig holds a set of valid parameters and type information for a -// given module. It uses any instead of cosmostypes.Msg to mitigate easy mistakes -// that could result from using pointers instead (unintended mutation). It is still -// possible to mutate this global variable; however, it is less likely to happen -// unintentionally. +// ModuleParamConfig holds type information about a module's parameters update +// message(s) along with default and valid non-default values and a query constructor +// function for the module. It is used by ParamsSuite to construct and send +// parameter update messages and assert on their results. type ModuleParamConfig struct { - ValidParams any + ParamsMsgs ModuleParamsMessages + // ParamTypes is a map of parameter types to their respective MsgUpdateParam_As* + // types which satisfy the oneof for the MsgUpdateParam#AsType field. Each AsType + // type which the module supports should be included in this map. + ParamTypes map[ParamType]any + // ValidParams is a set of parameters which are expected to be valid when used + // together AND when used individually, where the reamining parameters are set + // to their default values. + ValidParams any + DefaultParams any + NewParamClientFn any +} + +// ModuleParamsMessages holds a reference to each of the params-related message +// types for a given module. The values are only used for their type information +// which is obtained via reflection. The values are not used for their actual +// message contents and MAY be the zero value. +// If MsgUpdateParam is omitted (i.e. nil), ParamsSuite will assume that +// this module does not support individual parameter updates (i.e. MsgUpdateParam). +// In this case, MsgUpdateParamResponse SHOULD also be omitted. +type ModuleParamsMessages struct { MsgUpdateParams any MsgUpdateParamsResponse any MsgUpdateParam any MsgUpdateParamResponse any - ParamTypes map[ParamType]any QueryParamsRequest any QueryParamsResponse any - DefaultParams any - NewParamClientFn any } var ( - // AuthorityAddr is the cosmos account address of the authority for the integration app. - AuthorityAddr cosmostypes.AccAddress - // AuthorizedAddr is the cosmos account address which is the grantee of authz - // grants for parameter update messages. - AuthorizedAddr cosmostypes.AccAddress - - ValidServiceFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000001) - ValidMissingPenaltyCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 500) - ValidSubmissionFeeCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 5000000) - ValidRelayDifficultyTargetHash, _ = hex.DecodeString("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff") - ValidProofRequirementThresholdCoin = cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100) + // MsgUpdateParamEnabledModuleNames is a list of module names which support + // individual parameter updates (i.e. MsgUpdateParam). It is initialized in + // init(). + MsgUpdateParamEnabledModuleNames []string // ModuleParamConfigMap is a map of module names to their respective parameter - // configurations. It is used by the UpdateParamsSuite, mostly via reflection, + // configurations. It is used by the ParamsSuite, mostly via reflection, // to construct and send parameter update messages and assert on their results. ModuleParamConfigMap = map[string]ModuleParamConfig{ - sharedtypes.ModuleName: { - ValidParams: sharedtypes.Params{ - NumBlocksPerSession: 12, - GracePeriodEndOffsetBlocks: 0, - ClaimWindowOpenOffsetBlocks: 2, - ClaimWindowCloseOffsetBlocks: 3, - ProofWindowOpenOffsetBlocks: 1, - ProofWindowCloseOffsetBlocks: 3, - SupplierUnbondingPeriodSessions: 9, - ApplicationUnbondingPeriodSessions: 9, - ComputeUnitsToTokensMultiplier: 420, - }, - MsgUpdateParams: sharedtypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: sharedtypes.MsgUpdateParamsResponse{}, - MsgUpdateParam: sharedtypes.MsgUpdateParam{}, - MsgUpdateParamResponse: sharedtypes.MsgUpdateParamResponse{}, - ParamTypes: map[ParamType]any{ - ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, - ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, - }, - QueryParamsRequest: sharedtypes.QueryParamsRequest{}, - QueryParamsResponse: sharedtypes.QueryParamsResponse{}, - DefaultParams: sharedtypes.DefaultParams(), - NewParamClientFn: sharedtypes.NewQueryClient, - }, - sessiontypes.ModuleName: { - ValidParams: sessiontypes.Params{}, - MsgUpdateParams: sessiontypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: sessiontypes.MsgUpdateParamsResponse{}, - QueryParamsRequest: sessiontypes.QueryParamsRequest{}, - QueryParamsResponse: sessiontypes.QueryParamsResponse{}, - DefaultParams: sessiontypes.DefaultParams(), - NewParamClientFn: sessiontypes.NewQueryClient, - }, - servicetypes.ModuleName: { - ValidParams: servicetypes.Params{ - AddServiceFee: &ValidServiceFeeCoin, - }, - MsgUpdateParams: servicetypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: servicetypes.MsgUpdateParamsResponse{}, - MsgUpdateParam: servicetypes.MsgUpdateParam{}, - MsgUpdateParamResponse: servicetypes.MsgUpdateParamResponse{}, - ParamTypes: map[ParamType]any{ - ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, - }, - QueryParamsRequest: servicetypes.QueryParamsRequest{}, - QueryParamsResponse: servicetypes.QueryParamsResponse{}, - DefaultParams: servicetypes.DefaultParams(), - NewParamClientFn: servicetypes.NewQueryClient, - }, - apptypes.ModuleName: { - ValidParams: apptypes.Params{ - MaxDelegatedGateways: 999, - }, - MsgUpdateParams: apptypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: apptypes.MsgUpdateParamsResponse{}, - QueryParamsRequest: apptypes.QueryParamsRequest{}, - QueryParamsResponse: apptypes.QueryParamsResponse{}, - DefaultParams: apptypes.DefaultParams(), - NewParamClientFn: apptypes.NewQueryClient, - }, - gatewaytypes.ModuleName: { - ValidParams: gatewaytypes.Params{}, - MsgUpdateParams: gatewaytypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: gatewaytypes.MsgUpdateParamsResponse{}, - QueryParamsRequest: gatewaytypes.QueryParamsRequest{}, - QueryParamsResponse: gatewaytypes.QueryParamsResponse{}, - DefaultParams: gatewaytypes.DefaultParams(), - NewParamClientFn: gatewaytypes.NewQueryClient, - }, - suppliertypes.ModuleName: { - ValidParams: suppliertypes.Params{}, - MsgUpdateParams: suppliertypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: suppliertypes.MsgUpdateParamsResponse{}, - QueryParamsRequest: suppliertypes.QueryParamsRequest{}, - QueryParamsResponse: suppliertypes.QueryParamsResponse{}, - DefaultParams: suppliertypes.DefaultParams(), - NewParamClientFn: suppliertypes.NewQueryClient, - }, - prooftypes.ModuleName: { - ValidParams: prooftypes.Params{ - RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, - ProofRequestProbability: 0.1, - ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, - ProofMissingPenalty: &ValidMissingPenaltyCoin, - ProofSubmissionFee: &ValidSubmissionFeeCoin, - }, - MsgUpdateParams: prooftypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: prooftypes.MsgUpdateParamsResponse{}, - MsgUpdateParam: prooftypes.MsgUpdateParam{}, - MsgUpdateParamResponse: prooftypes.MsgUpdateParamResponse{}, - ParamTypes: map[ParamType]any{ - ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, - ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, - ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, - ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, - }, - QueryParamsRequest: prooftypes.QueryParamsRequest{}, - QueryParamsResponse: prooftypes.QueryParamsResponse{}, - DefaultParams: prooftypes.DefaultParams(), - NewParamClientFn: prooftypes.NewQueryClient, - }, - tokenomicstypes.ModuleName: { - ValidParams: tokenomicstypes.Params{}, - MsgUpdateParams: tokenomicstypes.MsgUpdateParams{}, - MsgUpdateParamsResponse: tokenomicstypes.MsgUpdateParamsResponse{}, - QueryParamsRequest: tokenomicstypes.QueryParamsRequest{}, - QueryParamsResponse: tokenomicstypes.QueryParamsResponse{}, - DefaultParams: tokenomicstypes.DefaultParams(), - NewParamClientFn: tokenomicstypes.NewQueryClient, - }, + sharedtypes.ModuleName: SharedModuleParamConfig, + sessiontypes.ModuleName: SessionModuleParamConfig, + servicetypes.ModuleName: ServiceModuleParamConfig, + apptypes.ModuleName: ApplicationModuleParamConfig, + gatewaytypes.ModuleName: GatewayModuleParamConfig, + suppliertypes.ModuleName: SupplierModuleParamConfig, + prooftypes.ModuleName: ProofModuleParamConfig, + tokenomicstypes.ModuleName: TokenomicsModuleParamConfig, } - // MsgUpdateParamEnabledModuleNames is a list of module names which support - // individual parameter updates (i.e. MsgUpdateParam). It is initialized in - // init(). - MsgUpdateParamEnabledModuleNames []string - - _ IntegrationSuite = (*UpdateParamsSuite)(nil) + _ IntegrationSuite = (*ParamsSuite)(nil) ) func init() { - for moduleName, moduleThing := range ModuleParamConfigMap { - if moduleThing.MsgUpdateParam != nil { + for moduleName, moduleParamCfg := range ModuleParamConfigMap { + if moduleParamCfg.ParamsMsgs.MsgUpdateParam != nil { MsgUpdateParamEnabledModuleNames = append(MsgUpdateParamEnabledModuleNames, moduleName) } } } -// UpdateParamsSuite is an integration test suite that provides helper functions for -// running parameter update messages. It is intended to be embedded in other integration -// test suites which are dependent on parameter updates. -type UpdateParamsSuite struct { +// ParamsSuite is an integration test suite that provides helper functions for +// querying module parameters and running parameter update messages. It is +// intended to be embedded in other integration test suites which are dependent +// on parameter queries or updates. +type ParamsSuite struct { AuthzIntegrationSuite + + // AuthorityAddr is the cosmos account address of the authority for the integration + // app. It is used as the **granter** of authz grants for parameter update messages. + AuthorityAddr cosmostypes.AccAddress + // AuthorizedAddr is the cosmos account address which is the **grantee** of authz + // grants for parameter update messages. + AuthorizedAddr cosmostypes.AccAddress +} + +// NewMsgUpdateParams constructs a new concrete pointer of msgUpdateParams type +// with the given param values set on it. It is returned as a cosmostypes.Msg. +func NewMsgUpdateParams( + msgUpdateParamsType reflect.Type, + authorityBech32 string, + params any, +) cosmostypes.Msg { + msgUpdateParamsValue := reflect.New(msgUpdateParamsType) + msgUpdateParamsValue.Elem(). + FieldByName("Authority"). + SetString(authorityBech32) + msgUpdateParamsValue.Elem(). + FieldByName("Params"). + Set(reflect.ValueOf(params)) + + return msgUpdateParamsValue.Interface().(cosmostypes.Msg) } // SetupTestAuthzAccounts sets AuthorityAddr for the suite by getting the authority // from the integration app. It also assigns a new pre-generated identity to be used // as the AuthorizedAddr for the suite. It is expected to be called after s.NewApp() // as it depends on the integration app and its pre-generated account iterator. -func (s *UpdateParamsSuite) SetupTestAuthzAccounts() { +func (s *ParamsSuite) SetupTestAuthzAccounts() { // Set the authority, authorized, and unauthorized addresses. - AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) + s.AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() require.True(s.T(), ok, "insufficient pre-generated accounts available") - AuthorizedAddr = nextAcct.Address + s.AuthorizedAddr = nextAcct.Address } // SetupTestAuthzGrants creates on-chain authz grants for the MsgUpdateUpdateParam and // MsgUpdateParams message for each module. It is expected to be called after s.NewApp() // as it depends on the authority and authorized addresses having been set. -func (s *UpdateParamsSuite) SetupTestAuthzGrants() { +func (s *ParamsSuite) SetupTestAuthzGrants() { // Create authz grants for all poktroll modules' MsgUpdateParams messages. s.RunAuthzGrantMsgForPoktrollModules(s.T(), - AuthorityAddr, - AuthorizedAddr, + s.AuthorityAddr, + s.AuthorizedAddr, MsgUpdateParamsName, s.GetPoktrollModuleNames()..., ) // Create authz grants for all poktroll modules' MsgUpdateParam messages. s.RunAuthzGrantMsgForPoktrollModules(s.T(), - AuthorityAddr, - AuthorizedAddr, + s.AuthorityAddr, + s.AuthorizedAddr, MsgUpdateParamName, // NB: only modules with params are expected to support MsgUpdateParam. MsgUpdateParamEnabledModuleNames..., @@ -255,19 +176,19 @@ func (s *UpdateParamsSuite) SetupTestAuthzGrants() { // AuthorizedAddr and returns the response bytes and error. It is expected to be called // after s.SetupTestAuthzGrants() as it depends on an on-chain authz grant to AuthorizedAddr // for MsgUpdateParams for the given module. -func (s *UpdateParamsSuite) RunUpdateParams( +func (s *ParamsSuite) RunUpdateParams( t *testing.T, msgUpdateParams cosmostypes.Msg, ) (msgResponseBz []byte, err error) { t.Helper() - return s.RunUpdateParamsAsSigner(t, msgUpdateParams, AuthorizedAddr) + return s.RunUpdateParamsAsSigner(t, msgUpdateParams, s.AuthorizedAddr) } // RunUpdateParamsAsSigner runs the given MsgUpdateParams message via an authz exec // as signerAddr and returns the response bytes and error. It depends on an on-chain // authz grant to signerAddr for MsgUpdateParams for the given module. -func (s *UpdateParamsSuite) RunUpdateParamsAsSigner( +func (s *ParamsSuite) RunUpdateParamsAsSigner( t *testing.T, msgUpdateParams cosmostypes.Msg, signerAddr cosmostypes.AccAddress, @@ -275,7 +196,7 @@ func (s *UpdateParamsSuite) RunUpdateParamsAsSigner( t.Helper() // Send an authz MsgExec from an unauthorized address. - execMsg := authz.NewMsgExec(AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) + execMsg := authz.NewMsgExec(s.AuthorizedAddr, []cosmostypes.Msg{msgUpdateParams}) msgRespsBz, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) if err != nil { return nil, err @@ -289,7 +210,7 @@ func (s *UpdateParamsSuite) RunUpdateParamsAsSigner( // as the AuthorizedAddr for the given module, parameter name, and value. It returns // the response bytes and error. It is expected to be called after s.SetupTestAuthzGrants() // as it depends on an on-chain authz grant to AuthorizedAddr for MsgUpdateParam for the given module. -func (s *UpdateParamsSuite) RunUpdateParam( +func (s *ParamsSuite) RunUpdateParam( t *testing.T, moduleName string, paramName string, @@ -301,7 +222,7 @@ func (s *UpdateParamsSuite) RunUpdateParam( moduleName, paramName, paramValue, - AuthorizedAddr, + s.AuthorizedAddr, ) } @@ -309,7 +230,7 @@ func (s *UpdateParamsSuite) RunUpdateParam( // as the given signerAddr for the given module, parameter name, and value. It returns // the response bytes and error. It depends on an on-chain authz grant to signerAddr for // MsgUpdateParam for the given module. -func (s *UpdateParamsSuite) RunUpdateParamAsSigner( +func (s *ParamsSuite) RunUpdateParamAsSigner( t *testing.T, moduleName string, paramName string, @@ -329,7 +250,7 @@ func (s *UpdateParamsSuite) RunUpdateParamAsSigner( paramType = paramReflectValue.Type().Elem().Name() } - msgIface := moduleCfg.MsgUpdateParam + msgIface := moduleCfg.ParamsMsgs.MsgUpdateParam msgValue := reflect.ValueOf(msgIface) msgType := msgValue.Type() @@ -337,7 +258,7 @@ func (s *UpdateParamsSuite) RunUpdateParamAsSigner( msgUpdateParamValue := reflect.New(msgType) msgUpdateParamValue.Elem(). FieldByName("Authority"). - SetString(AuthorityAddr.String()) + SetString(s.AuthorityAddr.String()) msgUpdateParamValue.Elem().FieldByName("Name").SetString(cases.ToSnakeCase(paramName)) @@ -379,7 +300,7 @@ func (s *UpdateParamsSuite) RunUpdateParamAsSigner( // RequireModuleHasDefaultParams asserts that the given module's parameters are set // to their default values. -func (s *UpdateParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleName string) { +func (s *ParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleName string) { t.Helper() params, err := s.QueryModuleParams(t, moduleName) @@ -391,7 +312,7 @@ func (s *UpdateParamsSuite) RequireModuleHasDefaultParams(t *testing.T, moduleNa // QueryModuleParams queries the given module's parameters and returns them. It is // expected to be called after s.NewApp() as it depends on the app's query helper. -func (s *UpdateParamsSuite) QueryModuleParams(t *testing.T, moduleName string) (params any, err error) { +func (s *ParamsSuite) QueryModuleParams(t *testing.T, moduleName string) (params any, err error) { t.Helper() moduleCfg := ModuleParamConfigMap[moduleName] @@ -404,7 +325,7 @@ func (s *UpdateParamsSuite) QueryModuleParams(t *testing.T, moduleName string) ( paramClient := newParamClientFn.Call(newParamClientFnArgs)[0] // Query for the module's params. - paramsQueryReqValue := reflect.New(reflect.TypeOf(moduleCfg.QueryParamsRequest)) + paramsQueryReqValue := reflect.New(reflect.TypeOf(moduleCfg.ParamsMsgs.QueryParamsRequest)) callParamsArgs := []reflect.Value{ reflect.ValueOf(s.GetApp().GetSdkCtx()), paramsQueryReqValue, From c77a0a88ed68b65bbe239f4a0d6598dcf7b11bc2 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 11:19:03 +0200 Subject: [PATCH 65/77] chore: review feedback improvements --- .../relay_mining_integration_test.go | 63 ++++++++++--------- testutil/integration/app.go | 38 ++++++----- testutil/integration/suites/base.go | 4 +- testutil/integration/suites/base_test.go | 39 ++++++------ testutil/integration/suites/interface.go | 2 - testutil/sample/sample.go | 10 ++- .../keeper/token_logic_modules_test.go | 6 +- 7 files changed, 84 insertions(+), 78 deletions(-) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 4def06029..1771b8a32 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -1,5 +1,3 @@ -//go:build integration - package integration_test import ( @@ -15,7 +13,6 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/testutil/integration" - "github.com/pokt-network/poktroll/testutil/integration/suites" "github.com/pokt-network/poktroll/testutil/testrelayer" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -28,48 +25,52 @@ var ( // Test params. computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) - //serviceComputeUnitsPerRelay = uint64(1) // keeping the math simple ) type RelayMiningIntegrationTestSuite struct { - suites.UpdateParamsSuite + // TODO_BETA(#826): wait for integration app & suites refactor to be merged. + // Once suites.ParamsSuite is avialable, embed it here. In the meantime, we + // MUST embed suite.Suite to avoid compilation errors. + // + // suites.ParamsSuite + suite.Suite } func (s *RelayMiningIntegrationTestSuite) SetupTest() { // Construct a fresh integration app for each test. - // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. - //s.NewApp(s.T()) - //s.SetupTestAccounts() - //s.SetupTestAuthzGrants() + // TODO_BETA(#826): wait for integration app & suites refactor to be merged. + // s.NewApp(s.T()) + // s.SetupTestAccounts() + // s.SetupTestAuthzGrants() } func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { // Set the shared module param compute_units_to_tokens_multiplier. - // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. - //_, err := s.RunUpdateParam(s.T(), - // sharedtypes.ModuleName, - // sharedtypes.ParamComputeUnitsToTokensMultiplier, - // computeUnitsToTokensMultiplier, - //) - //require.NoError(s.T(), err) + // TODO_BETA(#826): wait for integration app & suites refactor to be merged. + // _, err := s.RunUpdateParam(s.T(), + // sharedtypes.ModuleName, + // sharedtypes.ParamComputeUnitsToTokensMultiplier, + // computeUnitsToTokensMultiplier, + // ) + // require.NoError(s.T(), err) // Set the proof params so we never need a proof (for simplicity of this test) - // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. - //_, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequestProbability, - // float32(0), - //) - //require.NoError(s.T(), err) + // TODO_BETA(#826): wait for integration app & suites refactor to be merged. + // _, err = s.RunUpdateParam(s.T(), + // prooftypes.ModuleName, + // prooftypes.ParamProofRequestProbability, + // float32(0), + // ) + // require.NoError(s.T(), err) // Set the proof requirement threshold to be VERY high. - // TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged. - //_, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequirementThreshold, - // &proofRequirementThreshold, - //) - //require.NoError(s.T(), err) + // TODO_BETA(#826): wait for integration app & suites refactor to be merged. + // _, err = s.RunUpdateParam(s.T(), + // prooftypes.ModuleName, + // prooftypes.ParamProofRequirementThreshold, + // &proofRequirementThreshold, + // ) + // require.NoError(s.T(), err) // TODO(@red-0ne, #781): Implement this test after the business logic is done. @@ -183,6 +184,6 @@ func prepareRealClaim( } func TestRelayMiningIntegrationSuite(t *testing.T) { - t.Skip("TODO_BLOCKED(#826): wait for integration app & suites refactor to be merged.") + t.Skip("TODO_BETA(#826): wait for integration app & suites refactor to be merged.") suite.Run(t, new(RelayMiningIntegrationTestSuite)) } diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 3c5ac9d5d..fc7f9681f 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -84,21 +84,11 @@ import ( const appName = "poktroll-integration-app" var ( - // FaucetAddrStr is a random address which is funded with FaucetAmountUpokt - // coins such that it can be used as a faucet for integration tests. - FaucetAddrStr = sample.AccAddress() - // FaucetAmountUpokt is the number of upokt coins that the faucet account + // faucetAmountUpokt is the number of upokt coins that the faucet account // is funded with. - FaucetAmountUpokt = int64(math2.MaxInt64) + faucetAmountUpokt = int64(math2.MaxInt64) ) -// defaultIntegrationAppOptionFn is the default integration module function for the -// integration app. It ensures that the bank module genesis state includes the faucet -// account with a large balance. -func defaultIntegrationAppOptionFn(cfg *IntegrationAppConfig) { - WithInitChainerModuleFn(newFaucetInitChainerFn(FaucetAddrStr, FaucetAmountUpokt))(cfg) -} - // App is a test application that can be used to test the behaviour when none // of the modules are mocked and their integration (cross module interaction) // needs to be validated. @@ -117,6 +107,11 @@ type App struct { ringClient crypto.RingClient preGeneratedAccts *testkeyring.PreGeneratedAccountIterator + // faucetBech32 is a random address which is selected as the primary faucet + // to fund other accounts. It is funded with faucetAmountUpokt coins such that + // it can be used as a faucet for integration tests. + faucetBech32 string + // Some default helper fixtures for general testing. // They're publicly exposed and should/could be improved and expand on // over time. @@ -148,8 +143,14 @@ func NewIntegrationApp( ) *App { t.Helper() + // Prepare the faucet init-chainer module option function. It ensures that the + // bank module genesis state includes the faucet account with a large balance. + faucetBech32 := sample.AccAddress() + faucetInitChainerFn := newFaucetInitChainerFn(faucetBech32, faucetAmountUpokt) + initChainerModuleOptFn := WithInitChainerModuleFn(faucetInitChainerFn) + cfg := &IntegrationAppConfig{} - opts = append(opts, defaultIntegrationAppOptionFn) + opts = append(opts, initChainerModuleOptFn) for _, opt := range opts { opt(cfg) } @@ -673,10 +674,15 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg) (tx.MsgResponse, error) { return txMsgRes[0], err } +// GetFaucetBech32 returns the faucet address used by the application. +func (app *App) GetFaucetBech32() string { + return app.faucetBech32 +} + // RunMsgs provides the ability to process messages by packing them into a tx and // driving the ABCI through block finalization. It returns a slice of tx.MsgResponse -// (any) whose elements correspond to the request message of the same index. These -// responses can be type asserted to the expected response type. +// (any) whose elements correspond to the request message of the same index. +// These responses can be type asserted to the expected response type. // If execution for ANY message fails, ALL failing messages' errors are joined and // returned. In order to run a message, the application must have a handler for it. // These handlers are registered on the application message service router. @@ -851,7 +857,7 @@ func (app *App) nextBlockUpdateCtx() { // on-chain actors for use in tests. In creates a service, and stakes a supplier // and application as well as funding the bank balance of the default supplier. // -// TODO_IMPROVE: Eliminate usage of and remove this function in favor of +// TODO_TECHDEBT(@bryanchriswhite): Eliminate usage of and remove this function in favor of // integration.NewInitChainerModuleGenesisStateOptionFn. func (app *App) setupDefaultActorsState( t *testing.T, diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 8af7e5e24..491cae620 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -1,5 +1,3 @@ -//go:build integration - package suites import ( @@ -85,7 +83,7 @@ func (s *BaseIntegrationSuite) FundAddress( ) { coinUpokt := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, amountUpokt) sendMsg := &banktypes.MsgSend{ - FromAddress: integration.FaucetAddrStr, + FromAddress: s.GetApp().GetFaucetBech32(), ToAddress: addr.String(), Amount: cosmostypes.NewCoins(coinUpokt), } diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index b3f87f7ec..39b0b6872 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -1,5 +1,3 @@ -//go:build integration - package suites import ( @@ -12,21 +10,22 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/events" - "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/sample" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" ) -type BaseIntegrationSuiteTestSuite struct { +// baseIntegrationSuiteTestSuite is a test suite which embeds BaseIntegrationSuite. +// **in order to test it**. It is intended to be embedded in other test suites. +type baseIntegrationSuiteTestSuite struct { BaseIntegrationSuite } -func (s *BaseIntegrationSuite) SetupTest() { +func (s *baseIntegrationSuiteTestSuite) SetupTest() { // Reset app to nil before each test. s.app = nil } -func (s *BaseIntegrationSuiteTestSuite) TestGetApp_PanicsIfNil() { +func (s *baseIntegrationSuiteTestSuite) TestGetApp_PanicsIfNil() { require.Nil(s.T(), s.app) // Expect the call to GetApp() to panic, defer recovery to check. @@ -44,19 +43,19 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetApp_PanicsIfNil() { s.GetApp() } -func (s *BaseIntegrationSuiteTestSuite) TestNewApp() { +func (s *baseIntegrationSuiteTestSuite) TestNewApp() { require.Nil(s.T(), s.app) app := s.NewApp(s.T()) require.Same(s.T(), app, s.app) } -func (s *BaseIntegrationSuiteTestSuite) TestGetApp_ReturnsApp() { +func (s *baseIntegrationSuiteTestSuite) TestGetApp_ReturnsApp() { app := s.NewApp(s.T()) require.Same(s.T(), app, s.GetApp()) } -func (s *BaseIntegrationSuiteTestSuite) TestSetApp() { +func (s *baseIntegrationSuiteTestSuite) TestSetApp() { // Construct an app. app := s.NewApp(s.T()) @@ -67,19 +66,19 @@ func (s *BaseIntegrationSuiteTestSuite) TestSetApp() { require.Same(s.T(), app, s.app) } -func (s *BaseIntegrationSuiteTestSuite) TestGetPoktrollModuleNames() { +func (s *baseIntegrationSuiteTestSuite) TestGetPoktrollModuleNames() { moduleNames := s.GetPoktrollModuleNames() require.Greater(s.T(), len(moduleNames), 0, "expected non-empty module names") require.ElementsMatch(s.T(), s.poktrollModuleNames, moduleNames) } -func (s *BaseIntegrationSuiteTestSuite) TestGetCosmosModuleNames() { +func (s *baseIntegrationSuiteTestSuite) TestGetCosmosModuleNames() { moduleNames := s.GetCosmosModuleNames() require.Greater(s.T(), len(moduleNames), 0, "expected non-empty module names") require.ElementsMatch(s.T(), s.cosmosModuleNames, moduleNames) } -func (s *BaseIntegrationSuiteTestSuite) TestSdkCtx() { +func (s *baseIntegrationSuiteTestSuite) TestSdkCtx() { s.NewApp(s.T()) sdkCtx := s.SdkCtx() @@ -87,7 +86,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestSdkCtx() { require.Greater(s.T(), sdkCtx.BlockHeight(), int64(0)) } -func (s *BaseIntegrationSuiteTestSuite) TestFundAddressAndGetBankQueryClient() { +func (s *baseIntegrationSuiteTestSuite) TestFundAddressAndGetBankQueryClient() { s.NewApp(s.T()) fundAmount := int64(1000) fundAddr, err := cosmostypes.AccAddressFromBech32(sample.AccAddress()) @@ -114,7 +113,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFundAddressAndGetBankQueryClient() { require.Equal(s.T(), fundAmount, balRes.GetBalance().Amount.Int64()) } -func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMatchFn() { +func (s *baseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMatchFn() { expectedNumEvents := 3 s.NewApp(s.T()) @@ -132,7 +131,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMat require.Equal(s.T(), 0, len(s.SdkCtx().EventManager().Events()), "expected no events in the next block") } -func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMatchFn() { +func (s *baseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMatchFn() { expectedNumEvents := 3 s.NewApp(s.T()) @@ -153,7 +152,7 @@ func (s *BaseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewEventTypeMa require.Equal(s.T(), 0, len(s.SdkCtx().EventManager().Events()), "expected no events in the next block") } -func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { +func (s *baseIntegrationSuiteTestSuite) TestGetAttributeValue() { s.NewApp(s.T()) s.emitBankMsgSendEvents(1) @@ -177,11 +176,11 @@ func (s *BaseIntegrationSuiteTestSuite) TestGetAttributeValue() { // emitBankMsgSendEvents causes the bank module to emit events as the result // of handling a MsgSend message which are intended to be used to make assertions // in tests. -func (s *BaseIntegrationSuiteTestSuite) emitBankMsgSendEvents(expectedNumEvents int) { +func (s *baseIntegrationSuiteTestSuite) emitBankMsgSendEvents(expectedNumEvents int) { msgs := make([]cosmostypes.Msg, 0) for i := 0; i < expectedNumEvents; i++ { - faucetAddr, err := cosmostypes.AccAddressFromBech32(integration.FaucetAddrStr) + faucetAddr, err := cosmostypes.AccAddressFromBech32(s.GetApp().GetFaucetBech32()) require.NoError(s.T(), err) randomAddr, err := cosmostypes.AccAddressFromBech32(sample.AccAddress()) @@ -202,7 +201,7 @@ func (s *BaseIntegrationSuiteTestSuite) emitBankMsgSendEvents(expectedNumEvents // emitPoktrollGatewayUnstakedEvents emits the given number of EventGatewayUnstaked // events to the event manager. These events are intended to be used to make // assertions in tests. -func (s *BaseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expectedNumEvents int) { +func (s *baseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expectedNumEvents int) { for i := 0; i < expectedNumEvents; i++ { err := s.SdkCtx().EventManager().EmitTypedEvent(&gatewaytypes.EventGatewayUnstaked{ Address: sample.AccAddress(), @@ -213,5 +212,5 @@ func (s *BaseIntegrationSuiteTestSuite) emitPoktrollGatewayUnstakedEvents(expect // Run the test suite. func TestBaseIntegrationSuite(t *testing.T) { - suite.Run(t, new(BaseIntegrationSuiteTestSuite)) + suite.Run(t, new(baseIntegrationSuiteTestSuite)) } diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index d2d47f96f..d88246a90 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -1,5 +1,3 @@ -//go:build integration - package suites import ( diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index e29c328a1..1c533a4dd 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -31,7 +31,9 @@ func AccAddressAndPubKeyEd25519() (string, cryptotypes.PubKey) { } // ValAddress returns a sample validator address, which has the prefix -// of validators when converted to bech32. +// of validators when converted to bech32. Validator addresses identify +// the validator operator on-chain account and are derived using secp256k1. +// See: https://docs.cosmos.network/main/learn/beginner/accounts#addresses func ValAddress() string { _, pk := AccAddressAndPubKey() validatorAddress := tmhash.SumTruncated(pk.Address()) @@ -40,9 +42,11 @@ func ValAddress() string { } // ConsAddress returns a sample consensus node address, which has the prefix -// of consensus nodes when converted to bech32. +// of consensus nodes when converted to bech32. Consensus addresses identify +// the validator node in the consensus engine and are derived using ed25519. +// See: https://docs.cosmos.network/main/learn/beginner/accounts#addresses func ConsAddress() string { - _, pk := AccAddressAndPubKey() + _, pk := AccAddressAndPubKeyEd25519() consensusAddress := tmhash.SumTruncated(pk.Address()) valAddress := sdk.ConsAddress(consensusAddress) return valAddress.String() diff --git a/x/tokenomics/keeper/token_logic_modules_test.go b/x/tokenomics/keeper/token_logic_modules_test.go index 6931616f0..d90691bd6 100644 --- a/x/tokenomics/keeper/token_logic_modules_test.go +++ b/x/tokenomics/keeper/token_logic_modules_test.go @@ -322,10 +322,10 @@ func TestProcessTokenLogicModules_TLMGlobalMint_Valid_MintDistributionCorrect(t service := prepareTestService(serviceComputeUnitsPerRelay) numRelays := uint64(1000) // By supplier for application in this session numTokensClaimed := float64(numRelays * serviceComputeUnitsPerRelay * globalComputeUnitsToTokensMultiplier) - validatorConsAddr := sample.ValAddress() + validatorAddr := sample.ValAddress() // Prepare the keepers - keepers, ctx := testkeeper.NewTokenomicsModuleKeepers(t, nil, testkeeper.WithService(*service), testkeeper.WithProposerAddr(validatorConsAddr)) + keepers, ctx := testkeeper.NewTokenomicsModuleKeepers(t, nil, testkeeper.WithService(*service), testkeeper.WithProposerAddr(validatorAddr)) keepers.SetService(ctx, *service) // Set compute_units_to_tokens_multiplier to simplify expectation calculations. @@ -370,7 +370,7 @@ func TestProcessTokenLogicModules_TLMGlobalMint_Valid_MintDistributionCorrect(t // Prepare addresses daoAddress := authtypes.NewModuleAddress(govtypes.ModuleName) appAddress := app.Address - proposerAddress := sample.AccAddressFromConsAddress(validatorConsAddr) + proposerAddress := sample.AccAddressFromConsAddress(validatorAddr) // Determine balances before inflation daoBalanceBefore := getBalance(t, ctx, keepers, daoAddress.String()) From 05f0ba6d9c486c800dc8b6c92249e46b636498a1 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 11:38:27 +0200 Subject: [PATCH 66/77] chore: remove integration build constraints --- tests/integration/params/update_param_test.go | 2 -- tests/integration/params/update_params_test.go | 2 -- testutil/integration/suites/authz.go | 2 -- testutil/integration/suites/update_params.go | 2 -- 4 files changed, 8 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 104755a63..941e9fe03 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -1,5 +1,3 @@ -//go:build integration - package params import ( diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index 19cf43270..300b7383b 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -1,5 +1,3 @@ -//go:build integration - package params import ( diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index 82399ab53..d81a143d7 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -1,5 +1,3 @@ -//go:build integration - package suites import ( diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index c92ae05e6..be544dd45 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -1,5 +1,3 @@ -//go:build integration - package suites import ( From 8783b17243bdf37fde206dac1103a3db21967409 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 11:38:42 +0200 Subject: [PATCH 67/77] chore: reconcile upstream --- .../tokenomics/relay_mining_integration_test.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 1771b8a32..adc9fa2fb 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -13,6 +13,7 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/integration/suites" "github.com/pokt-network/poktroll/testutil/testrelayer" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -28,20 +29,14 @@ var ( ) type RelayMiningIntegrationTestSuite struct { - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // Once suites.ParamsSuite is avialable, embed it here. In the meantime, we - // MUST embed suite.Suite to avoid compilation errors. - // - // suites.ParamsSuite - suite.Suite + suites.ParamsSuite } func (s *RelayMiningIntegrationTestSuite) SetupTest() { // Construct a fresh integration app for each test. - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // s.NewApp(s.T()) - // s.SetupTestAccounts() - // s.SetupTestAuthzGrants() + s.NewApp(s.T()) + s.SetupTestAuthzAccounts() + s.SetupTestAuthzGrants() } func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { @@ -184,6 +179,5 @@ func prepareRealClaim( } func TestRelayMiningIntegrationSuite(t *testing.T) { - t.Skip("TODO_BETA(#826): wait for integration app & suites refactor to be merged.") suite.Run(t, new(RelayMiningIntegrationTestSuite)) } From e0e757b97d7d2fc425fba963ce21887ac1b6cf92 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 11:45:20 +0200 Subject: [PATCH 68/77] fix: linter errors --- .../tokenomics/relay_mining_integration_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 1771b8a32..33b22c602 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -4,13 +4,11 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/testrelayer" @@ -22,9 +20,9 @@ import ( ) var ( - // Test params. - computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple - proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) +// Test params. +// computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple +// proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) ) type RelayMiningIntegrationTestSuite struct { From 6590f76dcb24e2249bb26c7db3b48a1b0ebf0c4d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 12:09:52 +0200 Subject: [PATCH 69/77] fixup! HEAD^ --- testutil/integration/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index fc7f9681f..dea5aeace 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -224,6 +224,7 @@ func NewIntegrationApp( txCfg: txCfg, moduleManager: *moduleManager, queryHelper: queryHelper, + faucetBech32: faucetBech32, } } From d3563f53afabce4c5aed40a3b2974e172a68b729 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 12:40:20 +0200 Subject: [PATCH 70/77] fix: linter errors --- testutil/integration/suites/authz.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index d81a143d7..bd86708b2 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -100,9 +100,7 @@ func (s *AuthzIntegrationSuite) RunAuthzExecMsg( require.NotNil(t, execResAny) execRes := execResAny.(*authz.MsgExecResponse) - for _, msgResBz := range execRes.Results { - msgRespsBz = append(msgRespsBz, msgResBz) - } + msgRespsBz = append(msgRespsBz, execRes.Results...) return msgRespsBz, nil } From f4945c4beece25f9b8e844159e0d1be3a08182b1 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 24 Sep 2024 18:05:23 +0200 Subject: [PATCH 71/77] chore: unexport params test suites --- tests/integration/params/update_param_test.go | 12 ++++++------ tests/integration/params/update_params_test.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 941e9fe03..27f31601b 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -13,22 +13,22 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) -// MsgUpdateParamSuite is a test suite which exercises the MsgUpdateParam message +// msgUpdateParamSuite is a test suite which exercises the MsgUpdateParam message // for each poktroll module via authz, as would be done in a live network in order // to update **individual** parameter values for a given module. // NB: Not to be confused with MsgUpdateParams (plural), which updates all parameter // values for a module. -type MsgUpdateParamSuite struct { +type msgUpdateParamSuite struct { suites.ParamsSuite unauthorizedAddr cosmostypes.AccAddress } func TestUpdateParamSuite(t *testing.T) { - suite.Run(t, new(MsgUpdateParamSuite)) + suite.Run(t, new(msgUpdateParamSuite)) } -func (s *MsgUpdateParamSuite) SetupSubTest() { +func (s *msgUpdateParamSuite) SetupSubTest() { // Create a fresh integration app for each test. s.NewApp(s.T()) @@ -42,7 +42,7 @@ func (s *MsgUpdateParamSuite) SetupSubTest() { s.unauthorizedAddr = nextAcct.Address } -func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { +func (s *msgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { moduleCfg := suites.ModuleParamConfigMap[moduleName] @@ -76,7 +76,7 @@ func (s *MsgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { } } -func (s *MsgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { +func (s *msgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { moduleCfg := suites.ModuleParamConfigMap[moduleName] diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index 300b7383b..f8d803b50 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -12,12 +12,12 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) -// MsgUpdateParamsSuite is a test suite which exercises the MsgUpdateParams message +// msgUpdateParamsSuite is a test suite which exercises the MsgUpdateParams message // for each poktroll module via authz, as would be done in a live network in order // to update **all** parameter values for a given module. // NB: Not to be confused with MsgUpdateParam (singular), which updates a single // parameter value for a module. -type MsgUpdateParamsSuite struct { +type msgUpdateParamsSuite struct { suites.ParamsSuite unauthorizedAddr cosmostypes.AccAddress @@ -29,10 +29,10 @@ type MsgUpdateParamsSuite struct { // reflection to construct the messages and make assertions about the results to // improve maintainability and reduce boilerplate. func TestUpdateParamsSuite(t *testing.T) { - suite.Run(t, &MsgUpdateParamsSuite{}) + suite.Run(t, &msgUpdateParamsSuite{}) } -func (s *MsgUpdateParamsSuite) SetupTest() { +func (s *msgUpdateParamsSuite) SetupTest() { // Create a fresh integration app for each test. s.NewApp(s.T()) @@ -46,7 +46,7 @@ func (s *MsgUpdateParamsSuite) SetupTest() { s.unauthorizedAddr = nextAcct.Address } -func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { +func (s *msgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { for _, moduleName := range s.GetPoktrollModuleNames() { moduleCfg := suites.ModuleParamConfigMap[moduleName] @@ -69,7 +69,7 @@ func (s *MsgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { } } -func (s *MsgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { +func (s *msgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { for _, moduleName := range s.GetPoktrollModuleNames() { moduleCfg := suites.ModuleParamConfigMap[moduleName] From a99574722bd5416fee75df4d871e8a39424b5e62 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 09:30:25 +0200 Subject: [PATCH 72/77] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- tests/integration/tokenomics/relay_mining_integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 33b22c602..c7e32c0ef 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -20,6 +20,7 @@ import ( ) var ( +// TODO_BETA(#826): Uncomment these // Test params. // computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple // proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) @@ -27,7 +28,7 @@ var ( type RelayMiningIntegrationTestSuite struct { // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // Once suites.ParamsSuite is avialable, embed it here. In the meantime, we + // Once suites.ParamsSuite is available, embed it here. In the meantime, we // MUST embed suite.Suite to avoid compilation errors. // // suites.ParamsSuite From c6e4fd7cbb5c4fff8f3c424a81e2292aec479264 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 09:49:45 +0200 Subject: [PATCH 73/77] fix: typo --- testutil/integration/suites/base_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index 39b0b6872..cafe465eb 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -15,7 +15,7 @@ import ( ) // baseIntegrationSuiteTestSuite is a test suite which embeds BaseIntegrationSuite. -// **in order to test it**. It is intended to be embedded in other test suites. +// **in order to test it**. It is NOT intended to be embedded in other test suites. type baseIntegrationSuiteTestSuite struct { BaseIntegrationSuite } From 020136922e00c50de85f8cc067674e87e085bad7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 12:22:26 +0200 Subject: [PATCH 74/77] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- testutil/integration/suites/update_params.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index be544dd45..418955170 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -111,9 +111,11 @@ type ParamsSuite struct { // AuthorityAddr is the cosmos account address of the authority for the integration // app. It is used as the **granter** of authz grants for parameter update messages. + // In practice, is an address sourced by an on-chain string and no one has the private key. AuthorityAddr cosmostypes.AccAddress // AuthorizedAddr is the cosmos account address which is the **grantee** of authz // grants for parameter update messages. + // In practice, it is the address of the foundation or the DAO. AuthorizedAddr cosmostypes.AccAddress } From a821cf45b785087332ec6afc354d6dae4e1fa74c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 11:38:57 +0200 Subject: [PATCH 75/77] chore: code review improvements --- tests/integration/params/update_param_test.go | 9 +++++---- testutil/cases/cases.go | 3 +++ testutil/integration/suites/authz.go | 5 +---- testutil/integration/suites/update_params.go | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 27f31601b..0f1ffccfd 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -105,10 +105,11 @@ func (s *msgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { require.NoError(t, err) require.NotNil(t, updateResBz) - // TODO_TECHDEBT / TODO_TEST: It seems like the response objects are encoded in - // an unexpected way. It's unclear whether this is the result of being - // executed via authz. Looking at the code, it seems like authz utilizes the - // sdk.Result#Data field of the result which is returned from the message handler. + // TODO_INVESTIGATE(https://github.com/cosmos/cosmos-sdk/issues/21904): + // It seems like the response objects are encoded in an unexpected way. + // It's unclear whether this is the result of being executed via authz. + // Looking at the code, it seems like authz utilizes the sdk.Result#Data + // field of the result which is returned from the message handler. // These result byte slices are accumulated for each message in the MsgExec and // set on the MsgExecResponse#Results field. // diff --git a/testutil/cases/cases.go b/testutil/cases/cases.go index d49adea14..012edf29a 100644 --- a/testutil/cases/cases.go +++ b/testutil/cases/cases.go @@ -5,6 +5,9 @@ import ( "unicode" ) +// TODO_CONSIDERATION: Prefer using an external library (e.g. +// https://github.com/iancoleman/strcase) over implementing more cases. + func ToSnakeCase(str string) string { var result strings.Builder diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index bd86708b2..a3363219e 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -99,10 +99,7 @@ func (s *AuthzIntegrationSuite) RunAuthzExecMsg( } require.NotNil(t, execResAny) - execRes := execResAny.(*authz.MsgExecResponse) - msgRespsBz = append(msgRespsBz, execRes.Results...) - - return msgRespsBz, nil + return execResAny.(*authz.MsgExecResponse).Results, nil } // fmtPoktrollMsgType returns the formatted message type for a poktroll module. diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index 418955170..243c3f3a2 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -289,13 +289,13 @@ func (s *ParamsSuite) RunUpdateParamAsSigner( // Send an authz MsgExec from the authority address. execMsg := authz.NewMsgExec(signerAddr, []cosmostypes.Msg{msgUpdateParam}) - execResps, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) + msgRespsBz, err := s.RunAuthzExecMsg(t, signerAddr, &execMsg) if err != nil { return nil, err } - require.Equal(t, 1, len(execResps), "expected exactly 1 message response") - return execResps[0], err + require.Equal(t, 1, len(msgRespsBz), "expected exactly 1 message response") + return msgRespsBz[0], err } // RequireModuleHasDefaultParams asserts that the given module's parameters are set From 27837caafc8b42c461a0ae61f2585e67c314e8e6 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 12:22:57 +0200 Subject: [PATCH 76/77] chore: review feedback improvements --- Makefile | 2 +- .../develop/developer_guide/adding_params.md | 81 +------------------ .../develop/developer_guide/test_suites.md | 6 ++ docusaurus/docs/protocol/governance/params.md | 15 ++-- docusaurus/yarn.lock | 16 ++-- .../{ => docusaurus}/generate_docs_params.go | 44 +++------- tools/scripts/docusaurus/params_template.md | 38 +++++++++ 7 files changed, 79 insertions(+), 123 deletions(-) create mode 100644 docusaurus/docs/develop/developer_guide/test_suites.md rename tools/scripts/{ => docusaurus}/generate_docs_params.go (85%) create mode 100644 tools/scripts/docusaurus/params_template.md diff --git a/Makefile b/Makefile index 9b63c6558..6d46f90be 100644 --- a/Makefile +++ b/Makefile @@ -347,7 +347,7 @@ docusaurus_start: check_npm check_node ## Start the Docusaurus server .PHONY: docs_update_gov_params_page docs_update_gov_params_page: ## Update the page in Docusaurus documenting all the governance parameters - go run tools/scripts/generate_docs_params.go + go run tools/scripts/docusaurus/generate_docs_params.go ###################### ### Ignite Helpers ### diff --git a/docusaurus/docs/develop/developer_guide/adding_params.md b/docusaurus/docs/develop/developer_guide/adding_params.md index 38f80ac63..37ff71d1f 100644 --- a/docusaurus/docs/develop/developer_guide/adding_params.md +++ b/docusaurus/docs/develop/developer_guide/adding_params.md @@ -56,88 +56,13 @@ message Params { } ``` -### 2 Update the Parameter E2E Tests - -Update the E2E test files (e.g., `update_params.feature` and `update_params_test.go`) -to include scenarios that test the new parameter. - -#### 2.1 Scenario Example - -```gherkin -# NB: If you are reading this and the proof module has parameters -# that are not being updated in this test, please update the test. -Scenario: An authorized user updates all "proof" module params - Given the user has the pocketd binary installed - And all "proof" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.proof.MsgUpdateParams" message exists - When the "pnf" account sends an authz exec message to update all "proof" module params - | name | value | type | - | new_parameter_name | 100 | int64 | - Then all "proof" module params should be updated -``` - -#### 2.2 Scenario Outline Example - -```gherkin -# NB: If you are reading this and any module has parameters that -# are not being updated in this test, please update the test. -Scenario Outline: An authorized user updates individual module params - Given the user has the pocketd binary installed - And all "" module params are set to their default values - And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "" message exists - When the "pnf" account sends an authz exec message to update "" the module param - | name | value | type | - | | | | - Then the "" module param "" should be updated - - Examples: - | module | message_type | param_name | param_value | param_type | - | proof | /poktroll.proof.MsgUpdateParam | new_parameter_name | 100 | int64 | -``` - -#### 2.3 Step Definition Helpers Example - -The related changes to the step definition, presented below via an example, -should be made in `e2e/tests/parse_params_test.go`. - -```go -func (s *suite) newProofMsgUpdateParams(params paramsMap) cosmostypes.Msg { - msgUpdateParams := &prooftypes.MsgUpdateParam{ - Params: &prooftypes.Params{}, - } - - for paramName, paramValue := range params { - switch paramName { - case prooftypes.ParamNewParameterName: - msgUpdateParams.Params.NewParameterName = uint64(paramValue.value.(int64)) - default: - s.Fatalf("unexpected %q type param name %q", paramValue.typeStr, paramName) - } - } +### 2 Update the Parameter Integration Tests - return msgUpdateParams -} -``` - -#### 2.4 Update switch statement to support new param - -The related changes to the step definition, presented below via an example, -should be made in `e2e/tests/parse_params_test.go`. - -```go -case prooftypes.ModuleName: - params := prooftypes.DefaultParams() - paramsMap := s.expectedModuleParams[moduleName] - - newParameter, ok := paramsMap[prooftypes.ParamNewParameterName] - if ok { - params.NewParameter = uint64(newParameter.value.(int64)) - } -``` +// TODO_DOCUMENT(@bryanchriswhite, #826) ### 3. Update the Default Parameter Values -In the corresponding Go file (e.g., `params.go`), define the default value, key, and parameter name for the +In the corresponding Go file (e.g., `x//types/params.go`), define the default value, key, and parameter name for the new parameter and include the default in the `NewParams` and `DefaultParams` functions. ```go diff --git a/docusaurus/docs/develop/developer_guide/test_suites.md b/docusaurus/docs/develop/developer_guide/test_suites.md new file mode 100644 index 000000000..bbe6a63df --- /dev/null +++ b/docusaurus/docs/develop/developer_guide/test_suites.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 5 +title: Test Suites +--- + +// TODO_DOCUMENT(@bryanchriswhite) \ No newline at end of file diff --git a/docusaurus/docs/protocol/governance/params.md b/docusaurus/docs/protocol/governance/params.md index 30ca4da81..37400c7e4 100644 --- a/docusaurus/docs/protocol/governance/params.md +++ b/docusaurus/docs/protocol/governance/params.md @@ -13,6 +13,14 @@ DO NOT EDIT: this file was generated by make docs_update_gov_params_page - [Adding a new parameter](#adding-a-new-parameter) - [Parameters](#parameters) +## Access Control + +// TODO_DOCUMENT(@bryanchriswhite) tl;dr, authz. + +## Updating governance parameter values + +// TODO_DOCUMENT(@bryanchriswhite) + ## Updating this page ``` @@ -27,12 +35,9 @@ Please follow the instructions in [this guide](../../develop/developer_guide/add |Module | Field Type | Field Name |Comment | -|-------|------------|------------|--------| -| `application` | `uint64 ` | `max_delegated_gateways` | max_delegated_gateways defines the maximum number of gateways that a single application can delegate to. This is used to prevent performance issues in case the relay ring signature becomes too large. | +|-------|------------|------------|--------|| `application` | `uint64 ` | `max_delegated_gateways` | max_delegated_gateways defines the maximum number of gateways that a single application can delegate to. This is used to prevent performance issues in case the relay ring signature becomes too large. | | `proof ` | `bytes ` | `relay_difficulty_target_hash` | TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. | | `proof ` | `float ` | `proof_request_probability` | proof_request_probability is the probability of a session requiring a proof if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. | -| `proof ` | `uint64 ` | `proof_requirement_threshold` | proof_requirement_threshold is the session cost (i.e. compute unit consumption) threshold which asserts that a session MUST have a corresponding proof when its cost is equal to or above the threshold. This is in contrast to the this requirement being determined probabilistically via ProofRequestProbability. TODO_MAINNET: Consider renaming this to `proof_requirement_threshold_compute_units`. | -| `service ` | `uint64 ` | `add_service_fee` | The amount of uPOKT required to add a new service. This will be deducted from the signer's account balance, and transferred to the pocket network foundation. | | `shared ` | `uint64 ` | `num_blocks_per_session` | num_blocks_per_session is the number of blocks between the session start & end heights. | | `shared ` | `uint64 ` | `grace_period_end_offset_blocks` | grace_period_end_offset_blocks is the number of blocks, after the session end height, during which the supplier can still service payable relays. Suppliers will need to recreate a claim for the previous session (if already created) to get paid for the additional relays. | | `shared ` | `uint64 ` | `claim_window_open_offset_blocks` | claim_window_open_offset_blocks is the number of blocks after the session grace period height, at which the claim window opens. | @@ -41,4 +46,4 @@ Please follow the instructions in [this guide](../../develop/developer_guide/add | `shared ` | `uint64 ` | `proof_window_close_offset_blocks` | proof_window_close_offset_blocks is the number of blocks after the proof window open height, at which the proof window closes. | | `shared ` | `uint64 ` | `supplier_unbonding_period_sessions` | supplier_unbonding_period_sessions is the number of sessions that a supplier must wait after unstaking before their staked assets are moved to their account balance. On-chain business logic requires, and ensures, that the corresponding block count of the unbonding period will exceed the end of any active claim & proof lifecycles. | | `shared ` | `uint64 ` | `application_unbonding_period_sessions` | application_unbonding_period_sessions is the number of sessions that an application must wait after unstaking before their staked assets are moved to their account balance. On-chain business logic requires, and ensures, that the corresponding block count of the application unbonding period will exceed the end of its corresponding proof window close height. | -| `tokenomics` | `uint64 ` | `compute_units_to_tokens_multiplier` | The amount of upokt that a compute unit should translate to when settling a session. | +| `shared ` | `uint64 ` | `compute_units_to_tokens_multiplier` | The amount of upokt that a compute unit should translate to when settling a session. DEV_NOTE: This used to be under x/tokenomics but has been moved here to avoid cyclic dependencies. | diff --git a/docusaurus/yarn.lock b/docusaurus/yarn.lock index 5c2dcf935..93cee387e 100644 --- a/docusaurus/yarn.lock +++ b/docusaurus/yarn.lock @@ -1810,10 +1810,15 @@ dependencies: "@types/mdx" "^2.0.0" -"@node-rs/jieba-darwin-arm64@1.10.0": +"@node-rs/jieba-linux-x64-gnu@1.10.0": version "1.10.0" - resolved "https://registry.npmjs.org/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.10.0.tgz" - integrity sha512-IhR5r+XxFcfhVsF93zQ3uCJy8ndotRntXzoW/JCyKqOahUo/ITQRT6vTKHKMyD9xNmjl222OZonBSo2+mlI2fQ== + resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.10.0.tgz" + integrity sha512-rS5Shs8JITxJjFIjoIZ5a9O+GO21TJgKu03g2qwFE3QaN5ZOvXtz+/AqqyfT4GmmMhCujD83AGqfOGXDmItF9w== + +"@node-rs/jieba-linux-x64-musl@1.10.0": + version "1.10.0" + resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.10.0.tgz" + integrity sha512-BvSiF2rR8Birh2oEVHcYwq0WGC1cegkEdddWsPrrSmpKmukJE2zyjcxaOOggq2apb8fIRsjyeeUh6X3R5AgjvA== "@node-rs/jieba@^1.6.0": version "1.10.0" @@ -4614,11 +4619,6 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" diff --git a/tools/scripts/generate_docs_params.go b/tools/scripts/docusaurus/generate_docs_params.go similarity index 85% rename from tools/scripts/generate_docs_params.go rename to tools/scripts/docusaurus/generate_docs_params.go index f7b02888e..1c11dbee3 100644 --- a/tools/scripts/generate_docs_params.go +++ b/tools/scripts/docusaurus/generate_docs_params.go @@ -7,6 +7,9 @@ import ( "path/filepath" "regexp" "strings" + + "github.com/pokt-network/poktroll/pkg/polylog" + _ "github.com/pokt-network/poktroll/pkg/polylog/polyzero" ) type ProtoField struct { @@ -26,37 +29,16 @@ const ( destinationFile = "docusaurus/docs/protocol/governance/params.md" ) -const paramsDocsTemplate = `--- -title: Pocket Network Governance Params -sidebar_position: 1 ---- - -# Governance Parameters - -:::warning -DO NOT EDIT: this file was generated by make docs_update_gov_params_page -::: - -- [Updating this page](#updating-this-page) -- [Adding a new parameter](#adding-a-new-parameter) -- [Parameters](#parameters) - -## Updating this page - -%s -make docs_update_gov_params_page -%s - -## Adding a new parameter +var paramsDocsTemplateStr string -Please follow the instructions in [this guide](../../develop/developer_guide/adding_params.md) to add a new parameter. - -## Parameters - - -|Module | Field Type | Field Name |Comment | -|-------|------------|------------|--------| -` +func init() { + paramsTempalteFile, err := os.ReadFile("./tools/scripts/docusaurus/params_template.md") + if err != nil { + polylog.DefaultContextLogger.Error().Err(err).Send() + os.Exit(1) + } + paramsDocsTemplateStr = string(paramsTempalteFile) +} // writeContentToFile writes the given content to the specified file. func writeContentToFile(file_path, content string) error { @@ -184,7 +166,7 @@ func main() { } // This is necessary because multiline strings in golang do not support embedded backticks. - template := fmt.Sprintf(paramsDocsTemplate, "```", "```") + template := fmt.Sprintf(paramsDocsTemplateStr, "```", "```") docs, err := prepareGovernanceParamsDocs(protoFilePaths, template) if err != nil { diff --git a/tools/scripts/docusaurus/params_template.md b/tools/scripts/docusaurus/params_template.md new file mode 100644 index 000000000..11a0294a8 --- /dev/null +++ b/tools/scripts/docusaurus/params_template.md @@ -0,0 +1,38 @@ +--- +title: Pocket Network Governance Params +sidebar_position: 1 +--- + +# Governance Parameters + +:::warning +DO NOT EDIT: this file was generated by make docs_update_gov_params_page +::: + +- [Updating this page](#updating-this-page) +- [Adding a new parameter](#adding-a-new-parameter) +- [Parameters](#parameters) + +## Access Control + +// TODO_DOCUMENT(@bryanchriswhite) tl;dr, authz. + +## Updating governance parameter values + +// TODO_DOCUMENT(@bryanchriswhite) + +## Updating this page + +%s +make docs_update_gov_params_page +%s + +## Adding a new parameter + +Please follow the instructions in [this guide](../../develop/developer_guide/adding_params.md) to add a new parameter. + +## Parameters + + +|Module | Field Type | Field Name |Comment | +|-------|------------|------------|--------| \ No newline at end of file From 4dfa3011d7ba0ca3d256fbff69064064494b21e4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 25 Sep 2024 12:39:41 +0200 Subject: [PATCH 77/77] chore: consolidate param docs --- docusaurus/docs/protocol/upgrades/module_params.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docusaurus/docs/protocol/upgrades/module_params.md b/docusaurus/docs/protocol/upgrades/module_params.md index 695e29026..690fabf26 100644 --- a/docusaurus/docs/protocol/upgrades/module_params.md +++ b/docusaurus/docs/protocol/upgrades/module_params.md @@ -13,6 +13,10 @@ Pocket Network utilizes an off-chain governance mechanism that enables the commu - [Examples](#examples) - [Block Size Change](#block-size-change) +## Access Control + +// TODO_DOCUMENT(@bryanchriswhite) tl;dr, authz. + ## Examples ### Block Size Change