diff --git a/app/app.go b/app/app.go index 43aba4095..e34fc290e 100644 --- a/app/app.go +++ b/app/app.go @@ -866,6 +866,7 @@ func NewElysApp( app.AccountKeeper, app.BankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) burnerModule := burnermodule.NewAppModule(appCodec, app.BurnerKeeper, app.AccountKeeper, app.BankKeeper) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 25dd30a0e..27649c44c 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -10390,717 +10390,6 @@ paths: additionalProperties: {} tags: - Query - /cosmos/distribution/v1beta1/community_pool: - get: - summary: CommunityPool queries the community pool coins. - operationId: CosmosDistributionV1Beta1CommunityPool - responses: - '200': - description: A successful response. - schema: - type: object - properties: - pool: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: - get: - summary: |- - DelegationTotalRewards queries the total rewards accrued by a each - validator. - operationId: CosmosDistributionV1Beta1DelegationTotalRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: - get: - summary: DelegationRewards queries the total rewards accrued by a delegation. - operationId: CosmosDistributionV1Beta1DelegationRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: - get: - summary: DelegatorValidators queries the validators of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorValidators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: string - description: >- - validators defines the validators a delegator is delegating - for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: - get: - summary: DelegatorWithdrawAddress queries withdraw address of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/params: - get: - summary: Params queries params of the distribution module. - operationId: CosmosDistributionV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated - and is no longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated - and is no longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}: - get: - summary: >- - ValidatorDistributionInfo queries validator commission and - self-delegation rewards for validator - operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - operator_address: - type: string - description: operator_address defines the validator operator address. - self_bond_rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: self_bond_rewards defines the self delegations rewards. - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: commission defines the commission the validator received. - description: >- - QueryValidatorDistributionInfoResponse is the response type for - the Query/ValidatorDistributionInfo RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/commission: - get: - summary: ValidatorCommission queries accumulated commission for a validator. - operationId: CosmosDistributionV1Beta1ValidatorCommission - responses: - '200': - description: A successful response. - schema: - type: object - properties: - commission: - description: commission defines the commission the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: - get: - summary: ValidatorOutstandingRewards queries rewards of a validator address. - operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding - (un-withdrawn) rewards - - for a validator inexpensive to track, allows simple sanity - checks. - description: >- - QueryValidatorOutstandingRewardsResponse is the response type for - the - - Query/ValidatorOutstandingRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: - get: - summary: ValidatorSlashes queries slash events of a validator. - operationId: CosmosDistributionV1Beta1ValidatorSlashes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: >- - ValidatorSlashEvent represents a validator slash event. - - Height is implicit within the store key. - - This is needed to calculate appropriate amount of staking - tokens - - for delegations which are withdrawn after a slash has - occurred. - description: slashes defines the slashes the validator received. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - - name: starting_height - description: >- - starting_height defines the optional starting height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: ending_height - description: >- - starting_height defines the optional ending height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query /cosmos/evidence/v1beta1/evidence: get: summary: AllEvidence queries all evidence. @@ -68966,461 +68255,6 @@ definitions: cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: type: object description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - cosmos.base.v1beta1.DecCoin: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - cosmos.distribution.v1beta1.DelegationDelegatorReward: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse: - type: object - description: |- - MsgCommunityPoolSpendResponse defines the response to executing a - MsgCommunityPoolSpend message. - - Since: cosmos-sdk 0.47 - cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: - type: object - description: >- - MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response - type. - cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: - type: object - description: |- - MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response - type. - cosmos.distribution.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: 'Since: cosmos-sdk 0.46' - description: |- - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. - cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: 'Since: cosmos-sdk 0.46' - description: |- - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. - cosmos.distribution.v1beta1.Params: - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: Params defines the set of params for the distribution module. - cosmos.distribution.v1beta1.QueryCommunityPoolResponse: - type: object - properties: - pool: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool - - RPC method. - cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: - type: object - properties: - validators: - type: array - items: - type: string - description: validators defines the validators a delegator is delegating for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - cosmos.distribution.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated and is - no longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: - type: object - properties: - commission: - description: commission defines the commission the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: - type: object - properties: - operator_address: - type: string - description: operator_address defines the validator operator address. - self_bond_rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: self_bond_rewards defines the self delegations rewards. - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: commission defines the commission the validator received. - description: >- - QueryValidatorDistributionInfoResponse is the response type for the - Query/ValidatorDistributionInfo RPC method. - cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) - rewards - - for a validator inexpensive to track, allows simple sanity checks. - description: |- - QueryValidatorOutstandingRewardsResponse is the response type for the - Query/ValidatorOutstandingRewards RPC method. - cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. - description: slashes defines the slashes the validator received. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorAccumulatedCommission represents accumulated commission - for a validator kept as a running counter, can be withdrawn at any time. - cosmos.distribution.v1beta1.ValidatorOutstandingRewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - for a validator inexpensive to track, allows simple sanity checks. - cosmos.distribution.v1beta1.ValidatorSlashEvent: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: type: object properties: @@ -85414,6 +84248,8 @@ definitions: type: string amount: type: string + elys.burner.MsgMsgUpdateParamsResponse: + type: object elys.burner.Params: type: object properties: diff --git a/proto/elys/burner/tx.proto b/proto/elys/burner/tx.proto index 9f254a8f3..01acdf961 100644 --- a/proto/elys/burner/tx.proto +++ b/proto/elys/burner/tx.proto @@ -1,7 +1,19 @@ syntax = "proto3"; + package elys.burner; +import "elys/burner/params.proto"; + option go_package = "github.com/elys-network/elys/x/burner/types"; // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg { + rpc UpdateParams (MsgUpdateParams) returns (MsgUpdateParamsResponse); +} +message MsgUpdateParams { + string authority = 1; + Params params = 2; +} + +message MsgUpdateParamsResponse {} + diff --git a/testutil/keeper/burner.go b/testutil/keeper/burner.go index 28111db68..edbd023c7 100644 --- a/testutil/keeper/burner.go +++ b/testutil/keeper/burner.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/elys-network/elys/x/burner/keeper" "github.com/elys-network/elys/x/burner/types" @@ -47,6 +49,7 @@ func BurnerKeeper(t testing.TB) (*keeper.Keeper, sdk.Context, *mocks.BankKeeper) paramsSubspace, nil, bankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/burner/keeper/keeper.go b/x/burner/keeper/keeper.go index 6a8c1a5fa..8636d63cd 100644 --- a/x/burner/keeper/keeper.go +++ b/x/burner/keeper/keeper.go @@ -20,6 +20,7 @@ type ( paramstore paramtypes.Subspace bankKeeper types.BankKeeper + authority string } ) @@ -31,6 +32,7 @@ func NewKeeper( authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + authority string, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -44,6 +46,7 @@ func NewKeeper( paramstore: ps, bankKeeper: bankKeeper, + authority: authority, } } diff --git a/x/burner/keeper/msg_server_msg_update_params.go b/x/burner/keeper/msg_server_msg_update_params.go new file mode 100644 index 000000000..e668d1109 --- /dev/null +++ b/x/burner/keeper/msg_server_msg_update_params.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/elys-network/elys/x/burner/types" +) + +func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if k.authority != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + } + + params := k.GetParams(ctx) + params.EpochIdentifier = msg.Params.EpochIdentifier + k.SetParams(ctx, params) + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/burner/module_simulation.go b/x/burner/module_simulation.go index c3b211a69..711e2e7ae 100644 --- a/x/burner/module_simulation.go +++ b/x/burner/module_simulation.go @@ -1,6 +1,8 @@ package burner import ( + "math/rand" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -20,7 +22,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgMsgUpdateParams = "op_weight_msg_msg_update_params" + // TODO: Determine the simulation weight value + defaultWeightMsgMsgUpdateParams int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -48,6 +54,17 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgMsgUpdateParams int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgMsgUpdateParams, &weightMsgMsgUpdateParams, nil, + func(_ *rand.Rand) { + weightMsgMsgUpdateParams = defaultWeightMsgMsgUpdateParams + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgMsgUpdateParams, + burnersimulation.SimulateMsgUpdateParams(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/burner/simulation/msg_update_params.go b/x/burner/simulation/msg_update_params.go new file mode 100644 index 000000000..fb6fac14a --- /dev/null +++ b/x/burner/simulation/msg_update_params.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/elys-network/elys/x/burner/keeper" + "github.com/elys-network/elys/x/burner/types" +) + +func SimulateMsgUpdateParams( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdateParams{ + Authority: simAccount.Address.String(), + } + + // TODO: Handling the MsgUpdateParams simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "MsgUpdateParams simulation not implemented"), nil, nil + } +} diff --git a/x/burner/types/codec.go b/x/burner/types/codec.go index 844157a87..ff38dee3d 100644 --- a/x/burner/types/codec.go +++ b/x/burner/types/codec.go @@ -3,15 +3,19 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - // this line is used by starport scaffolding # 1 + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, "burner/MsgUpdateParams", nil) // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/burner/types/message_msg_update_params.go b/x/burner/types/message_msg_update_params.go new file mode 100644 index 000000000..66a92c3d6 --- /dev/null +++ b/x/burner/types/message_msg_update_params.go @@ -0,0 +1,46 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdateParams = "msg_update_params" + +var _ sdk.Msg = &MsgUpdateParams{} + +func NewMsgUpdateParams(creator string, authority string, params *Params) *MsgUpdateParams { + return &MsgUpdateParams{ + Authority: authority, + Params: params, + } +} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return TypeMsgUpdateParams +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/burner/types/message_msg_update_params_test.go b/x/burner/types/message_msg_update_params_test.go new file mode 100644 index 000000000..c9b0bfdb6 --- /dev/null +++ b/x/burner/types/message_msg_update_params_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/elys-network/elys/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUpdateParams_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdateParams + err error + }{ + { + name: "invalid address", + msg: MsgUpdateParams{ + Authority: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUpdateParams{ + Authority: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/burner/types/tx.pb.go b/x/burner/types/tx.pb.go index f6a4d9c4b..855da48a4 100644 --- a/x/burner/types/tx.pb.go +++ b/x/burner/types/tx.pb.go @@ -9,7 +9,11 @@ import ( 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. @@ -23,18 +27,118 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgUpdateParams struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +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_87bf5df951d3b585, []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) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *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 nil +} + +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_87bf5df951d3b585, []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) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *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), "elys.burner.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "elys.burner.MsgUpdateParamsResponse") +} + func init() { proto.RegisterFile("elys/burner/tx.proto", fileDescriptor_87bf5df951d3b585) } var fileDescriptor_87bf5df951d3b585 = []byte{ - // 125 bytes of a gzipped FileDescriptorProto + // 230 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0xcd, 0xa9, 0x2c, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0xe2, 0x06, 0x89, 0xea, 0x41, 0x44, 0x8d, 0x58, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x9d, 0x5c, - 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, - 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3b, 0x3d, 0xb3, 0x24, 0xa3, - 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xa4, 0x51, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, - 0x1b, 0xcc, 0xd1, 0xaf, 0x80, 0x9b, 0x5e, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xc1, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x0c, 0xb5, 0xed, 0x79, 0x00, 0x00, 0x00, + 0x17, 0xe2, 0x06, 0x89, 0xea, 0x41, 0x44, 0xa5, 0x24, 0x90, 0x95, 0x14, 0x24, 0x16, 0x25, 0xe6, + 0x16, 0x43, 0x94, 0x29, 0xc5, 0x70, 0xf1, 0xfb, 0x16, 0xa7, 0x87, 0x16, 0xa4, 0x24, 0x96, 0xa4, + 0x06, 0x80, 0x25, 0x84, 0x64, 0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, + 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x10, 0x02, 0x42, 0xda, 0x5c, 0x6c, 0x10, 0x03, 0x24, + 0x98, 0x14, 0x18, 0x35, 0xb8, 0x8d, 0x84, 0xf5, 0x90, 0x2c, 0xd2, 0x83, 0x18, 0x11, 0x04, 0x55, + 0xa2, 0x24, 0xc9, 0x25, 0x8e, 0x66, 0x7a, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, + 0x24, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x10, 0x17, 0x0f, 0xaa, 0xe5, 0x28, 0xc6, 0xa1, 0x69, + 0x96, 0x52, 0xc1, 0x27, 0x0b, 0x33, 0xda, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, + 0x26, 0xe9, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0x83, 0x39, 0xfa, 0x15, 0xf0, 0x40, 0xac, + 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0x90, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x94, + 0x65, 0xab, 0x60, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -49,6 +153,7 @@ const _ = grpc.SupportPackageIsVersion4 // // 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(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -59,22 +164,420 @@ 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, "/elys.burner.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(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: "/elys.burner.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: "elys.burner.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "elys/burner/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "elys/burner/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 + 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] = 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)) + } + if m.Params != nil { + 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 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 *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") +)