From 6fdb93b6f9f33041a6d87d4a0192acf4242319e6 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 13:45:34 +0530 Subject: [PATCH 01/12] feat(svip): add proto definitions --- proto/cosmos/evm/svip/v1/genesis.proto | 29 ++++++++ proto/cosmos/evm/svip/v1/query.proto | 61 +++++++++++++++++ proto/cosmos/evm/svip/v1/svip.proto | 20 ++++++ proto/cosmos/evm/svip/v1/tx.proto | 93 ++++++++++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 proto/cosmos/evm/svip/v1/genesis.proto create mode 100644 proto/cosmos/evm/svip/v1/query.proto create mode 100644 proto/cosmos/evm/svip/v1/svip.proto create mode 100644 proto/cosmos/evm/svip/v1/tx.proto diff --git a/proto/cosmos/evm/svip/v1/genesis.proto b/proto/cosmos/evm/svip/v1/genesis.proto new file mode 100644 index 00000000..fe9df0da --- /dev/null +++ b/proto/cosmos/evm/svip/v1/genesis.proto @@ -0,0 +1,29 @@ + +syntax = "proto3"; +package cosmos.evm.svip.v1; + +import "amino/amino.proto"; +import "cosmos/evm/svip/v1/svip.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// GenesisState defines the svip module's genesis state. +message GenesisState { + // params defines all the parameters of the svip module. + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + // total_distributed is the cumulative tokens sent to FeeCollector. + string total_distributed = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // activation_time is when SVIP was activated. Zero if not yet activated. + google.protobuf.Timestamp activation_time = 3 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // pool_balance_at_activation is the pool snapshot used to derive R₀. + string pool_balance_at_activation = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/cosmos/evm/svip/v1/query.proto b/proto/cosmos/evm/svip/v1/query.proto new file mode 100644 index 00000000..5adfc9f3 --- /dev/null +++ b/proto/cosmos/evm/svip/v1/query.proto @@ -0,0 +1,61 @@ + +syntax = "proto3"; +package cosmos.evm.svip.v1; + +import "amino/amino.proto"; +import "cosmos/evm/svip/v1/svip.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/svip module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/evm/svip/v1/params"; + } + + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + rpc PoolState(QueryPoolStateRequest) returns (QueryPoolStateResponse) { + option (google.api.http).get = "/cosmos/evm/svip/v1/pool_state"; + } +} + +// QueryParamsRequest defines the request type for querying x/svip parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/svip parameters. +message QueryParamsResponse { + // params define the svip module parameters. + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// QueryPoolStateRequest defines the request type for querying pool state. +message QueryPoolStateRequest {} + +// QueryPoolStateResponse returns the current SVIP pool state. +message QueryPoolStateResponse { + // pool_balance is the current balance in the SVIP module account. + cosmos.base.v1beta1.Coin pool_balance = 1 [ (gogoproto.nullable) = false ]; + // total_distributed is cumulative tokens sent to FeeCollector. + string total_distributed = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // current_rate_per_second is the current reward rate after decay. + string current_rate_per_second = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // activated indicates whether SVIP is active. + bool activated = 4; + // paused indicates whether SVIP is paused. + bool paused = 5; + // activation_time is when SVIP was activated. + google.protobuf.Timestamp activation_time = 6 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} diff --git a/proto/cosmos/evm/svip/v1/svip.proto b/proto/cosmos/evm/svip/v1/svip.proto new file mode 100644 index 00000000..67fee700 --- /dev/null +++ b/proto/cosmos/evm/svip/v1/svip.proto @@ -0,0 +1,20 @@ + +syntax = "proto3"; +package cosmos.evm.svip.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Params defines the x/svip module parameters. +message Params { + option (amino.name) = "cosmos/evm/x/svip/Params"; + + // activated indicates whether SVIP reward distribution is active. + bool activated = 1 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "activated"]; + // paused is an emergency pause flag. + bool paused = 2 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "paused"]; + // half_life_seconds is the half-life for exponential decay, in seconds. + int64 half_life_seconds = 3 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "half_life_seconds"]; +} diff --git a/proto/cosmos/evm/svip/v1/tx.proto b/proto/cosmos/evm/svip/v1/tx.proto new file mode 100644 index 00000000..247f6cdc --- /dev/null +++ b/proto/cosmos/evm/svip/v1/tx.proto @@ -0,0 +1,93 @@ + +syntax = "proto3"; +package cosmos.evm.svip.v1; + +import "amino/amino.proto"; +import "cosmos/evm/svip/v1/svip.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Msg defines the svip Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams updates the x/svip module parameters. Governance-only. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // Activate turns on reward distribution. Snapshots pool balance. + rpc Activate(MsgActivate) returns (MsgActivateResponse); + // Reactivate restarts the decay curve with a fresh pool snapshot. + rpc Reactivate(MsgReactivate) returns (MsgReactivateResponse); + // Pause toggles the emergency pause flag. Governance-only. + rpc Pause(MsgPause) returns (MsgPauseResponse); + // FundPool transfers native tokens into the SVIP pool. Permissionless. + rpc FundPool(MsgFundPool) returns (MsgFundPoolResponse); +} + +// MsgUpdateParams defines a Msg for updating the x/svip module parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos/evm/x/svip/MsgUpdateParams"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // params defines the x/svip parameters to update. + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +message MsgUpdateParamsResponse {} + +// MsgActivate activates SVIP reward distribution. Governance-only. +message MsgActivate { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgActivateResponse defines the response for MsgActivate. +message MsgActivateResponse {} + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +message MsgReactivate { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgReactivateResponse defines the response for MsgReactivate. +message MsgReactivateResponse {} + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +message MsgPause { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // paused is the desired pause state. + bool paused = 2; +} + +// MsgPauseResponse defines the response for MsgPause. +message MsgPauseResponse {} + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +message MsgFundPool { + option (cosmos.msg.v1.signer) = "depositor"; + + // depositor is the address funding the pool. + string depositor = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // amount is the coins to transfer. Only the native denom is accepted. + repeated cosmos.base.v1beta1.Coin amount = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +message MsgFundPoolResponse {} From 455e7c9ebf74a97a2481ba65a7d9ae1c10f49066 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 13:45:39 +0530 Subject: [PATCH 02/12] feat(svip): add module implementation --- x/svip/client/cli/tx.go | 63 + x/svip/genesis.go | 38 + x/svip/keeper/abci.go | 74 ++ x/svip/keeper/keeper.go | 164 +++ x/svip/keeper/msg_server.go | 173 +++ x/svip/keeper/params.go | 29 + x/svip/keeper/query_server.go | 57 + x/svip/keeper/reward.go | 54 + x/svip/module.go | 122 ++ x/svip/types/codec.go | 49 + x/svip/types/errors.go | 14 + x/svip/types/expected_keepers.go | 20 + x/svip/types/genesis.pb.go | 487 +++++++ x/svip/types/genesis_logic.go | 28 + x/svip/types/keys.go | 24 + x/svip/types/msgs.go | 61 + x/svip/types/params.go | 23 + x/svip/types/query.pb.go | 1128 +++++++++++++++++ x/svip/types/query.pb.gw.go | 218 ++++ x/svip/types/svip.pb.go | 393 ++++++ x/svip/types/tx.pb.go | 2037 ++++++++++++++++++++++++++++++ 21 files changed, 5256 insertions(+) create mode 100644 x/svip/client/cli/tx.go create mode 100644 x/svip/genesis.go create mode 100644 x/svip/keeper/abci.go create mode 100644 x/svip/keeper/keeper.go create mode 100644 x/svip/keeper/msg_server.go create mode 100644 x/svip/keeper/params.go create mode 100644 x/svip/keeper/query_server.go create mode 100644 x/svip/keeper/reward.go create mode 100644 x/svip/module.go create mode 100644 x/svip/types/codec.go create mode 100644 x/svip/types/errors.go create mode 100644 x/svip/types/expected_keepers.go create mode 100644 x/svip/types/genesis.pb.go create mode 100644 x/svip/types/genesis_logic.go create mode 100644 x/svip/types/keys.go create mode 100644 x/svip/types/msgs.go create mode 100644 x/svip/types/params.go create mode 100644 x/svip/types/query.pb.go create mode 100644 x/svip/types/query.pb.gw.go create mode 100644 x/svip/types/svip.pb.go create mode 100644 x/svip/types/tx.pb.go diff --git a/x/svip/client/cli/tx.go b/x/svip/client/cli/tx.go new file mode 100644 index 00000000..a484cc21 --- /dev/null +++ b/x/svip/client/cli/tx.go @@ -0,0 +1,63 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/evm/x/svip/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewTxCmd returns a root CLI command handler for svip transaction commands. +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "svip subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + NewFundPoolCmd(), + ) + return txCmd +} + +// NewFundPoolCmd returns a CLI command handler for funding the SVIP reward pool. +func NewFundPoolCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "fund-pool COINS", + Short: "Fund the SVIP reward pool", + Long: "Fund the SVIP reward pool with the specified coins. Example: ogd tx svip fund-pool 1000000000000000000000ogwei --from dev0", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + cliCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + coins, err := sdk.ParseCoinsNormalized(args[0]) + if err != nil { + return err + } + + msg := &types.MsgFundPool{ + Depositor: cliCtx.GetFromAddress().String(), + Amount: coins, + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/svip/genesis.go b/x/svip/genesis.go new file mode 100644 index 00000000..bb0917ac --- /dev/null +++ b/x/svip/genesis.go @@ -0,0 +1,38 @@ +package svip + +import ( + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the SVIP module genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate { + if err := k.SetParams(ctx, data.Params); err != nil { + panic(errorsmod.Wrap(err, "could not set parameters at genesis")) + } + if data.TotalDistributed.IsPositive() { + k.SetTotalDistributed(ctx, data.TotalDistributed) + } + if !data.ActivationTime.IsZero() { + k.SetActivationTime(ctx, data.ActivationTime) + k.SetLastBlockTime(ctx, data.ActivationTime) + } + if data.PoolBalanceAtActivation.IsPositive() { + k.SetPoolBalanceAtActivation(ctx, data.PoolBalanceAtActivation) + } + return []abci.ValidatorUpdate{} +} + +// ExportGenesis exports the SVIP module genesis state. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + return &types.GenesisState{ + Params: k.GetParams(ctx), + TotalDistributed: k.GetTotalDistributed(ctx), + ActivationTime: k.GetActivationTime(ctx), + PoolBalanceAtActivation: k.GetPoolBalanceAtActivation(ctx), + } +} diff --git a/x/svip/keeper/abci.go b/x/svip/keeper/abci.go new file mode 100644 index 00000000..7cad9f8b --- /dev/null +++ b/x/svip/keeper/abci.go @@ -0,0 +1,74 @@ +package keeper + +import ( + "github.com/cosmos/evm/x/svip/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// BeginBlock distributes decayed rewards to FeeCollector. +func (k Keeper) BeginBlock(ctx sdk.Context) error { + params := k.GetParams(ctx) + + // 1. Guard: skip if not active + if !params.Activated || params.Paused { + return nil + } + + // 2. Time context + now := ctx.BlockTime() + activationTime := k.GetActivationTime(ctx) + lastBlockTime := k.GetLastBlockTime(ctx) + + totalElapsed := now.Sub(activationTime).Seconds() + blockDelta := now.Sub(lastBlockTime).Seconds() + + if totalElapsed <= 0 || blockDelta <= 0 { + return nil + } + + // 3. Calculate reward (exponential decay, hardcoded) + poolAtActivation := k.GetPoolBalanceAtActivation(ctx) + reward := CalculateBlockReward(params.HalfLifeSeconds, poolAtActivation, totalElapsed, blockDelta) + + if reward.IsZero() || reward.IsNegative() { + k.SetLastBlockTime(ctx, now) + return nil + } + + // 4. Cap at actual pool balance + poolBalance := k.getPoolBalance(ctx) + if poolBalance.LT(reward) { + reward = poolBalance + } + if reward.IsZero() { + k.SetLastBlockTime(ctx, now) + return nil + } + + // 5. Transfer: svip → fee_collector + denom := k.getDenom(ctx) + coins := sdk.NewCoins(sdk.NewCoin(denom, reward)) + err := k.bk.SendCoinsFromModuleToModule( + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + coins, + ) + if err != nil { + return err + } + + // 6. Bookkeeping + events + k.AddTotalDistributed(ctx, reward) + k.SetLastBlockTime(ctx, now) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_reward", + sdk.NewAttribute("amount", coins.String()), + sdk.NewAttribute("pool_remaining", k.getPoolBalance(ctx).String()), + )) + + return nil +} diff --git a/x/svip/keeper/keeper.go b/x/svip/keeper/keeper.go new file mode 100644 index 00000000..6c0de87c --- /dev/null +++ b/x/svip/keeper/keeper.go @@ -0,0 +1,164 @@ +package keeper + +import ( + "time" + + "github.com/cosmos/evm/x/svip/types" + evmtypes "github.com/cosmos/evm/x/vm/types" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Keeper grants access to the SVIP module state. +type Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + authority sdk.AccAddress + bk types.BankKeeper + ak types.AccountKeeper +} + +// NewKeeper creates a new SVIP keeper. +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + authority sdk.AccAddress, + bk types.BankKeeper, + ak types.AccountKeeper, +) Keeper { + if err := sdk.VerifyAddressFormat(authority); err != nil { + panic(err) + } + return Keeper{ + cdc: cdc, + storeKey: storeKey, + authority: authority, + bk: bk, + ak: ak, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", types.ModuleName) +} + +// --- State accessors --- + +// GetTotalDistributed returns the cumulative amount of tokens distributed. +func (k Keeper) GetTotalDistributed(ctx sdk.Context) sdkmath.Int { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.TotalDistributedKey) + if bz == nil { + return sdkmath.ZeroInt() + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val +} + +// SetTotalDistributed sets the cumulative amount of tokens distributed. +func (k Keeper) SetTotalDistributed(ctx sdk.Context, val sdkmath.Int) { + store := ctx.KVStore(k.storeKey) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.TotalDistributedKey, bz) +} + +// AddTotalDistributed increments the total distributed counter by amount. +func (k Keeper) AddTotalDistributed(ctx sdk.Context, amount sdkmath.Int) { + current := k.GetTotalDistributed(ctx) + k.SetTotalDistributed(ctx, current.Add(amount)) +} + +// GetActivationTime returns the time SVIP was activated. +func (k Keeper) GetActivationTime(ctx sdk.Context) time.Time { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ActivationTimeKey) + if bz == nil { + return time.Time{} + } + var t time.Time + if err := t.UnmarshalBinary(bz); err != nil { + panic(err) + } + return t +} + +// SetActivationTime stores the time SVIP was activated. +func (k Keeper) SetActivationTime(ctx sdk.Context, t time.Time) { + store := ctx.KVStore(k.storeKey) + bz, err := t.MarshalBinary() + if err != nil { + panic(err) + } + store.Set(types.ActivationTimeKey, bz) +} + +// GetLastBlockTime returns the timestamp of the last processed block. +func (k Keeper) GetLastBlockTime(ctx sdk.Context) time.Time { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.LastBlockTimeKey) + if bz == nil { + return time.Time{} + } + var t time.Time + if err := t.UnmarshalBinary(bz); err != nil { + panic(err) + } + return t +} + +// SetLastBlockTime stores the timestamp of the last processed block. +func (k Keeper) SetLastBlockTime(ctx sdk.Context, t time.Time) { + store := ctx.KVStore(k.storeKey) + bz, err := t.MarshalBinary() + if err != nil { + panic(err) + } + store.Set(types.LastBlockTimeKey, bz) +} + +// GetPoolBalanceAtActivation returns the pool balance snapshot at activation time. +func (k Keeper) GetPoolBalanceAtActivation(ctx sdk.Context) sdkmath.Int { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.PoolBalanceAtActivationKey) + if bz == nil { + return sdkmath.ZeroInt() + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val +} + +// SetPoolBalanceAtActivation stores the pool balance snapshot at activation time. +func (k Keeper) SetPoolBalanceAtActivation(ctx sdk.Context, val sdkmath.Int) { + store := ctx.KVStore(k.storeKey) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.PoolBalanceAtActivationKey, bz) +} + +// getPoolBalance reads the live pool balance from x/bank (not from custom state). +func (k Keeper) getPoolBalance(ctx sdk.Context) sdkmath.Int { + moduleAddr := k.ak.GetModuleAddress(types.ModuleName) + return k.bk.GetBalance(ctx, moduleAddr, k.getDenom(ctx)).Amount +} + +// getDenom returns the native denom at runtime via the EVM module's global config. +func (k Keeper) getDenom(_ sdk.Context) string { + return evmtypes.GetEVMCoinDenom() +} diff --git a/x/svip/keeper/msg_server.go b/x/svip/keeper/msg_server.go new file mode 100644 index 00000000..5c7108d2 --- /dev/null +++ b/x/svip/keeper/msg_server.go @@ -0,0 +1,173 @@ +package keeper + +import ( + "context" + "fmt" + + "github.com/cosmos/evm/x/svip/types" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +// msgServer implements the SVIP MsgServer interface. +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the SVIP MsgServer interface. +func NewMsgServerImpl(k Keeper) types.MsgServer { + return &msgServer{Keeper: k} +} + +var _ types.MsgServer = msgServer{} + +// UpdateParams updates the SVIP module parameters. Governance-only. +func (s msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + // Governance guardrails + current := s.GetParams(ctx) + if current.Activated && !msg.Params.Activated { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "cannot deactivate SVIP after activation") + } + if current.Activated && current.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds > 0 { + // Reject if half_life changes by more than 50% + oldHL := float64(current.HalfLifeSeconds) + newHL := float64(msg.Params.HalfLifeSeconds) + ratio := newHL / oldHL + if ratio < 0.5 || ratio > 1.5 { + return nil, types.ErrHalfLifeChange + } + } + if msg.Params.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds < 31536000 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be >= 1 year (31536000s)") + } + + if err := s.SetParams(ctx, msg.Params); err != nil { + return nil, err + } + return &types.MsgUpdateParamsResponse{}, nil +} + +// Activate activates SVIP reward distribution. Governance-only. +func (s msgServer) Activate(goCtx context.Context, msg *types.MsgActivate) (*types.MsgActivateResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + params := s.GetParams(ctx) + if params.Activated { + return nil, types.ErrAlreadyActivated + } + + if params.HalfLifeSeconds <= 0 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be set before activation") + } + + // Snapshot pool balance + poolBalance := s.getPoolBalance(ctx) + if poolBalance.IsZero() { + return nil, types.ErrPoolNotFunded + } + s.SetPoolBalanceAtActivation(ctx, poolBalance) + + // Activate + params.Activated = true + if err := s.SetParams(ctx, params); err != nil { + return nil, err + } + s.SetActivationTime(ctx, ctx.BlockTime()) + s.SetLastBlockTime(ctx, ctx.BlockTime()) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_activated", + sdk.NewAttribute("pool_balance", poolBalance.String()), + sdk.NewAttribute("half_life_seconds", fmt.Sprintf("%d", params.HalfLifeSeconds)), + )) + + return &types.MsgActivateResponse{}, nil +} + +// Reactivate restarts the SVIP decay curve with a fresh pool snapshot. Governance-only. +func (s msgServer) Reactivate(goCtx context.Context, msg *types.MsgReactivate) (*types.MsgReactivateResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + params := s.GetParams(ctx) + if !params.Activated { + return nil, types.ErrNotYetActivated + } + + // Re-snapshot pool balance and restart the decay curve + poolBalance := s.getPoolBalance(ctx) + if poolBalance.IsZero() { + return nil, types.ErrPoolNotFunded + } + s.SetPoolBalanceAtActivation(ctx, poolBalance) + s.SetActivationTime(ctx, ctx.BlockTime()) + s.SetLastBlockTime(ctx, ctx.BlockTime()) + + // Reset cumulative counter for the new curve + s.SetTotalDistributed(ctx, sdkmath.ZeroInt()) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_reactivated", + sdk.NewAttribute("pool_balance", poolBalance.String()), + sdk.NewAttribute("half_life_seconds", fmt.Sprintf("%d", params.HalfLifeSeconds)), + )) + + return &types.MsgReactivateResponse{}, nil +} + +// Pause sets or clears the emergency pause flag. Governance-only. +func (s msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.MsgPauseResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + params := s.GetParams(ctx) + wasPaused := params.Paused + params.Paused = msg.Paused + if err := s.SetParams(ctx, params); err != nil { + return nil, err + } + + // On unpause: reset LastBlockTime to skip the paused gap + if wasPaused && !msg.Paused { + s.SetLastBlockTime(ctx, ctx.BlockTime()) + } + + return &types.MsgPauseResponse{}, nil +} + +// FundPool deposits coins into the SVIP reward pool. +func (s msgServer) FundPool(goCtx context.Context, msg *types.MsgFundPool) (*types.MsgFundPoolResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + depositor, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + + // Validate that only the native denom is sent to the pool + denom := s.getDenom(ctx) + for _, coin := range msg.Amount { + if coin.Denom != denom { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "invalid denom %s, expected %s", coin.Denom, denom) + } + } + + if err := s.bk.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, msg.Amount); err != nil { + return nil, err + } + return &types.MsgFundPoolResponse{}, nil +} diff --git a/x/svip/keeper/params.go b/x/svip/keeper/params.go new file mode 100644 index 00000000..266e3498 --- /dev/null +++ b/x/svip/keeper/params.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "github.com/cosmos/evm/x/svip/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams returns the total set of SVIP parameters. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return types.DefaultParams() + } + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the SVIP parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/svip/keeper/query_server.go b/x/svip/keeper/query_server.go new file mode 100644 index 00000000..ed05fbe5 --- /dev/null +++ b/x/svip/keeper/query_server.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/evm/x/svip/types" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// queryServer implements the SVIP QueryServer interface. +type queryServer struct { + Keeper +} + +// NewQueryServerImpl returns an implementation of the SVIP QueryServer interface. +func NewQueryServerImpl(k Keeper) types.QueryServer { + return &queryServer{Keeper: k} +} + +var _ types.QueryServer = queryServer{} + +// Params returns the current SVIP module parameters. +func (s queryServer) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + return &types.QueryParamsResponse{Params: s.GetParams(ctx)}, nil +} + +// PoolState returns the current SVIP pool state including balance and distribution info. +func (s queryServer) PoolState(goCtx context.Context, _ *types.QueryPoolStateRequest) (*types.QueryPoolStateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := s.GetParams(ctx) + denom := s.getDenom(ctx) + moduleAddr := s.ak.GetModuleAddress(types.ModuleName) + balance := s.bk.GetBalance(ctx, moduleAddr, denom) + + var currentRate math.LegacyDec + if params.Activated && !params.Paused { + elapsed := ctx.BlockTime().Sub(s.GetActivationTime(ctx)).Seconds() + poolAtAct := s.GetPoolBalanceAtActivation(ctx) + // Calculate tokens per second at current time + reward := CalculateBlockReward(params.HalfLifeSeconds, poolAtAct, elapsed, 1.0) + currentRate = math.LegacyNewDecFromInt(reward) + } else { + currentRate = math.LegacyZeroDec() + } + + return &types.QueryPoolStateResponse{ + PoolBalance: balance, + TotalDistributed: s.GetTotalDistributed(ctx), + CurrentRatePerSecond: currentRate, + Activated: params.Activated, + Paused: params.Paused, + ActivationTime: s.GetActivationTime(ctx), + }, nil +} diff --git a/x/svip/keeper/reward.go b/x/svip/keeper/reward.go new file mode 100644 index 00000000..9eed1831 --- /dev/null +++ b/x/svip/keeper/reward.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "fmt" + "math" + + sdkmath "cosmossdk.io/math" +) + +// CalculateBlockReward returns how many tokens (in base denom units) to +// distribute for this block using exponential decay. +// +// poolAtActivation — token balance when SVIP was activated (base denom) +// totalElapsedSec — seconds since SVIP activation +// blockDeltaSec — seconds since the previous block +// +// Exponential decay formula: +// +// R₀ = (ln2 / half_life) × poolAtActivation +// rate(t) = R₀ × e^(-λ × t) +// blockReward = rate(t) × blockDelta +func CalculateBlockReward( + halfLifeSeconds int64, + poolAtActivation sdkmath.Int, + totalElapsedSec float64, + blockDeltaSec float64, +) sdkmath.Int { + if poolAtActivation.IsZero() || blockDeltaSec <= 0 || totalElapsedSec < 0 { + return sdkmath.ZeroInt() + } + + halfLifeSec := float64(halfLifeSeconds) + if halfLifeSec <= 0 { + return sdkmath.ZeroInt() + } + + lambda := math.Log(2) / halfLifeSec + poolFloat := poolAtActivation.ToLegacyDec().MustFloat64() + initialRate := lambda * poolFloat // tokens per second at t=0 + currentRate := initialRate * math.Exp(-lambda*totalElapsedSec) // tokens/sec now + blockReward := currentRate * blockDeltaSec + + if blockReward <= 0 { + return sdkmath.ZeroInt() + } + + // Convert to integer (truncate — we never over-distribute) + rewardStr := fmt.Sprintf("%.0f", blockReward) + reward, ok := sdkmath.NewIntFromString(rewardStr) + if !ok { + return sdkmath.ZeroInt() + } + return reward +} diff --git a/x/svip/module.go b/x/svip/module.go new file mode 100644 index 00000000..c310d547 --- /dev/null +++ b/x/svip/module.go @@ -0,0 +1,122 @@ +package svip + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/evm/x/svip/client/cli" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + + "cosmossdk.io/core/appmodule" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +const consensusVersion = 1 + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasABCIGenesis = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the SVIP module. +type AppModuleBasic struct{} + +// Name returns the SVIP module's name. +func (AppModuleBasic) Name() string { return types.ModuleName } + +// RegisterLegacyAminoCodec registers the SVIP module's types on the given LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } + +// ConsensusVersion returns the consensus state-breaking version for the module. +func (AppModuleBasic) ConsensusVersion() uint64 { return consensusVersion } + +// DefaultGenesis returns default genesis state as raw bytes for the SVIP module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the SVIP module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var gs types.GenesisState + if err := cdc.UnmarshalJSON(bz, &gs); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return gs.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the SVIP module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(c)); err != nil { + panic(err) + } +} + +// RegisterInterfaces registers interfaces and implementations of the SVIP module. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// GetTxCmd returns the root tx command for the svip module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +// AppModule implements an application module for the SVIP module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object. +func NewAppModule(k keeper.Keeper) AppModule { + return AppModule{AppModuleBasic: AppModuleBasic{}, keeper: k} +} + +// Name returns the SVIP module's name. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterServices registers the GRPC query and msg services for the SVIP module. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) +} + +// BeginBlock returns the begin blocker for the SVIP module. +func (am AppModule) BeginBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.BeginBlock(c) +} + +// InitGenesis performs genesis initialization for the SVIP module. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var gs types.GenesisState + cdc.MustUnmarshalJSON(data, &gs) + InitGenesis(ctx, am.keeper, gs) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the SVIP module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/svip/types/codec.go b/x/svip/types/codec.go new file mode 100644 index 00000000..451bdb0d --- /dev/null +++ b/x/svip/types/codec.go @@ -0,0 +1,49 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + AminoCdc = codec.NewAminoCodec(amino) +) + +const ( + updateParamsName = "cosmos/evm/svip/MsgUpdateParams" + activateName = "cosmos/evm/svip/MsgActivate" + reactivateName = "cosmos/evm/svip/MsgReactivate" + pauseName = "cosmos/evm/svip/MsgPause" + fundPoolName = "cosmos/evm/svip/MsgFundPool" +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterInterfaces registers the SVIP module's interface types. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + &MsgActivate{}, + &MsgReactivate{}, + &MsgPause{}, + &MsgFundPool{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +// RegisterLegacyAminoCodec registers the SVIP module's types on the given LegacyAmino codec. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) + cdc.RegisterConcrete(&MsgActivate{}, activateName, nil) + cdc.RegisterConcrete(&MsgReactivate{}, reactivateName, nil) + cdc.RegisterConcrete(&MsgPause{}, pauseName, nil) + cdc.RegisterConcrete(&MsgFundPool{}, fundPoolName, nil) +} diff --git a/x/svip/types/errors.go b/x/svip/types/errors.go new file mode 100644 index 00000000..262d2536 --- /dev/null +++ b/x/svip/types/errors.go @@ -0,0 +1,14 @@ +package types + +import errorsmod "cosmossdk.io/errors" + +var ( + ErrNotActivated = errorsmod.Register(ModuleName, 2, "svip is not activated") + ErrPaused = errorsmod.Register(ModuleName, 3, "svip is paused") + ErrPoolExhausted = errorsmod.Register(ModuleName, 4, "svip pool is exhausted") + ErrInvalidAuthority = errorsmod.Register(ModuleName, 5, "invalid authority") + ErrAlreadyActivated = errorsmod.Register(ModuleName, 6, "svip is already activated") + ErrPoolNotFunded = errorsmod.Register(ModuleName, 7, "svip pool has no funds") + ErrNotYetActivated = errorsmod.Register(ModuleName, 8, "svip has not been activated yet") + ErrHalfLifeChange = errorsmod.Register(ModuleName, 9, "half_life_seconds change exceeds 50% limit") +) diff --git a/x/svip/types/expected_keepers.go b/x/svip/types/expected_keepers.go new file mode 100644 index 00000000..da3824ad --- /dev/null +++ b/x/svip/types/expected_keepers.go @@ -0,0 +1,20 @@ +package types + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper defines the expected bank keeper interface. +// In app.go, pass PreciseBankKeeper which implements this. +type BankKeeper interface { + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin +} + +// AccountKeeper defines the expected account keeper interface. +type AccountKeeper interface { + GetModuleAddress(moduleName string) sdk.AccAddress +} diff --git a/x/svip/types/genesis.pb.go b/x/svip/types/genesis.pb.go new file mode 100644 index 00000000..cbc3840d --- /dev/null +++ b/x/svip/types/genesis.pb.go @@ -0,0 +1,487 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/svip/v1/genesis.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 svip module's genesis state. +type GenesisState struct { + // params defines all the parameters of the svip module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // total_distributed is the cumulative tokens sent to FeeCollector. + TotalDistributed cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3,customtype=cosmossdk.io/math.Int" json:"total_distributed"` + // activation_time is when SVIP was activated. Zero if not yet activated. + ActivationTime time.Time `protobuf:"bytes,3,opt,name=activation_time,json=activationTime,proto3,stdtime" json:"activation_time"` + // pool_balance_at_activation is the pool snapshot used to derive R₀. + PoolBalanceAtActivation cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=pool_balance_at_activation,json=poolBalanceAtActivation,proto3,customtype=cosmossdk.io/math.Int" json:"pool_balance_at_activation"` +} + +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_61b7422785f20091, []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) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *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) GetActivationTime() time.Time { + if m != nil { + return m.ActivationTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.evm.svip.v1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/evm/svip/v1/genesis.proto", fileDescriptor_61b7422785f20091) } + +var fileDescriptor_61b7422785f20091 = []byte{ + // 374 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xe3, 0x40, + 0x14, 0xc7, 0x33, 0xdd, 0xa5, 0x6c, 0xb3, 0xcb, 0xee, 0x36, 0xec, 0xb2, 0x21, 0xd0, 0xa4, 0xf4, + 0x54, 0xf6, 0x30, 0x43, 0xf5, 0xaa, 0x87, 0x06, 0x41, 0x14, 0x04, 0xa9, 0x9e, 0x7a, 0x09, 0x93, + 0x74, 0x4c, 0x07, 0x33, 0x99, 0xd0, 0x79, 0x0d, 0xfa, 0x2d, 0xfa, 0x31, 0x3c, 0xfa, 0x21, 0x3c, + 0xf4, 0xd8, 0xa3, 0x78, 0xa8, 0xd2, 0x1e, 0xfc, 0x1a, 0x92, 0x4c, 0x6a, 0x05, 0x3d, 0x78, 0x19, + 0xde, 0xcc, 0xfb, 0xff, 0xde, 0xfc, 0xff, 0x3c, 0xb3, 0x1d, 0x49, 0x25, 0xa4, 0x22, 0x2c, 0x17, + 0x44, 0xe5, 0x3c, 0x23, 0x79, 0x8f, 0xc4, 0x2c, 0x65, 0x8a, 0x2b, 0x9c, 0x4d, 0x24, 0x48, 0xcb, + 0xd2, 0x0a, 0xcc, 0x72, 0x81, 0x0b, 0x05, 0xce, 0x7b, 0x4e, 0x93, 0x0a, 0x9e, 0x4a, 0x52, 0x9e, + 0x5a, 0xe6, 0xb4, 0x3e, 0x18, 0x54, 0xca, 0x75, 0xfb, 0x4f, 0x2c, 0x63, 0x59, 0x96, 0xa4, 0xa8, + 0xaa, 0x57, 0x2f, 0x96, 0x32, 0x4e, 0x18, 0x29, 0x6f, 0xe1, 0xf4, 0x82, 0x00, 0x17, 0x4c, 0x01, + 0x15, 0x15, 0xd6, 0xb9, 0xab, 0x99, 0x3f, 0x0e, 0xb5, 0x9d, 0x33, 0xa0, 0xc0, 0xac, 0x7d, 0xb3, + 0x9e, 0xd1, 0x09, 0x15, 0xca, 0x46, 0x6d, 0xd4, 0xfd, 0xbe, 0xe3, 0xe0, 0xf7, 0xf6, 0xf0, 0x69, + 0xa9, 0xf0, 0x1b, 0xf3, 0xa5, 0x67, 0xdc, 0x3c, 0xdf, 0xfe, 0x47, 0x83, 0x0a, 0xb2, 0x8e, 0xcd, + 0x26, 0x48, 0xa0, 0x49, 0x30, 0xe2, 0x0a, 0x26, 0x3c, 0x9c, 0x02, 0x1b, 0xd9, 0xb5, 0x36, 0xea, + 0x36, 0xfc, 0x56, 0xa1, 0x7e, 0x58, 0x7a, 0x7f, 0xf5, 0x40, 0x35, 0xba, 0xc4, 0x5c, 0x12, 0x41, + 0x61, 0x8c, 0x8f, 0x52, 0x18, 0xfc, 0x2e, 0xb9, 0x83, 0x2d, 0x66, 0x9d, 0x98, 0xbf, 0x68, 0x04, + 0x3c, 0xa7, 0xc0, 0x65, 0x1a, 0x14, 0xce, 0xed, 0x2f, 0x95, 0x27, 0x1d, 0x0b, 0x6f, 0x62, 0xe1, + 0xf3, 0x4d, 0x2c, 0xff, 0x5b, 0xf1, 0xcb, 0xec, 0xd1, 0x43, 0x83, 0x9f, 0x5b, 0xb8, 0x68, 0x5b, + 0x43, 0xd3, 0xc9, 0xa4, 0x4c, 0x82, 0x90, 0x26, 0x34, 0x8d, 0x58, 0x40, 0x21, 0xd8, 0x2a, 0xec, + 0xaf, 0x9f, 0xf1, 0xf8, 0xaf, 0x18, 0xe0, 0x6b, 0xbe, 0x0f, 0xfd, 0x57, 0xda, 0xdf, 0x9b, 0xaf, + 0x5c, 0xb4, 0x58, 0xb9, 0xe8, 0x69, 0xe5, 0xa2, 0xd9, 0xda, 0x35, 0x16, 0x6b, 0xd7, 0xb8, 0x5f, + 0xbb, 0xc6, 0xb0, 0x13, 0x73, 0x18, 0x4f, 0x43, 0x1c, 0x49, 0x41, 0xde, 0x6c, 0xf0, 0x4a, 0xef, + 0x10, 0xae, 0x33, 0xa6, 0xc2, 0x7a, 0x99, 0x63, 0xf7, 0x25, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x2d, + 0x35, 0x2c, 0x2c, 0x02, 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 := m.PoolBalanceAtActivation.Size() + i -= size + if _, err := m.PoolBalanceAtActivation.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + { + size := m.TotalDistributed.Size() + i -= size + if _, err := m.TotalDistributed.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + 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)) + l = m.TotalDistributed.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime) + n += 1 + l + sovGenesis(uint64(l)) + l = m.PoolBalanceAtActivation.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 TotalDistributed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalDistributed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ActivationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolBalanceAtActivation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolBalanceAtActivation.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/svip/types/genesis_logic.go b/x/svip/types/genesis_logic.go new file mode 100644 index 00000000..756faa86 --- /dev/null +++ b/x/svip/types/genesis_logic.go @@ -0,0 +1,28 @@ +package types + +import ( + "time" + + sdkmath "cosmossdk.io/math" +) + +// DefaultGenesisState returns the default SVIP genesis state. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + TotalDistributed: sdkmath.ZeroInt(), + ActivationTime: time.Time{}, + PoolBalanceAtActivation: sdkmath.ZeroInt(), + } +} + +// Validate performs basic genesis state validation. +func (gs GenesisState) Validate() error { + if err := gs.Params.Validate(); err != nil { + return err + } + if gs.TotalDistributed.IsNegative() { + return ErrPoolExhausted.Wrap("total_distributed cannot be negative") + } + return nil +} diff --git a/x/svip/types/keys.go b/x/svip/types/keys.go new file mode 100644 index 00000000..166c879e --- /dev/null +++ b/x/svip/types/keys.go @@ -0,0 +1,24 @@ +package types + +const ( + ModuleName = "svip" + StoreKey = ModuleName + RouterKey = ModuleName +) + +// KV store key prefixes +const ( + prefixParams = iota + 1 + prefixTotalDistributed + prefixActivationTime + prefixLastBlockTime + prefixPoolBalanceAtActivation +) + +var ( + ParamsKey = []byte{prefixParams} + TotalDistributedKey = []byte{prefixTotalDistributed} + ActivationTimeKey = []byte{prefixActivationTime} + LastBlockTimeKey = []byte{prefixLastBlockTime} + PoolBalanceAtActivationKey = []byte{prefixPoolBalanceAtActivation} +) diff --git a/x/svip/types/msgs.go b/x/svip/types/msgs.go new file mode 100644 index 00000000..1d9746ea --- /dev/null +++ b/x/svip/types/msgs.go @@ -0,0 +1,61 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgActivate{} + _ sdk.Msg = &MsgReactivate{} + _ sdk.Msg = &MsgPause{} + _ sdk.Msg = &MsgFundPool{} +) + +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return m.Params.Validate() +} + +func (m *MsgActivate) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgReactivate) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgPause) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgFundPool) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { + return errorsmod.Wrap(err, "invalid depositor address") + } + coins := sdk.Coins(m.Amount) + if !coins.IsValid() || coins.IsZero() { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "invalid fund amount") + } + return nil +} + +// GetSignBytes implementations for EIP-712 support +func (m MsgUpdateParams) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgActivate) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgReactivate) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgPause) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgFundPool) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } diff --git a/x/svip/types/params.go b/x/svip/types/params.go new file mode 100644 index 00000000..db20d5a2 --- /dev/null +++ b/x/svip/types/params.go @@ -0,0 +1,23 @@ +package types + +import "fmt" + +// DefaultParams returns the default SVIP module parameters. +func DefaultParams() Params { + return Params{ + Activated: false, + Paused: false, + HalfLifeSeconds: 0, // set on activation + } +} + +// Validate checks that the SVIP parameters are valid. +func (p Params) Validate() error { + if p.HalfLifeSeconds < 0 { + return fmt.Errorf("half_life_seconds cannot be negative: %d", p.HalfLifeSeconds) + } + if p.Activated && p.HalfLifeSeconds == 0 { + return fmt.Errorf("half_life_seconds must be set when activated") + } + return nil +} diff --git a/x/svip/types/query.pb.go b/x/svip/types/query.pb.go new file mode 100644 index 00000000..bc51abbf --- /dev/null +++ b/x/svip/types/query.pb.go @@ -0,0 +1,1128 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/svip/v1/query.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "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_cosmos_gogoproto_types "github.com/cosmos/gogoproto/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" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 defines the request type for querying x/svip parameters. +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_cc249c053fe9cff2, []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) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *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 defines the response type for querying x/svip parameters. +type QueryParamsResponse struct { + // params define the svip module parameters. + 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_cc249c053fe9cff2, []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) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *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{} +} + +// QueryPoolStateRequest defines the request type for querying pool state. +type QueryPoolStateRequest struct { +} + +func (m *QueryPoolStateRequest) Reset() { *m = QueryPoolStateRequest{} } +func (m *QueryPoolStateRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPoolStateRequest) ProtoMessage() {} +func (*QueryPoolStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc249c053fe9cff2, []int{2} +} +func (m *QueryPoolStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPoolStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPoolStateRequest.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 *QueryPoolStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPoolStateRequest.Merge(m, src) +} +func (m *QueryPoolStateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPoolStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPoolStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPoolStateRequest proto.InternalMessageInfo + +// QueryPoolStateResponse returns the current SVIP pool state. +type QueryPoolStateResponse struct { + // pool_balance is the current balance in the SVIP module account. + PoolBalance types.Coin `protobuf:"bytes,1,opt,name=pool_balance,json=poolBalance,proto3" json:"pool_balance"` + // total_distributed is cumulative tokens sent to FeeCollector. + TotalDistributed cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3,customtype=cosmossdk.io/math.Int" json:"total_distributed"` + // current_rate_per_second is the current reward rate after decay. + CurrentRatePerSecond cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=current_rate_per_second,json=currentRatePerSecond,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"current_rate_per_second"` + // activated indicates whether SVIP is active. + Activated bool `protobuf:"varint,4,opt,name=activated,proto3" json:"activated,omitempty"` + // paused indicates whether SVIP is paused. + Paused bool `protobuf:"varint,5,opt,name=paused,proto3" json:"paused,omitempty"` + // activation_time is when SVIP was activated. + ActivationTime time.Time `protobuf:"bytes,6,opt,name=activation_time,json=activationTime,proto3,stdtime" json:"activation_time"` +} + +func (m *QueryPoolStateResponse) Reset() { *m = QueryPoolStateResponse{} } +func (m *QueryPoolStateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPoolStateResponse) ProtoMessage() {} +func (*QueryPoolStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc249c053fe9cff2, []int{3} +} +func (m *QueryPoolStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPoolStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPoolStateResponse.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 *QueryPoolStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPoolStateResponse.Merge(m, src) +} +func (m *QueryPoolStateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPoolStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPoolStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPoolStateResponse proto.InternalMessageInfo + +func (m *QueryPoolStateResponse) GetPoolBalance() types.Coin { + if m != nil { + return m.PoolBalance + } + return types.Coin{} +} + +func (m *QueryPoolStateResponse) GetActivated() bool { + if m != nil { + return m.Activated + } + return false +} + +func (m *QueryPoolStateResponse) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +func (m *QueryPoolStateResponse) GetActivationTime() time.Time { + if m != nil { + return m.ActivationTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.evm.svip.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.evm.svip.v1.QueryParamsResponse") + proto.RegisterType((*QueryPoolStateRequest)(nil), "cosmos.evm.svip.v1.QueryPoolStateRequest") + proto.RegisterType((*QueryPoolStateResponse)(nil), "cosmos.evm.svip.v1.QueryPoolStateResponse") +} + +func init() { proto.RegisterFile("cosmos/evm/svip/v1/query.proto", fileDescriptor_cc249c053fe9cff2) } + +var fileDescriptor_cc249c053fe9cff2 = []byte{ + // 590 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xbb, 0x6e, 0xd4, 0x40, + 0x14, 0x5d, 0xe7, 0xb1, 0xca, 0x4e, 0x10, 0x90, 0x21, 0x8f, 0x65, 0x49, 0xbc, 0xab, 0x45, 0x0a, + 0x21, 0xc5, 0x8c, 0x36, 0xb4, 0xd0, 0x98, 0x34, 0x20, 0x90, 0x82, 0x93, 0x2a, 0x8d, 0x35, 0xf6, + 0x0e, 0xce, 0x88, 0xf5, 0x8c, 0xe3, 0x19, 0x5b, 0xa4, 0xa0, 0xa1, 0x83, 0x2a, 0x52, 0x7e, 0x82, + 0x92, 0xcf, 0x48, 0x19, 0x89, 0x06, 0x51, 0x04, 0x94, 0x20, 0xf1, 0x1b, 0x68, 0x1e, 0x26, 0x90, + 0x2c, 0x82, 0x66, 0x65, 0xdf, 0x73, 0xcf, 0xb9, 0xf7, 0xee, 0x39, 0x06, 0x7e, 0x22, 0x64, 0x26, + 0x24, 0xa6, 0x55, 0x86, 0x65, 0xc5, 0x72, 0x5c, 0x0d, 0xf0, 0x7e, 0x49, 0x8b, 0x03, 0x94, 0x17, + 0x42, 0x09, 0x08, 0x2d, 0x8e, 0x68, 0x95, 0x21, 0x8d, 0xa3, 0x6a, 0xd0, 0x99, 0x23, 0x19, 0xe3, + 0x02, 0x9b, 0x5f, 0xdb, 0xd6, 0x59, 0x19, 0x23, 0x63, 0xda, 0x2d, 0x3c, 0x9f, 0x8a, 0x54, 0x98, + 0x47, 0xac, 0x9f, 0x5c, 0x75, 0x39, 0x15, 0x22, 0x1d, 0x51, 0x4c, 0x72, 0x86, 0x09, 0xe7, 0x42, + 0x11, 0xc5, 0x04, 0x97, 0x0e, 0xed, 0x3a, 0xd4, 0xbc, 0xc5, 0xe5, 0x4b, 0xac, 0x58, 0x46, 0xa5, + 0x22, 0x59, 0x2d, 0x5a, 0xaf, 0x1e, 0x13, 0x49, 0x71, 0x35, 0x88, 0xa9, 0x22, 0x03, 0x9c, 0x08, + 0xc6, 0x2d, 0xde, 0x9f, 0x07, 0xf0, 0x85, 0xbe, 0x64, 0x8b, 0x14, 0x24, 0x93, 0x21, 0xdd, 0x2f, + 0xa9, 0x54, 0xfd, 0x1d, 0x70, 0xeb, 0x8f, 0xaa, 0xcc, 0x05, 0x97, 0x14, 0x3e, 0x02, 0xcd, 0xdc, + 0x54, 0xda, 0x5e, 0xcf, 0x5b, 0x9b, 0xdd, 0xe8, 0xa0, 0xab, 0x87, 0x23, 0xcb, 0x09, 0x5a, 0xc7, + 0xa7, 0xdd, 0xc6, 0x87, 0x1f, 0x1f, 0xd7, 0xbd, 0xd0, 0x91, 0xfa, 0x4b, 0x60, 0xc1, 0xaa, 0x0a, + 0x31, 0xda, 0x56, 0x44, 0xd1, 0x7a, 0xdc, 0xbb, 0x49, 0xb0, 0x78, 0x19, 0x71, 0x23, 0x03, 0x70, + 0x2d, 0x17, 0x62, 0x14, 0xc5, 0x64, 0x44, 0x78, 0x42, 0xdd, 0xe0, 0xdb, 0xf5, 0x60, 0x7d, 0x16, + 0x72, 0x67, 0xa1, 0xc7, 0x82, 0xf1, 0x60, 0x4a, 0xcf, 0x0d, 0x67, 0x35, 0x29, 0xb0, 0x1c, 0xf8, + 0x14, 0xcc, 0x29, 0xa1, 0xc8, 0x28, 0x1a, 0x32, 0xa9, 0x0a, 0x16, 0x97, 0x8a, 0x0e, 0xdb, 0x13, + 0x3d, 0x6f, 0xad, 0x15, 0xac, 0xe8, 0xee, 0x2f, 0xa7, 0xdd, 0x05, 0xab, 0x27, 0x87, 0xaf, 0x10, + 0x13, 0x38, 0x23, 0x6a, 0x0f, 0x3d, 0xe1, 0x2a, 0xbc, 0x69, 0x78, 0x9b, 0x17, 0x34, 0xb8, 0x0b, + 0x96, 0x92, 0xb2, 0x28, 0x28, 0x57, 0x51, 0x41, 0x14, 0x8d, 0x72, 0x5a, 0x44, 0x92, 0x26, 0x82, + 0x0f, 0xdb, 0x93, 0x46, 0xf1, 0xae, 0x53, 0xbc, 0x73, 0x55, 0xf1, 0x19, 0x4d, 0x49, 0x72, 0xb0, + 0x49, 0x93, 0x70, 0xde, 0x69, 0x84, 0x44, 0xd1, 0x2d, 0x5a, 0x6c, 0x1b, 0x01, 0xb8, 0x0c, 0x5a, + 0x24, 0x51, 0xac, 0x22, 0x7a, 0xbf, 0xa9, 0x9e, 0xb7, 0x36, 0x13, 0x5e, 0x14, 0xe0, 0xa2, 0xfe, + 0xf3, 0x4b, 0x49, 0x87, 0xed, 0x69, 0x03, 0xb9, 0x37, 0xf8, 0x1c, 0xdc, 0x70, 0x4d, 0x4c, 0xf0, + 0x48, 0xfb, 0xdf, 0x6e, 0x3a, 0x77, 0x6c, 0x38, 0x50, 0x1d, 0x0e, 0xb4, 0x53, 0x87, 0x23, 0x98, + 0xd1, 0x5b, 0x1e, 0x7e, 0xed, 0x7a, 0xe1, 0xf5, 0x0b, 0xb2, 0x86, 0x37, 0x8e, 0x26, 0xc0, 0xb4, + 0xf1, 0x02, 0xbe, 0x01, 0x4d, 0xeb, 0x25, 0x5c, 0x1d, 0xe7, 0xf3, 0xd5, 0xd8, 0x74, 0xee, 0xfd, + 0xb3, 0xcf, 0xba, 0xda, 0xef, 0xbf, 0xfd, 0xf4, 0xfd, 0x68, 0x62, 0x19, 0x76, 0xf0, 0x98, 0x4f, + 0xc2, 0xa6, 0x05, 0xbe, 0xf7, 0x40, 0xeb, 0x57, 0x1e, 0xe0, 0xfd, 0xbf, 0x4b, 0x5f, 0x4a, 0x53, + 0x67, 0xfd, 0x7f, 0x5a, 0xdd, 0x22, 0xab, 0x66, 0x91, 0x1e, 0xf4, 0xc7, 0x2e, 0xa2, 0x83, 0x27, + 0x75, 0x7f, 0xf0, 0xf0, 0xf8, 0xcc, 0xf7, 0x4e, 0xce, 0x7c, 0xef, 0xdb, 0x99, 0xef, 0x1d, 0x9e, + 0xfb, 0x8d, 0x93, 0x73, 0xbf, 0xf1, 0xf9, 0xdc, 0x6f, 0xec, 0xf6, 0x53, 0xa6, 0xf6, 0xca, 0x18, + 0x25, 0x22, 0xfb, 0x5d, 0xe3, 0xb5, 0x55, 0x51, 0x07, 0x39, 0x95, 0x71, 0xd3, 0x38, 0xf0, 0xe0, + 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xfb, 0xcd, 0x02, 0x48, 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 { + // Params queries the parameters of x/svip module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, 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, "/cosmos.evm.svip.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) { + out := new(QueryPoolStateResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Query/PoolState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the parameters of x/svip module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, 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) PoolState(ctx context.Context, req *QueryPoolStateRequest) (*QueryPoolStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolState 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: "/cosmos.evm.svip.v1.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_PoolState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PoolState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.svip.v1.Query/PoolState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolState(ctx, req.(*QueryPoolStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.svip.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "PoolState", + Handler: _Query_PoolState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/svip/v1/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 *QueryPoolStateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryPoolStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryPoolStateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryPoolStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Activated { + i-- + if m.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size := m.CurrentRatePerSecond.Size() + i -= size + if _, err := m.CurrentRatePerSecond.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.TotalDistributed.Size() + i -= size + if _, err := m.TotalDistributed.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.PoolBalance.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 *QueryPoolStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPoolStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PoolBalance.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.TotalDistributed.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.CurrentRatePerSecond.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.Activated { + n += 2 + } + if m.Paused { + n += 2 + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime) + 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 *QueryPoolStateRequest) Unmarshal(dAtA []byte) 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: QueryPoolStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolStateRequest: 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 *QueryPoolStateResponse) Unmarshal(dAtA []byte) 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: QueryPoolStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolBalance", 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.PoolBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", 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 + } + if err := m.TotalDistributed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRatePerSecond", 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 + } + if err := m.CurrentRatePerSecond.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Activated = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ActivationTime, 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/svip/types/query.pb.gw.go b/x/svip/types/query.pb.gw.go new file mode 100644 index 00000000..ca1d037a --- /dev/null +++ b/x/svip/types/query.pb.gw.go @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/evm/svip/v1/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_PoolState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPoolStateRequest + var metadata runtime.ServerMetadata + + msg, err := client.PoolState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PoolState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPoolStateRequest + var metadata runtime.ServerMetadata + + msg, err := server.PoolState(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_PoolState_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_PoolState_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_PoolState_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_PoolState_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_PoolState_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_PoolState_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, 2, 4}, []string{"cosmos", "evm", "svip", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_PoolState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "evm", "svip", "v1", "pool_state"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_PoolState_0 = runtime.ForwardResponseMessage +) diff --git a/x/svip/types/svip.pb.go b/x/svip/types/svip.pb.go new file mode 100644 index 00000000..ac874e5e --- /dev/null +++ b/x/svip/types/svip.pb.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/svip/v1/svip.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 x/svip module parameters. +type Params struct { + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,1,opt,name=activated,proto3" json:"activated"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused"` + // half_life_seconds is the half-life for exponential decay, in seconds. + HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds"` +} + +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_cb60517721160df2, []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) { + if deterministic { + return xxx_messageInfo_Params.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 *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) GetActivated() bool { + if m != nil { + return m.Activated + } + return false +} + +func (m *Params) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +func (m *Params) GetHalfLifeSeconds() int64 { + if m != nil { + return m.HalfLifeSeconds + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "cosmos.evm.svip.v1.Params") +} + +func init() { proto.RegisterFile("cosmos/evm/svip/v1/svip.proto", fileDescriptor_cb60517721160df2) } + +var fileDescriptor_cb60517721160df2 = []byte{ + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0x2e, 0xcb, 0x2c, 0xd0, 0x2f, 0x33, 0x04, 0xd3, + 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0x10, 0x69, 0xbd, 0xd4, 0xb2, 0x5c, 0x3d, 0xb0, + 0x70, 0x99, 0xa1, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x28, 0x93, 0x12, + 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0x88, 0xa8, 0xd2, 0x29, 0x46, 0x2e, 0xb6, + 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x03, 0x2e, 0xce, 0xc4, 0xe4, 0x92, 0xcc, 0xb2, 0xc4, + 0x92, 0xd4, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x0e, 0x27, 0xa1, 0x57, 0xf7, 0xe4, 0x11, 0x82, + 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0xf0, 0x85, 0xd4, 0xb9, 0xd8, 0x0a, 0x12, 0x4b, 0x8b, + 0x53, 0x53, 0x24, 0x98, 0xc0, 0xca, 0xf9, 0x5f, 0xdd, 0x93, 0x87, 0x8a, 0x40, 0xd4, 0x42, 0x39, + 0x42, 0x6e, 0x5c, 0x82, 0x19, 0x89, 0x39, 0x69, 0xf1, 0x39, 0x99, 0x69, 0xa9, 0xf1, 0xc5, 0xa9, + 0xc9, 0xf9, 0x79, 0x29, 0xc5, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xcc, 0x4e, 0x52, 0xaf, 0xee, 0xc9, + 0x63, 0x4a, 0x42, 0xb4, 0xf3, 0x83, 0xc4, 0x7d, 0x32, 0xd3, 0x52, 0x83, 0x21, 0xa2, 0x56, 0xb2, + 0x5d, 0xcf, 0x37, 0x68, 0x49, 0x20, 0x05, 0x47, 0x05, 0x24, 0x40, 0x20, 0x3e, 0x70, 0xb2, 0x39, + 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, + 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, + 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x4c, 0xed, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, + 0x10, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x10, 0x40, 0x86, 0x6f, 0x01, 0x00, 0x00, +} + +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.HalfLifeSeconds != 0 { + i = encodeVarintSvip(dAtA, i, uint64(m.HalfLifeSeconds)) + i-- + dAtA[i] = 0x18 + } + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Activated { + i-- + if m.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintSvip(dAtA []byte, offset int, v uint64) int { + offset -= sovSvip(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.Activated { + n += 2 + } + if m.Paused { + n += 2 + } + if m.HalfLifeSeconds != 0 { + n += 1 + sovSvip(uint64(m.HalfLifeSeconds)) + } + return n +} + +func sovSvip(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSvip(x uint64) (n int) { + return sovSvip(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 ErrIntOverflowSvip + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + 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 Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSvip + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Activated = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSvip + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) + } + m.HalfLifeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSvip + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HalfLifeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSvip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSvip + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSvip(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, ErrIntOverflowSvip + } + 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, ErrIntOverflowSvip + } + 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, ErrIntOverflowSvip + } + 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, ErrInvalidLengthSvip + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSvip + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSvip + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSvip = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSvip = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSvip = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/svip/types/tx.pb.go b/x/svip/types/tx.pb.go new file mode 100644 index 00000000..03a5539e --- /dev/null +++ b/x/svip/types/tx.pb.go @@ -0,0 +1,2037 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/svip/v1/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 defines a Msg for updating the x/svip module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/svip 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_ff92e457852a6541, []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 Params{} +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +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_ff92e457852a6541, []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 + +// MsgActivate activates SVIP reward distribution. Governance-only. +type MsgActivate struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgActivate) Reset() { *m = MsgActivate{} } +func (m *MsgActivate) String() string { return proto.CompactTextString(m) } +func (*MsgActivate) ProtoMessage() {} +func (*MsgActivate) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{2} +} +func (m *MsgActivate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgActivate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgActivate.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 *MsgActivate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgActivate.Merge(m, src) +} +func (m *MsgActivate) XXX_Size() int { + return m.Size() +} +func (m *MsgActivate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgActivate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgActivate proto.InternalMessageInfo + +func (m *MsgActivate) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgActivateResponse defines the response for MsgActivate. +type MsgActivateResponse struct { +} + +func (m *MsgActivateResponse) Reset() { *m = MsgActivateResponse{} } +func (m *MsgActivateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgActivateResponse) ProtoMessage() {} +func (*MsgActivateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{3} +} +func (m *MsgActivateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgActivateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgActivateResponse.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 *MsgActivateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgActivateResponse.Merge(m, src) +} +func (m *MsgActivateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgActivateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgActivateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgActivateResponse proto.InternalMessageInfo + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +type MsgReactivate struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgReactivate) Reset() { *m = MsgReactivate{} } +func (m *MsgReactivate) String() string { return proto.CompactTextString(m) } +func (*MsgReactivate) ProtoMessage() {} +func (*MsgReactivate) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{4} +} +func (m *MsgReactivate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReactivate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReactivate.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 *MsgReactivate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReactivate.Merge(m, src) +} +func (m *MsgReactivate) XXX_Size() int { + return m.Size() +} +func (m *MsgReactivate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReactivate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReactivate proto.InternalMessageInfo + +func (m *MsgReactivate) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgReactivateResponse defines the response for MsgReactivate. +type MsgReactivateResponse struct { +} + +func (m *MsgReactivateResponse) Reset() { *m = MsgReactivateResponse{} } +func (m *MsgReactivateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReactivateResponse) ProtoMessage() {} +func (*MsgReactivateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{5} +} +func (m *MsgReactivateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReactivateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReactivateResponse.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 *MsgReactivateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReactivateResponse.Merge(m, src) +} +func (m *MsgReactivateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReactivateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReactivateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReactivateResponse proto.InternalMessageInfo + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +type MsgPause struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // paused is the desired pause state. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (m *MsgPause) Reset() { *m = MsgPause{} } +func (m *MsgPause) String() string { return proto.CompactTextString(m) } +func (*MsgPause) ProtoMessage() {} +func (*MsgPause) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{6} +} +func (m *MsgPause) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPause) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPause.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 *MsgPause) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPause.Merge(m, src) +} +func (m *MsgPause) XXX_Size() int { + return m.Size() +} +func (m *MsgPause) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPause.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPause proto.InternalMessageInfo + +func (m *MsgPause) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgPause) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +// MsgPauseResponse defines the response for MsgPause. +type MsgPauseResponse struct { +} + +func (m *MsgPauseResponse) Reset() { *m = MsgPauseResponse{} } +func (m *MsgPauseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPauseResponse) ProtoMessage() {} +func (*MsgPauseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{7} +} +func (m *MsgPauseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPauseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPauseResponse.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 *MsgPauseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPauseResponse.Merge(m, src) +} +func (m *MsgPauseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPauseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPauseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPauseResponse proto.InternalMessageInfo + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +type MsgFundPool struct { + // depositor is the address funding the pool. + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount is the coins to transfer. Only the native denom is accepted. + Amount []types.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount"` +} + +func (m *MsgFundPool) Reset() { *m = MsgFundPool{} } +func (m *MsgFundPool) String() string { return proto.CompactTextString(m) } +func (*MsgFundPool) ProtoMessage() {} +func (*MsgFundPool) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{8} +} +func (m *MsgFundPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundPool.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 *MsgFundPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundPool.Merge(m, src) +} +func (m *MsgFundPool) XXX_Size() int { + return m.Size() +} +func (m *MsgFundPool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundPool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundPool proto.InternalMessageInfo + +func (m *MsgFundPool) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *MsgFundPool) GetAmount() []types.Coin { + if m != nil { + return m.Amount + } + return nil +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +type MsgFundPoolResponse struct { +} + +func (m *MsgFundPoolResponse) Reset() { *m = MsgFundPoolResponse{} } +func (m *MsgFundPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundPoolResponse) ProtoMessage() {} +func (*MsgFundPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ff92e457852a6541, []int{9} +} +func (m *MsgFundPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundPoolResponse.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 *MsgFundPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundPoolResponse.Merge(m, src) +} +func (m *MsgFundPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundPoolResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.evm.svip.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.evm.svip.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgActivate)(nil), "cosmos.evm.svip.v1.MsgActivate") + proto.RegisterType((*MsgActivateResponse)(nil), "cosmos.evm.svip.v1.MsgActivateResponse") + proto.RegisterType((*MsgReactivate)(nil), "cosmos.evm.svip.v1.MsgReactivate") + proto.RegisterType((*MsgReactivateResponse)(nil), "cosmos.evm.svip.v1.MsgReactivateResponse") + proto.RegisterType((*MsgPause)(nil), "cosmos.evm.svip.v1.MsgPause") + proto.RegisterType((*MsgPauseResponse)(nil), "cosmos.evm.svip.v1.MsgPauseResponse") + proto.RegisterType((*MsgFundPool)(nil), "cosmos.evm.svip.v1.MsgFundPool") + proto.RegisterType((*MsgFundPoolResponse)(nil), "cosmos.evm.svip.v1.MsgFundPoolResponse") +} + +func init() { proto.RegisterFile("cosmos/evm/svip/v1/tx.proto", fileDescriptor_ff92e457852a6541) } + +var fileDescriptor_ff92e457852a6541 = []byte{ + // 578 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0x8d, 0x1b, 0x35, 0x4a, 0x2e, 0xfc, 0x34, 0x2d, 0x49, 0x0c, 0xb8, 0x69, 0x40, 0x22, 0x04, + 0x61, 0x2b, 0x01, 0x31, 0x54, 0x65, 0x68, 0x90, 0x58, 0x90, 0xa5, 0xc8, 0x50, 0x21, 0x75, 0x81, + 0x4b, 0x7c, 0xba, 0x1a, 0x61, 0x9f, 0xe5, 0x3b, 0x5b, 0xed, 0x86, 0x18, 0x99, 0x90, 0xf8, 0x27, + 0x18, 0x33, 0x30, 0xb3, 0xb0, 0x74, 0xac, 0x98, 0x98, 0x10, 0x4a, 0x86, 0xfc, 0x1b, 0xc8, 0xbe, + 0xb3, 0xf3, 0xab, 0x26, 0xa8, 0x62, 0x89, 0xe2, 0x7b, 0xef, 0x7b, 0xef, 0xbb, 0xef, 0x7b, 0x3a, + 0x70, 0x63, 0x40, 0xa8, 0x43, 0xa8, 0x8e, 0x42, 0x47, 0xa7, 0xa1, 0xed, 0xe9, 0x61, 0x5b, 0x67, + 0x47, 0x9a, 0xe7, 0x13, 0x46, 0x64, 0x99, 0x83, 0x1a, 0x0a, 0x1d, 0x2d, 0x02, 0xb5, 0xb0, 0xad, + 0x5c, 0x85, 0x8e, 0xed, 0x12, 0x3d, 0xfe, 0xe5, 0x34, 0xe5, 0xd6, 0x19, 0x1a, 0x31, 0x9d, 0xc3, + 0x15, 0x01, 0x3b, 0x14, 0x47, 0x88, 0x43, 0xb1, 0x00, 0x6a, 0x1c, 0x78, 0x1d, 0x7f, 0xe9, 0xc2, + 0x8b, 0x43, 0x1b, 0x98, 0x60, 0xc2, 0xcf, 0xa3, 0x7f, 0xe2, 0x54, 0x15, 0x4a, 0x7d, 0x48, 0x91, + 0x1e, 0xb6, 0xfb, 0x88, 0xc1, 0xb6, 0x3e, 0x20, 0xb6, 0xcb, 0xf1, 0xc6, 0x37, 0x09, 0x5c, 0x36, + 0x28, 0xde, 0xf7, 0x2c, 0xc8, 0x50, 0x0f, 0xfa, 0xd0, 0xa1, 0xf2, 0x63, 0x50, 0x82, 0x01, 0x3b, + 0x24, 0xbe, 0xcd, 0x8e, 0xab, 0x52, 0x5d, 0x6a, 0x96, 0xba, 0xd5, 0x1f, 0x5f, 0x1f, 0x6c, 0x08, + 0xbb, 0x3d, 0xcb, 0xf2, 0x11, 0xa5, 0x2f, 0x98, 0x6f, 0xbb, 0xd8, 0x9c, 0x52, 0xe5, 0x27, 0xa0, + 0xe0, 0xc5, 0x0a, 0xd5, 0xb5, 0xba, 0xd4, 0x2c, 0x77, 0x14, 0x6d, 0x79, 0x18, 0x1a, 0xf7, 0xe8, + 0x96, 0x4e, 0x7e, 0x6d, 0xe5, 0xbe, 0x4c, 0x86, 0x2d, 0xc9, 0x14, 0x45, 0x3b, 0x8f, 0x3e, 0x4c, + 0x86, 0xad, 0xa9, 0xdc, 0xc7, 0xc9, 0xb0, 0xb5, 0x3d, 0x33, 0xa6, 0x23, 0x3e, 0xa8, 0x85, 0x66, + 0x1b, 0x35, 0x50, 0x59, 0x38, 0x32, 0x11, 0xf5, 0x88, 0x4b, 0x51, 0x63, 0x1f, 0x94, 0x0d, 0x8a, + 0xf7, 0x06, 0xcc, 0x0e, 0x21, 0x43, 0xe7, 0xbd, 0xd6, 0xce, 0xa5, 0xf9, 0xbe, 0x1a, 0x9b, 0xe0, + 0xda, 0x8c, 0x6c, 0xea, 0xf6, 0x0a, 0x5c, 0x34, 0x28, 0x36, 0x11, 0xfc, 0xdf, 0x7e, 0x15, 0xb0, + 0x39, 0x27, 0x9c, 0x3a, 0xbe, 0x05, 0x45, 0x83, 0xe2, 0x1e, 0x0c, 0xe8, 0xb9, 0xcd, 0xe4, 0xeb, + 0xd1, 0xce, 0x02, 0x8a, 0xac, 0x78, 0x67, 0x45, 0x53, 0x7c, 0x2d, 0x35, 0x21, 0x83, 0x2b, 0x89, + 0x57, 0xea, 0xff, 0x59, 0x8a, 0x07, 0xfc, 0x2c, 0x70, 0xad, 0x1e, 0x21, 0xef, 0xa2, 0x1e, 0x2c, + 0xe4, 0x11, 0x6a, 0x33, 0xe2, 0xaf, 0xee, 0x21, 0xa5, 0xca, 0xbb, 0xa0, 0x00, 0x1d, 0x12, 0xb8, + 0xac, 0xba, 0x56, 0xcf, 0x37, 0xcb, 0x9d, 0x5a, 0x92, 0x9b, 0x28, 0xb4, 0x9a, 0x08, 0xad, 0xf6, + 0x94, 0xd8, 0xee, 0x5c, 0x6c, 0x78, 0x8d, 0xe8, 0x34, 0x55, 0x13, 0xeb, 0x49, 0x9a, 0x4a, 0x9a, + 0xed, 0x7c, 0xcf, 0x83, 0xbc, 0x41, 0xb1, 0xfc, 0x06, 0x5c, 0x98, 0x0b, 0xfb, 0xed, 0xb3, 0x42, + 0xba, 0x90, 0x28, 0xe5, 0xfe, 0x3f, 0x90, 0x12, 0x27, 0xf9, 0x25, 0x28, 0xa6, 0x99, 0xdb, 0xca, + 0x28, 0x4c, 0x08, 0xca, 0xdd, 0x15, 0x84, 0x54, 0xf5, 0x00, 0x80, 0x99, 0x6c, 0x6d, 0x67, 0x94, + 0x4d, 0x29, 0xca, 0xbd, 0x95, 0x94, 0x54, 0xfb, 0x39, 0x58, 0xe7, 0x29, 0xba, 0x99, 0x51, 0x13, + 0xa3, 0xca, 0x9d, 0xbf, 0xa1, 0xb3, 0xd7, 0x4f, 0x13, 0x91, 0x75, 0xfd, 0x84, 0x90, 0x79, 0xfd, + 0xc5, 0xf5, 0x29, 0xeb, 0xef, 0xa3, 0xa5, 0x77, 0x77, 0x4f, 0x46, 0xaa, 0x74, 0x3a, 0x52, 0xa5, + 0xdf, 0x23, 0x55, 0xfa, 0x34, 0x56, 0x73, 0xa7, 0x63, 0x35, 0xf7, 0x73, 0xac, 0xe6, 0x0e, 0x1a, + 0xd8, 0x66, 0x87, 0x41, 0x5f, 0x1b, 0x10, 0x47, 0x5f, 0x7e, 0x35, 0xd8, 0xb1, 0x87, 0x68, 0xbf, + 0x10, 0xbf, 0x79, 0x0f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x7c, 0xc4, 0x2a, 0xc2, 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 updates the x/svip module parameters. Governance-only. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, 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, "/cosmos.evm.svip.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { + out := new(MsgActivateResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Activate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) { + out := new(MsgReactivateResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Reactivate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { + out := new(MsgPauseResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Pause", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) { + out := new(MsgFundPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/FundPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, 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) Activate(ctx context.Context, req *MsgActivate) (*MsgActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (*UnimplementedMsgServer) Reactivate(ctx context.Context, req *MsgReactivate) (*MsgReactivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reactivate not implemented") +} +func (*UnimplementedMsgServer) Pause(ctx context.Context, req *MsgPause) (*MsgPauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") +} +func (*UnimplementedMsgServer) FundPool(ctx context.Context, req *MsgFundPool) (*MsgFundPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundPool 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: "/cosmos.evm.svip.v1.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_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgActivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.svip.v1.Msg/Activate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Reactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReactivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Reactivate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.svip.v1.Msg/Reactivate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Reactivate(ctx, req.(*MsgReactivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Pause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.svip.v1.Msg/Pause", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.svip.v1.Msg/FundPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundPool(ctx, req.(*MsgFundPool)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.svip.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Activate", + Handler: _Msg_Activate_Handler, + }, + { + MethodName: "Reactivate", + Handler: _Msg_Reactivate_Handler, + }, + { + MethodName: "Pause", + Handler: _Msg_Pause_Handler, + }, + { + MethodName: "FundPool", + Handler: _Msg_FundPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/svip/v1/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 *MsgActivate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgActivate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgActivate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgActivateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgActivateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgActivateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgReactivate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReactivate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReactivate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgReactivateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReactivateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReactivateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPause) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPause) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPause) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + 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 *MsgPauseResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPauseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPauseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgFundPool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgFundPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFundPoolResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgFundPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundPoolResponse) 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 *MsgActivate) 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)) + } + return n +} + +func (m *MsgActivateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgReactivate) 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)) + } + return n +} + +func (m *MsgReactivateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPause) 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.Paused { + n += 2 + } + return n +} + +func (m *MsgPauseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgFundPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgFundPoolResponse) 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 *MsgActivate) Unmarshal(dAtA []byte) 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: MsgActivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgActivate: 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 + 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 *MsgActivateResponse) Unmarshal(dAtA []byte) 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: MsgActivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgActivateResponse: 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 *MsgReactivate) Unmarshal(dAtA []byte) 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: MsgReactivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReactivate: 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 + 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 *MsgReactivateResponse) Unmarshal(dAtA []byte) 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: MsgReactivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReactivateResponse: 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 *MsgPause) Unmarshal(dAtA []byte) 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: MsgPause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPause: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) + 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 *MsgPauseResponse) Unmarshal(dAtA []byte) 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: MsgPauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPauseResponse: 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 *MsgFundPool) Unmarshal(dAtA []byte) 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: MsgFundPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-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 *MsgFundPoolResponse) Unmarshal(dAtA []byte) 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: MsgFundPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundPoolResponse: 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") +) From b4cd3de980980f00a79b562ac7d825f97a871074 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 13:45:45 +0530 Subject: [PATCH 03/12] test(svip): add module tests --- x/svip/keeper/keeper_test.go | 246 ++++++++++++++++++++++++ x/svip/keeper/reward_test.go | 153 +++++++++++++++ x/svip/types/genesis_test.go | 74 +++++++ x/svip/types/mocks/MockAccountKeeper.go | 25 +++ x/svip/types/mocks/MockBankKeeper.go | 37 ++++ x/svip/types/msgs_test.go | 185 ++++++++++++++++++ x/svip/types/params_test.go | 64 ++++++ 7 files changed, 784 insertions(+) create mode 100644 x/svip/keeper/keeper_test.go create mode 100644 x/svip/keeper/reward_test.go create mode 100644 x/svip/types/genesis_test.go create mode 100644 x/svip/types/mocks/MockAccountKeeper.go create mode 100644 x/svip/types/mocks/MockBankKeeper.go create mode 100644 x/svip/types/msgs_test.go create mode 100644 x/svip/types/params_test.go diff --git a/x/svip/keeper/keeper_test.go b/x/svip/keeper/keeper_test.go new file mode 100644 index 00000000..e3948788 --- /dev/null +++ b/x/svip/keeper/keeper_test.go @@ -0,0 +1,246 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + evmencoding "github.com/cosmos/evm/encoding" + testconstants "github.com/cosmos/evm/testutil/constants" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + "github.com/cosmos/evm/x/svip/types/mocks" + vmtypes "github.com/cosmos/evm/x/vm/types" + + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + 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" +) + +type testData struct { + ctx sdk.Context + keeper keeper.Keeper + storeKey *storetypes.KVStoreKey + bk *mocks.BankKeeper + ak *mocks.AccountKeeper +} + +func newMockedTestData(t *testing.T) testData { + t.Helper() + + storeKey := storetypes.NewKVStoreKey(types.ModuleName) + tKey := storetypes.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) //nolint: staticcheck + + bk := mocks.NewBankKeeper(t) + ak := mocks.NewAccountKeeper(t) + + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + + chainID := testconstants.SixDecimalsChainID.EVMChainID + cfg := evmencoding.MakeConfig(chainID) + cdc := cfg.Codec + k := keeper.NewKeeper(cdc, storeKey, authority, bk, ak) //nolint: staticcheck + evmConfigurator := vmtypes.NewEVMConfigurator(). + WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.SixDecimalsChainID]) + evmConfigurator.ResetTestConfig() + err := evmConfigurator.Configure() + require.NoError(t, err) + + return testData{ + ctx: ctx, + keeper: k, + storeKey: storeKey, + bk: bk, + ak: ak, + } +} + +func TestGetSetParams(t *testing.T) { + td := newMockedTestData(t) + + // Default params when nothing set + params := td.keeper.GetParams(td.ctx) + require.Equal(t, types.DefaultParams(), params) + + // Set custom params and read back + custom := types.Params{ + Activated: true, + Paused: false, + HalfLifeSeconds: 31536000, + } + require.NoError(t, td.keeper.SetParams(td.ctx, custom)) + got := td.keeper.GetParams(td.ctx) + require.Equal(t, custom, got) +} + +func TestGetSetTotalDistributed(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero + require.True(t, td.keeper.GetTotalDistributed(td.ctx).IsZero()) + + // Set and read back + td.keeper.SetTotalDistributed(td.ctx, sdkmath.NewInt(500)) + require.Equal(t, sdkmath.NewInt(500), td.keeper.GetTotalDistributed(td.ctx)) + + // AddTotalDistributed accumulates + td.keeper.AddTotalDistributed(td.ctx, sdkmath.NewInt(300)) + require.Equal(t, sdkmath.NewInt(800), td.keeper.GetTotalDistributed(td.ctx)) +} + +func TestGetSetActivationTime(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero time + require.True(t, td.keeper.GetActivationTime(td.ctx).IsZero()) + + // Set and read back + now := time.Now().UTC().Truncate(time.Second) + td.keeper.SetActivationTime(td.ctx, now) + require.Equal(t, now, td.keeper.GetActivationTime(td.ctx).UTC().Truncate(time.Second)) +} + +func TestGetSetLastBlockTime(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero time + require.True(t, td.keeper.GetLastBlockTime(td.ctx).IsZero()) + + // Set and read back + now := time.Now().UTC().Truncate(time.Second) + td.keeper.SetLastBlockTime(td.ctx, now) + require.Equal(t, now, td.keeper.GetLastBlockTime(td.ctx).UTC().Truncate(time.Second)) +} + +func TestGetSetPoolBalanceAtActivation(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero + require.True(t, td.keeper.GetPoolBalanceAtActivation(td.ctx).IsZero()) + + // Set and read back + val := sdkmath.NewInt(1_000_000_000) + td.keeper.SetPoolBalanceAtActivation(td.ctx, val) + require.Equal(t, val, td.keeper.GetPoolBalanceAtActivation(td.ctx)) +} + +func TestBeginBlock_NotActivated(t *testing.T) { + td := newMockedTestData(t) + + // Default params: not activated — should skip without any bank calls + err := td.keeper.BeginBlock(td.ctx) + require.NoError(t, err) + + // Bank keeper should not have been called + td.bk.AssertNotCalled(t, "SendCoinsFromModuleToModule") +} + +func TestBeginBlock_Paused(t *testing.T) { + td := newMockedTestData(t) + + params := types.Params{Activated: true, Paused: true, HalfLifeSeconds: 31536000} + require.NoError(t, td.keeper.SetParams(td.ctx, params)) + + err := td.keeper.BeginBlock(td.ctx) + require.NoError(t, err) + + td.bk.AssertNotCalled(t, "SendCoinsFromModuleToModule") +} + +func TestBeginBlock_Distributes(t *testing.T) { + td := newMockedTestData(t) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000) + + // Set params as activated + params := types.Params{Activated: true, Paused: false, HalfLifeSeconds: halfLife} + require.NoError(t, td.keeper.SetParams(td.ctx, params)) + + // Set activation state + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetActivationTime(td.ctx, activationTime) + td.keeper.SetLastBlockTime(td.ctx, activationTime.Add(95*time.Second)) + td.keeper.SetPoolBalanceAtActivation(td.ctx, poolBalance) + + // Set block time to 100s after activation + blockTime := activationTime.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(blockTime) + + // Calculate expected reward + reward := keeper.CalculateBlockReward(halfLife, poolBalance, 100, 5) + require.True(t, reward.IsPositive()) + + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + // Mock: GetModuleAddress returns the svip module addr + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + // Mock: GetBalance returns the pool balance + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + // Mock: SendCoinsFromModuleToModule succeeds + td.bk.On("SendCoinsFromModuleToModule", + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, reward)), + ).Return(nil) + // Mock: GetBalance for post-distribution event (pool_remaining) + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance.Sub(reward))) + + err := td.keeper.BeginBlock(ctx) + require.NoError(t, err) + + // Verify bookkeeping + require.Equal(t, reward, td.keeper.GetTotalDistributed(ctx)) + require.Equal(t, blockTime, td.keeper.GetLastBlockTime(ctx).UTC()) + + td.bk.AssertCalled(t, "SendCoinsFromModuleToModule", + ctx, types.ModuleName, authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, reward)), + ) +} + +func TestBeginBlock_CapsAtPoolBalance(t *testing.T) { + td := newMockedTestData(t) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) + poolAtActivation := sdkmath.NewInt(1_000_000_000_000) + // Remaining pool balance is tiny — smaller than calculated reward + tinyBalance := sdkmath.NewInt(1) + + params := types.Params{Activated: true, Paused: false, HalfLifeSeconds: halfLife} + require.NoError(t, td.keeper.SetParams(td.ctx, params)) + + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetActivationTime(td.ctx, activationTime) + td.keeper.SetLastBlockTime(td.ctx, activationTime.Add(95*time.Second)) + td.keeper.SetPoolBalanceAtActivation(td.ctx, poolAtActivation) + + blockTime := activationTime.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(blockTime) + + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, tinyBalance)) + // The send should use tinyBalance (the cap), not the calculated reward + td.bk.On("SendCoinsFromModuleToModule", + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, tinyBalance)), + ).Return(nil) + + err := td.keeper.BeginBlock(ctx) + require.NoError(t, err) + + require.Equal(t, tinyBalance, td.keeper.GetTotalDistributed(ctx)) +} diff --git a/x/svip/keeper/reward_test.go b/x/svip/keeper/reward_test.go new file mode 100644 index 00000000..1589b12e --- /dev/null +++ b/x/svip/keeper/reward_test.go @@ -0,0 +1,153 @@ +package keeper_test + +import ( + "math" + "testing" + + "github.com/cosmos/evm/x/svip/keeper" + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" +) + +func TestCalculateBlockReward(t *testing.T) { + halfLife := int64(31536000) // 1 year in seconds + pool := sdkmath.NewInt(1_000_000_000_000) + + testCases := []struct { + name string + halfLifeSeconds int64 + poolAtActivation sdkmath.Int + totalElapsedSec float64 + blockDeltaSec float64 + expectZero bool + }{ + { + name: "zero pool balance", + halfLifeSeconds: halfLife, + poolAtActivation: sdkmath.ZeroInt(), + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "zero block delta", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 0, + expectZero: true, + }, + { + name: "negative block delta", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: -5, + expectZero: true, + }, + { + name: "negative elapsed", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: -100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "zero half_life", + halfLifeSeconds: 0, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "negative half_life", + halfLifeSeconds: -1, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "normal case - first block", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 5, + blockDeltaSec: 5, + expectZero: false, + }, + { + name: "normal case - mid life", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 1000, + blockDeltaSec: 5, + expectZero: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + reward := keeper.CalculateBlockReward( + tc.halfLifeSeconds, + tc.poolAtActivation, + tc.totalElapsedSec, + tc.blockDeltaSec, + ) + if tc.expectZero { + require.True(t, reward.IsZero(), "expected zero reward, got %s", reward) + } else { + require.True(t, reward.IsPositive(), "expected positive reward, got %s", reward) + } + }) + } +} + +func TestCalculateBlockReward_HalfLifeDecay(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000_000) // large pool for precision + blockDelta := float64(5) + + // Reward at t=0 + r0 := keeper.CalculateBlockReward(halfLife, pool, blockDelta, blockDelta) + require.True(t, r0.IsPositive()) + + // Reward at t=halfLife + rHalf := keeper.CalculateBlockReward(halfLife, pool, float64(halfLife), blockDelta) + require.True(t, rHalf.IsPositive()) + + // After one half-life, the rate should be ~half of the initial rate. + // Allow 5% tolerance for truncation. + r0Float := r0.ToLegacyDec().MustFloat64() + rHalfFloat := rHalf.ToLegacyDec().MustFloat64() + ratio := rHalfFloat / r0Float + require.InDelta(t, 0.5, ratio, 0.05, "reward after one half-life should be ~50%% of initial, got ratio %f", ratio) +} + +func TestCalculateBlockReward_VeryLargeElapsed(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000) + + // After 100 half-lives, reward should be effectively zero + elapsed := float64(halfLife) * 100 + reward := keeper.CalculateBlockReward(halfLife, pool, elapsed, 5) + require.True(t, reward.IsZero(), "reward after 100 half-lives should be zero, got %s", reward) +} + +func TestCalculateBlockReward_Monotonic(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000_000) + blockDelta := float64(5) + + // Rewards should decrease monotonically over time + var prev sdkmath.Int + for elapsed := float64(0); elapsed < float64(halfLife)*3; elapsed += float64(halfLife) / 10 { + r := keeper.CalculateBlockReward(halfLife, pool, math.Max(elapsed, blockDelta), blockDelta) + if !prev.IsNil() && prev.IsPositive() && r.IsPositive() { + require.True(t, r.LTE(prev), "reward should decrease: at elapsed=%f got %s > prev %s", elapsed, r, prev) + } + prev = r + } +} diff --git a/x/svip/types/genesis_test.go b/x/svip/types/genesis_test.go new file mode 100644 index 00000000..e4cb9b58 --- /dev/null +++ b/x/svip/types/genesis_test.go @@ -0,0 +1,74 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" +) + +type GenesisTestSuite struct { + suite.Suite +} + +func TestGenesisTestSuite(t *testing.T) { + suite.Run(t, new(GenesisTestSuite)) +} + +func (suite *GenesisTestSuite) TestDefaultGenesisState() { + gs := types.DefaultGenesisState() + suite.Require().NotNil(gs) + suite.Require().NoError(gs.Validate()) +} + +func (suite *GenesisTestSuite) TestGenesisStateValidate() { + testCases := []struct { + name string + genesis types.GenesisState + expError bool + }{ + { + "valid - default genesis", + *types.DefaultGenesisState(), + false, + }, + { + "valid - positive total_distributed", + types.GenesisState{ + Params: types.DefaultParams(), + TotalDistributed: sdkmath.NewInt(1000), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + false, + }, + { + "invalid - negative total_distributed", + types.GenesisState{ + Params: types.DefaultParams(), + TotalDistributed: sdkmath.NewInt(-1), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + true, + }, + { + "invalid - activated with half_life=0", + types.GenesisState{ + Params: types.Params{Activated: true, HalfLifeSeconds: 0}, + TotalDistributed: sdkmath.ZeroInt(), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + true, + }, + } + + for _, tc := range testCases { + err := tc.genesis.Validate() + if tc.expError { + suite.Require().Error(err, tc.name) + } else { + suite.Require().NoError(err, tc.name) + } + } +} diff --git a/x/svip/types/mocks/MockAccountKeeper.go b/x/svip/types/mocks/MockAccountKeeper.go new file mode 100644 index 00000000..58ea56a5 --- /dev/null +++ b/x/svip/types/mocks/MockAccountKeeper.go @@ -0,0 +1,25 @@ +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// AccountKeeper is a mock type for the AccountKeeper interface. +type AccountKeeper struct { + mock.Mock +} + +// NewAccountKeeper creates a new AccountKeeper mock and registers cleanup. +func NewAccountKeeper(t interface{ Cleanup(func()) }) *AccountKeeper { + m := &AccountKeeper{} + m.Mock.Test(nil) + t.Cleanup(func() { m.AssertExpectations(nil) }) + return m +} + +func (_m *AccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + ret := _m.Called(moduleName) + return ret.Get(0).(types.AccAddress) +} diff --git a/x/svip/types/mocks/MockBankKeeper.go b/x/svip/types/mocks/MockBankKeeper.go new file mode 100644 index 00000000..b5b2e883 --- /dev/null +++ b/x/svip/types/mocks/MockBankKeeper.go @@ -0,0 +1,37 @@ +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper is a mock type for the BankKeeper interface. +type BankKeeper struct { + mock.Mock +} + +// NewBankKeeper creates a new BankKeeper mock and registers cleanup. +func NewBankKeeper(t interface{ Cleanup(func()) }) *BankKeeper { + m := &BankKeeper{} + m.Mock.Test(nil) + t.Cleanup(func() { m.AssertExpectations(nil) }) + return m +} + +func (_m *BankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { + ret := _m.Called(ctx, senderModule, recipientModule, amt) + return ret.Error(0) +} + +func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + ret := _m.Called(ctx, senderAddr, recipientModule, amt) + return ret.Error(0) +} + +func (_m *BankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin { + ret := _m.Called(ctx, addr, denom) + return ret.Get(0).(types.Coin) +} diff --git a/x/svip/types/msgs_test.go b/x/svip/types/msgs_test.go new file mode 100644 index 00000000..9107be77 --- /dev/null +++ b/x/svip/types/msgs_test.go @@ -0,0 +1,185 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" + + 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" +) + +type MsgsTestSuite struct { + suite.Suite +} + +func TestMsgsTestSuite(t *testing.T) { + suite.Run(t, new(MsgsTestSuite)) +} + +func (suite *MsgsTestSuite) TestMsgUpdateParamsValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgUpdateParams + expPass bool + }{ + { + "fail - invalid authority", + &types.MsgUpdateParams{Authority: "invalid", Params: types.DefaultParams()}, + false, + }, + { + "fail - valid authority but invalid params", + &types.MsgUpdateParams{Authority: govAddr, Params: types.Params{Activated: true, HalfLifeSeconds: 0}}, + false, + }, + { + "pass - valid authority and params", + &types.MsgUpdateParams{Authority: govAddr, Params: types.DefaultParams()}, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgActivateValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgActivate + expPass bool + }{ + {"fail - invalid authority", &types.MsgActivate{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgActivate{Authority: govAddr}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgReactivateValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgReactivate + expPass bool + }{ + {"fail - invalid authority", &types.MsgReactivate{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgReactivate{Authority: govAddr}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgPauseValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgPause + expPass bool + }{ + {"fail - invalid authority", &types.MsgPause{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgPause{Authority: govAddr, Paused: true}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgFundPoolValidateBasic() { + validAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgFundPool + expPass bool + }{ + { + "fail - invalid depositor", + &types.MsgFundPool{ + Depositor: "invalid", + Amount: sdk.NewCoins(sdk.NewInt64Coin("aevmos", 1000)), + }, + false, + }, + { + "fail - zero coins", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.Coins{}, + }, + false, + }, + { + "fail - invalid coins (negative)", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.Coins{sdk.Coin{Denom: "aevmos", Amount: sdkmath.NewInt(-1)}}, + }, + false, + }, + { + "pass - valid msg", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.NewCoins(sdk.NewInt64Coin("aevmos", 1000)), + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} diff --git a/x/svip/types/params_test.go b/x/svip/types/params_test.go new file mode 100644 index 00000000..035fe7fd --- /dev/null +++ b/x/svip/types/params_test.go @@ -0,0 +1,64 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" +) + +type ParamsTestSuite struct { + suite.Suite +} + +func TestParamsTestSuite(t *testing.T) { + suite.Run(t, new(ParamsTestSuite)) +} + +func (suite *ParamsTestSuite) TestParamsValidate() { + testCases := []struct { + name string + params types.Params + expError bool + }{ + { + "default params valid", + types.DefaultParams(), + false, + }, + { + "negative half_life", + types.Params{HalfLifeSeconds: -1}, + true, + }, + { + "activated but half_life=0", + types.Params{Activated: true, HalfLifeSeconds: 0}, + true, + }, + { + "not activated, half_life=0", + types.Params{Activated: false, HalfLifeSeconds: 0}, + false, + }, + { + "valid activated params", + types.Params{Activated: true, HalfLifeSeconds: 31536000}, + false, + }, + { + "valid activated with paused", + types.Params{Activated: true, Paused: true, HalfLifeSeconds: 31536000}, + false, + }, + } + + for _, tc := range testCases { + err := tc.params.Validate() + if tc.expError { + suite.Require().Error(err, tc.name) + } else { + suite.Require().NoError(err, tc.name) + } + } +} From 3c3eff8c728cb4242664ff7de638df77836bd34f Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 13:45:50 +0530 Subject: [PATCH 04/12] chore(svip): wire module into app --- evmd/app.go | 30 +++++++++++++++++++++++++++++- evmd/config/permissions.go | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/evmd/app.go b/evmd/app.go index b92e46e5..0924bfbc 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -127,6 +127,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/evm/x/svip" + svipkeeper "github.com/cosmos/evm/x/svip/keeper" + sviptypes "github.com/cosmos/evm/x/svip/types" ) func init() { @@ -175,6 +178,7 @@ type EVMD struct { EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper + SvipKeeper svipkeeper.Keeper // IBC keepers IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly @@ -238,6 +242,7 @@ func NewExampleApp( ibcexported.StoreKey, ibctransfertypes.StoreKey, // Cosmos EVM store keys evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey, precisebanktypes.StoreKey, + sviptypes.StoreKey, ) oKeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey, evmtypes.ObjectKey) @@ -550,6 +555,14 @@ func NewExampleApp( tmLightClientModule := ibctm.NewLightClientModule(appCodec, storeProvider) clientKeeper.AddRoute(ibctm.ModuleName, &tmLightClientModule) + app.SvipKeeper = svipkeeper.NewKeeper( + appCodec, + keys[sviptypes.StoreKey], + authtypes.NewModuleAddress(govtypes.ModuleName), + app.PreciseBankKeeper, + app.AccountKeeper, + ) + // Override the ICS20 app module transferModule := transfer.NewAppModule(app.TransferKeeper) @@ -570,6 +583,7 @@ func NewExampleApp( slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil), + svip.NewAppModule(app.SvipKeeper), upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -617,6 +631,7 @@ func NewExampleApp( // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) app.ModuleManager.SetOrderBeginBlockers( minttypes.ModuleName, + sviptypes.ModuleName, // IBC modules ibcexported.ModuleName, ibctransfertypes.ModuleName, @@ -654,6 +669,7 @@ func NewExampleApp( feegrant.ModuleName, upgradetypes.ModuleName, consensusparamtypes.ModuleName, precisebanktypes.ModuleName, vestingtypes.ModuleName, + sviptypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -661,6 +677,7 @@ func NewExampleApp( // NOTE: The genutils module must also occur after auth so that it can access the params from auth. genesisModuleOrder := []string{ authtypes.ModuleName, banktypes.ModuleName, + sviptypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, ibcexported.ModuleName, @@ -1099,11 +1116,22 @@ func (app *EVMD) AutoCliOpts() autocli.AppOptions { } } - return autocli.AppOptions{ + opts := autocli.AppOptions{ Modules: modules, ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), AddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), ConsensusAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), } + + // Skip autocli for FundPool — it panics with repeated Coin fields. + // The manual CLI in x/svip/client/cli/tx.go handles it instead. + if svipOpts, ok := opts.ModuleOptions[sviptypes.ModuleName]; ok && svipOpts != nil && svipOpts.Tx != nil { + svipOpts.Tx.EnhanceCustomCommand = true + svipOpts.Tx.RpcCommandOptions = append(svipOpts.Tx.RpcCommandOptions, + &autocliv1.RpcCommandOptions{RpcMethod: "FundPool", Skip: true}, + ) + } + + return opts } diff --git a/evmd/config/permissions.go b/evmd/config/permissions.go index 2aa0d5fa..0adfcf73 100644 --- a/evmd/config/permissions.go +++ b/evmd/config/permissions.go @@ -13,6 +13,7 @@ import ( erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" precisebanktypes "github.com/cosmos/evm/x/precisebank/types" + sviptypes "github.com/cosmos/evm/x/svip/types" vmtypes "github.com/cosmos/evm/x/vm/types" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" corevm "github.com/ethereum/go-ethereum/core/vm" @@ -65,6 +66,7 @@ var maccPerms = map[string][]string{ feemarkettypes.ModuleName: nil, erc20types.ModuleName: {authtypes.Minter, authtypes.Burner}, precisebanktypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + sviptypes.ModuleName: nil, } // GetMaccPerms returns a copy of the module account permissions From dee36fcc9b7664a549ed9e9b6094ded1a0812bca Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 19:39:34 +0530 Subject: [PATCH 05/12] docs(svip): add SVIP module guide and proposal templates --- evmd/docs/SVIP.md | 392 +++++++++++++++++++++ evmd/docs/svip_activate_proposal.json | 11 + evmd/docs/svip_pause_proposal.json | 12 + evmd/docs/svip_reactivate_proposal.json | 11 + evmd/docs/svip_update_params_proposal.json | 16 + 5 files changed, 442 insertions(+) create mode 100644 evmd/docs/SVIP.md create mode 100644 evmd/docs/svip_activate_proposal.json create mode 100644 evmd/docs/svip_pause_proposal.json create mode 100644 evmd/docs/svip_reactivate_proposal.json create mode 100644 evmd/docs/svip_update_params_proposal.json diff --git a/evmd/docs/SVIP.md b/evmd/docs/SVIP.md new file mode 100644 index 00000000..aeebd01a --- /dev/null +++ b/evmd/docs/SVIP.md @@ -0,0 +1,392 @@ +# Sustained Validator Incentive Pool (SVIP) + +The SVIP module distributes rewards to validators from a pre-funded token pool using exponential decay. It deposits tokens into the FeeCollector every block, and the existing `x/distribution` module splits them across validators by voting power. + +There is no inflation. The pool is funded by bridging tokens from Base. + +Proposal templates: `evmd/docs/svip_update_params_proposal.json`, `evmd/docs/svip_activate_proposal.json` + +--- + +## How it works + +Every block, SVIP runs in the BeginBlocker: + +1. Reads the pool balance snapshot and time since activation. +2. Computes the reward using exponential decay: `reward = R₀ × e^(-λt) × Δt`. +3. Transfers the reward from the SVIP module account to the FeeCollector. +4. `x/distribution` picks it up and distributes to validators. + +The initial rate `R₀` is derived from the pool balance and half-life: `R₀ = (ln2 / half_life) × pool_balance`. This guarantees the pool never over-distributes — the total converges to exactly the pool size over infinite time. + +### `fund-pool` CLI + +- You cannot send tokens directly to the SVIP module address via `bank send` — it will fail with `unauthorized`. This is standard Cosmos SDK behavior for module accounts. +- Instead, use the dedicated command: `evmd tx svip fund-pool `. +- This command uses a manual CLI handler (not the SDK's auto-generated one) to avoid a known SDK compatibility issue. + +--- + +## Lifecycle + +``` +1. Genesis → SVIP module registered, pool empty, not activated +2. Fund pool → Bridge tokens from Base, call MsgFundPool +3. Set params → Governance sets half_life_seconds via MsgUpdateParams +4. Activate → Governance activates via MsgActivate +5. Rewards flow → Every block, decayed reward → FeeCollector → validators +6. (Optional) → Pause, unpause, reactivate after refund +``` + +--- + +## Prerequisites + +- A running node connected to the network. +- Access to a funded account for submitting proposals, and access to a validator key (or coordination with validators) for voting. +- The `evmd` binary installed. +- All token amounts are in base units with 18 decimals. To convert: multiply the token amount by 10^18. For example, 1000 tokens = `1000` followed by 18 zeros = `1000000000000000000000` ogwei. + +> **Devnet:** Start a local chain with `./local_node.sh -y`. This gives you home `~/.og-evm-devnet`, chain ID `10740`, and test keyring. `mykey` is the genesis validator. `dev0`-`dev3` are funded accounts. The voting period is 30 seconds. + +--- + +## Governance basics + +All SVIP operations except funding the pool require a governance proposal. + +1. A funded account **submits** a proposal with a deposit. +2. Validators (or their delegators) **vote** (yes / no / abstain / veto). +3. After the voting period, if quorum (33.4%) is met and >50% voted yes, the proposal **passes** and the message executes. +4. If >33.4% vote "NoWithVeto", the deposit is burned. Otherwise it is returned. + +**Finding the gov module address** (needed for all proposal templates): + +```bash +evmd q auth module-account gov +``` + +Look for the `address` field (e.g. `og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k`). Use this wherever you see `` in proposal templates. + +**Finding the minimum deposit** (needed for all proposals): + +```bash +evmd q gov params +``` + +Look for `min_deposit` — this is the minimum amount required for a proposal to enter the voting period. Use this value wherever you see `` in proposal templates. + +**Finding the proposal ID** after submitting: + +```bash +evmd q gov proposals +``` + +The last proposal in the list is yours. Note the `id` field — you will need it to vote. + +**If a proposal fails:** check the status with `evmd q gov proposal `. Common reasons: +- `PROPOSAL_STATUS_REJECTED` — not enough yes votes or quorum not met. +- `PROPOSAL_STATUS_FAILED` — the message execution failed (e.g. guardrail violation, empty pool). Submit a new corrected proposal. + +> **Devnet:** Add `--home ~/.og-evm-devnet` to all commands. Only `mykey` has staking power — use it for voting. Voting period is 30 seconds; vote immediately after submitting. + +--- + +## Step 1. Fund the pool + +Anyone can fund the pool. This is the only permissionless operation. On mainnet, tokens are bridged from Base via Hyperlane first, then the bridger calls `fund-pool`. + +```bash +evmd tx svip fund-pool \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +> **Devnet example** — fund 1000 tokens from dev0: +> ```bash +> evmd tx svip fund-pool 1000000000000000000000ogwei \ +> --from dev0 --home ~/.og-evm-devnet --chain-id 10740 \ +> --keyring-backend test --gas 200000 --gas-prices 10000000ogwei --yes +> ``` + +Verify: + +```bash +evmd q svip pool-state +``` + +You should see `pool_balance` showing your funded amount. The pool must be funded before activation — `MsgActivate` will reject if the balance is zero. + +--- + +## Step 2. Set half-life (governance) + +Before activation, you must set `half_life_seconds` via a governance proposal. The recommended value for mainnet is **15 years** (`473364000` seconds). The minimum allowed value is 1 year (`31536000` seconds). + +**2a.** Prepare the proposal file. Copy the template and fill in the gov module address: + +```bash +cp evmd/docs/svip_update_params_proposal.json /tmp/svip_set_params.json +``` + +Open `/tmp/svip_set_params.json` in any editor and replace `` with the address from the governance basics section. The file should look like: + +```json +{ + "messages": [ + { + "@type": "/cosmos.evm.svip.v1.MsgUpdateParams", + "authority": "og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k", + "params": { + "activated": false, + "paused": false, + "half_life_seconds": "473364000" + } + } + ], + "deposit": "", + "title": "Set SVIP half-life to 15 years", + "summary": "Configure the SVIP exponential decay half-life before activation." +} +``` + +**2b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_set_params.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**2c.** Find the proposal ID: + +```bash +evmd q gov proposals +``` + +**2d.** Coordinate with validators to vote yes before the voting period ends: + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**2e.** After the voting period ends, check the result: + +```bash +evmd q gov proposal +``` + +Status should be `PROPOSAL_STATUS_PASSED`. + +> **Devnet:** Use `--from mykey --home ~/.og-evm-devnet --chain-id 10740 --keyring-backend test --gas 300000 --gas-prices 10000000ogwei` for both submit and vote. Deposit is `10000000ogwei`. Wait ~35 seconds after voting. + +**Guardrails on UpdateParams:** +- Cannot set `activated` to `false` after activation (irreversible). +- `half_life_seconds` must be ≥ 1 year. +- `half_life_seconds` cannot change by more than 50% in a single proposal. + +--- + +## Step 3. Activate (governance) + +Activation snapshots the current pool balance and starts the decay curve. Requirements: +- `half_life_seconds` must be set (step 2). +- The pool must have a non-zero balance (step 1). +- This is a one-time operation — once activated, it cannot be deactivated. + +**3a.** Prepare the proposal file: + +```bash +cp evmd/docs/svip_activate_proposal.json /tmp/svip_activate.json +``` + +Open `/tmp/svip_activate.json` and replace `` with your gov address. + +**3b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_activate.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**3c.** Find the proposal ID: + +```bash +evmd q gov proposals +``` + +**3d.** Coordinate with validators to vote yes: + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**3e.** After the voting period, verify rewards are flowing: + +```bash +evmd q svip pool-state +``` + +You should see: +- `activated: true` +- `pool_balance` decreasing over time +- `total_distributed` increasing +- `current_rate_per_second` non-zero + +To confirm validators are receiving rewards: + +```bash +evmd q distribution rewards +``` + +You should see a non-zero `total` in ogwei. + +> **Devnet:** Use the same flags as step 2 devnet note. To quickly check rewards: +> ```bash +> ADDR=$(evmd keys show mykey -a --keyring-backend test --home ~/.og-evm-devnet) +> evmd q distribution rewards $ADDR --home ~/.og-evm-devnet +> ``` + +--- + +## Step 4. Pause / unpause (governance) + +Emergency pause stops all reward distribution immediately. When unpaused, the module skips the paused gap cleanly — there is no reward spike. + +**To pause:** + +**4a.** Prepare the proposal file: + +```bash +cp evmd/docs/svip_pause_proposal.json /tmp/svip_pause.json +``` + +Open `/tmp/svip_pause.json` and replace `` with your gov address. + +**4b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_pause.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**4c.** Find the proposal ID and coordinate voting: + +```bash +evmd q gov proposals +``` + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**4d.** After the voting period, verify: + +```bash +evmd q svip pool-state +``` + +You should see `paused: true`, `current_rate_per_second: 0`, and `total_distributed` frozen (query twice a few seconds apart — the number should not change). + +**To unpause:** edit `/tmp/svip_pause.json` and change `"paused": true` to `"paused": false`. Then repeat steps 4b through 4d. + +--- + +## Step 5. Reactivate (governance) + +If the pool runs out and is refunded, `MsgReactivate` restarts the decay curve with a fresh pool snapshot. It resets `ActivationTime` and `TotalDistributed` — the curve starts over as if freshly activated. + +This is needed because the decay formula derives the reward rate from the pool snapshot taken at activation. Without reactivation, refunded tokens would drain at the tail-end rate of the old curve (nearly zero). + +**5a.** Fund the pool again (step 1). + +**5b.** Prepare the proposal file: + +```bash +cp evmd/docs/svip_reactivate_proposal.json /tmp/svip_reactivate.json +``` + +Open `/tmp/svip_reactivate.json` and replace `` with your gov address. + +**5c.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_reactivate.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**5d.** Find the proposal ID and coordinate voting: + +```bash +evmd q gov proposals +``` + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**5e.** After the voting period, verify: + +```bash +evmd q svip pool-state +``` + +`activation_time` should show the current time (not the original), and `total_distributed` should be near zero (counting from the new curve). + +--- + +## Queries + +```bash +# Module parameters (activated, paused, half_life_seconds) +evmd q svip params + +# Pool state (balance, total distributed, current rate, activation time) +evmd q svip pool-state +``` + +> **Note:** `q svip params` may show `params: {}` when values are at defaults (false/0). This is cosmetic. The values are stored correctly — use `q svip pool-state` to confirm `activated: true` and see the current rate. + +--- + +## Reward math + +Rewards follow exponential decay — they start high and gradually decrease over time. With a 100M token pool and a 15-year half-life, roughly half the pool (50M) is distributed in the first 15 years. After 30 years, 75% is distributed. The rate slows down but never hits zero, and the pool can never over-distribute — the math guarantees total payouts converge to exactly the pool size. diff --git a/evmd/docs/svip_activate_proposal.json b/evmd/docs/svip_activate_proposal.json new file mode 100644 index 00000000..525adf03 --- /dev/null +++ b/evmd/docs/svip_activate_proposal.json @@ -0,0 +1,11 @@ +{ + "messages": [ + { + "@type": "/cosmos.evm.svip.v1.MsgActivate", + "authority": "" + } + ], + "deposit": "", + "title": "Activate SVIP reward distribution", + "summary": "Activate the Sustained Validator Incentive Pool. Snapshots the current pool balance and starts the exponential decay reward curve." +} diff --git a/evmd/docs/svip_pause_proposal.json b/evmd/docs/svip_pause_proposal.json new file mode 100644 index 00000000..eca7822b --- /dev/null +++ b/evmd/docs/svip_pause_proposal.json @@ -0,0 +1,12 @@ +{ + "messages": [ + { + "@type": "/cosmos.evm.svip.v1.MsgPause", + "authority": "", + "paused": true + } + ], + "deposit": "", + "title": "Pause SVIP", + "summary": "Emergency pause of SVIP reward distribution." +} diff --git a/evmd/docs/svip_reactivate_proposal.json b/evmd/docs/svip_reactivate_proposal.json new file mode 100644 index 00000000..b1c9e0d9 --- /dev/null +++ b/evmd/docs/svip_reactivate_proposal.json @@ -0,0 +1,11 @@ +{ + "messages": [ + { + "@type": "/cosmos.evm.svip.v1.MsgReactivate", + "authority": "" + } + ], + "deposit": "", + "title": "Reactivate SVIP with refunded pool", + "summary": "Re-snapshot the SVIP pool balance and restart the exponential decay curve. Use after the pool has been exhausted and refunded." +} diff --git a/evmd/docs/svip_update_params_proposal.json b/evmd/docs/svip_update_params_proposal.json new file mode 100644 index 00000000..f13873e9 --- /dev/null +++ b/evmd/docs/svip_update_params_proposal.json @@ -0,0 +1,16 @@ +{ + "messages": [ + { + "@type": "/cosmos.evm.svip.v1.MsgUpdateParams", + "authority": "", + "params": { + "activated": false, + "paused": false, + "half_life_seconds": "473364000" + } + } + ], + "deposit": "", + "title": "Set SVIP half-life to 15 years", + "summary": "Configure the SVIP exponential decay half-life before activation." +} From 6e572de236efd51ff7d239fa4e8356f176466790 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 23:45:45 +0530 Subject: [PATCH 06/12] feat(svip): restructure protos and add pause state --- api/cosmos/svip/v1/genesis.pulsar.go | 1003 ++++ api/cosmos/svip/v1/query.pulsar.go | 2292 +++++++++ api/cosmos/svip/v1/query_grpc.pb.go | 152 + api/cosmos/svip/v1/svip.pulsar.go | 692 +++ api/cosmos/svip/v1/tx.pulsar.go | 4826 ++++++++++++++++++ api/cosmos/svip/v1/tx_grpc.pb.go | 267 + proto/cosmos/{evm => }/svip/v1/genesis.proto | 8 +- proto/cosmos/{evm => }/svip/v1/query.proto | 8 +- proto/cosmos/{evm => }/svip/v1/svip.proto | 4 +- proto/cosmos/{evm => }/svip/v1/tx.proto | 6 +- x/svip/types/codec.go | 10 +- x/svip/types/genesis.pb.go | 161 +- x/svip/types/query.pb.go | 111 +- x/svip/types/query.pb.gw.go | 6 +- x/svip/types/svip.pb.go | 46 +- x/svip/types/tx.pb.go | 152 +- 16 files changed, 9534 insertions(+), 210 deletions(-) create mode 100644 api/cosmos/svip/v1/genesis.pulsar.go create mode 100644 api/cosmos/svip/v1/query.pulsar.go create mode 100644 api/cosmos/svip/v1/query_grpc.pb.go create mode 100644 api/cosmos/svip/v1/svip.pulsar.go create mode 100644 api/cosmos/svip/v1/tx.pulsar.go create mode 100644 api/cosmos/svip/v1/tx_grpc.pb.go rename proto/cosmos/{evm => }/svip/v1/genesis.proto (74%) rename proto/cosmos/{evm => }/svip/v1/query.proto (90%) rename proto/cosmos/{evm => }/svip/v1/svip.proto (89%) rename proto/cosmos/{evm => }/svip/v1/tx.proto (96%) diff --git a/api/cosmos/svip/v1/genesis.pulsar.go b/api/cosmos/svip/v1/genesis.pulsar.go new file mode 100644 index 00000000..87033e04 --- /dev/null +++ b/api/cosmos/svip/v1/genesis.pulsar.go @@ -0,0 +1,1003 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_total_distributed protoreflect.FieldDescriptor + fd_GenesisState_activation_time protoreflect.FieldDescriptor + fd_GenesisState_pool_balance_at_activation protoreflect.FieldDescriptor + fd_GenesisState_last_block_time protoreflect.FieldDescriptor + fd_GenesisState_total_paused_seconds protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_genesis_proto_init() + md_GenesisState = File_cosmos_svip_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_total_distributed = md_GenesisState.Fields().ByName("total_distributed") + fd_GenesisState_activation_time = md_GenesisState.Fields().ByName("activation_time") + fd_GenesisState_pool_balance_at_activation = md_GenesisState.Fields().ByName("pool_balance_at_activation") + fd_GenesisState_last_block_time = md_GenesisState.Fields().ByName("last_block_time") + fd_GenesisState_total_paused_seconds = md_GenesisState.Fields().ByName("total_paused_seconds") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_genesis_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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if x.TotalDistributed != "" { + value := protoreflect.ValueOfString(x.TotalDistributed) + if !f(fd_GenesisState_total_distributed, value) { + return + } + } + if x.ActivationTime != nil { + value := protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + if !f(fd_GenesisState_activation_time, value) { + return + } + } + if x.PoolBalanceAtActivation != "" { + value := protoreflect.ValueOfString(x.PoolBalanceAtActivation) + if !f(fd_GenesisState_pool_balance_at_activation, value) { + return + } + } + if x.LastBlockTime != nil { + value := protoreflect.ValueOfMessage(x.LastBlockTime.ProtoReflect()) + if !f(fd_GenesisState_last_block_time, value) { + return + } + } + if x.TotalPausedSeconds != int64(0) { + value := protoreflect.ValueOfInt64(x.TotalPausedSeconds) + if !f(fd_GenesisState_total_paused_seconds, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + return x.Params != nil + case "cosmos.svip.v1.GenesisState.total_distributed": + return x.TotalDistributed != "" + case "cosmos.svip.v1.GenesisState.activation_time": + return x.ActivationTime != nil + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + return x.PoolBalanceAtActivation != "" + case "cosmos.svip.v1.GenesisState.last_block_time": + return x.LastBlockTime != nil + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + return x.TotalPausedSeconds != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + x.Params = nil + case "cosmos.svip.v1.GenesisState.total_distributed": + x.TotalDistributed = "" + case "cosmos.svip.v1.GenesisState.activation_time": + x.ActivationTime = nil + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + x.PoolBalanceAtActivation = "" + case "cosmos.svip.v1.GenesisState.last_block_time": + x.LastBlockTime = nil + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + x.TotalPausedSeconds = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + value := x.TotalDistributed + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.GenesisState.activation_time": + value := x.ActivationTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + value := x.PoolBalanceAtActivation + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.GenesisState.last_block_time": + value := x.LastBlockTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + value := x.TotalPausedSeconds + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "cosmos.svip.v1.GenesisState.total_distributed": + x.TotalDistributed = value.Interface().(string) + case "cosmos.svip.v1.GenesisState.activation_time": + x.ActivationTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + x.PoolBalanceAtActivation = value.Interface().(string) + case "cosmos.svip.v1.GenesisState.last_block_time": + x.LastBlockTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + x.TotalPausedSeconds = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.activation_time": + if x.ActivationTime == nil { + x.ActivationTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.last_block_time": + if x.LastBlockTime == nil { + x.LastBlockTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.LastBlockTime.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + panic(fmt.Errorf("field total_distributed of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + panic(fmt.Errorf("field pool_balance_at_activation of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + panic(fmt.Errorf("field total_paused_seconds of message cosmos.svip.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.GenesisState.activation_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.GenesisState.last_block_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TotalDistributed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ActivationTime != nil { + l = options.Size(x.ActivationTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PoolBalanceAtActivation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastBlockTime != nil { + l = options.Size(x.LastBlockTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TotalPausedSeconds != 0 { + n += 1 + runtime.Sov(uint64(x.TotalPausedSeconds)) + } + 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().(*GenesisState) + 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.TotalPausedSeconds != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalPausedSeconds)) + i-- + dAtA[i] = 0x30 + } + if x.LastBlockTime != nil { + encoded, err := options.Marshal(x.LastBlockTime) + 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] = 0x2a + } + if len(x.PoolBalanceAtActivation) > 0 { + i -= len(x.PoolBalanceAtActivation) + copy(dAtA[i:], x.PoolBalanceAtActivation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PoolBalanceAtActivation))) + i-- + dAtA[i] = 0x22 + } + if x.ActivationTime != nil { + encoded, err := options.Marshal(x.ActivationTime) + 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] = 0x1a + } + if len(x.TotalDistributed) > 0 { + i -= len(x.TotalDistributed) + copy(dAtA[i:], x.TotalDistributed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TotalDistributed))) + i-- + dAtA[i] = 0x12 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.TotalDistributed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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.ActivationTime == nil { + x.ActivationTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ActivationTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PoolBalanceAtActivation", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.PoolBalanceAtActivation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastBlockTime", 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.LastBlockTime == nil { + x.LastBlockTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastBlockTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalPausedSeconds", wireType) + } + x.TotalPausedSeconds = 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.TotalPausedSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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: cosmos/svip/v1/genesis.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) +) + +// GenesisState defines the svip module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the svip module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // total_distributed is the cumulative tokens sent to FeeCollector. + TotalDistributed string `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3" json:"total_distributed,omitempty"` + // activation_time is when SVIP was activated. Zero if not yet activated. + ActivationTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=activation_time,json=activationTime,proto3" json:"activation_time,omitempty"` + // pool_balance_at_activation is the pool snapshot used to derive R₀. + PoolBalanceAtActivation string `protobuf:"bytes,4,opt,name=pool_balance_at_activation,json=poolBalanceAtActivation,proto3" json:"pool_balance_at_activation,omitempty"` + // last_block_time is the timestamp of the last processed block. + LastBlockTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3" json:"last_block_time,omitempty"` + // total_paused_seconds is the cumulative seconds spent in paused state. + TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetTotalDistributed() string { + if x != nil { + return x.TotalDistributed + } + return "" +} + +func (x *GenesisState) GetActivationTime() *timestamppb.Timestamp { + if x != nil { + return x.ActivationTime + } + return nil +} + +func (x *GenesisState) GetPoolBalanceAtActivation() string { + if x != nil { + return x.PoolBalanceAtActivation + } + return "" +} + +func (x *GenesisState) GetLastBlockTime() *timestamppb.Timestamp { + if x != nil { + return x.LastBlockTime + } + return nil +} + +func (x *GenesisState) GetTotalPausedSeconds() int64 { + if x != nil { + return x.TotalPausedSeconds + } + return 0 +} + +var File_cosmos_svip_v1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x76, 0x69, 0x70, 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, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x4a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x0f, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x1a, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x17, 0x70, + 0x6f, 0x6f, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x61, + 0x75, 0x73, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x75, 0x73, 0x65, 0x64, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x42, 0xa4, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, + 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_genesis_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_genesis_proto_rawDescData = file_cosmos_svip_v1_genesis_proto_rawDesc +) + +func file_cosmos_svip_v1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_genesis_proto_rawDescData) + }) + return file_cosmos_svip_v1_genesis_proto_rawDescData +} + +var file_cosmos_svip_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_svip_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cosmos.svip.v1.GenesisState + (*Params)(nil), // 1: cosmos.svip.v1.Params + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_cosmos_svip_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: cosmos.svip.v1.GenesisState.params:type_name -> cosmos.svip.v1.Params + 2, // 1: cosmos.svip.v1.GenesisState.activation_time:type_name -> google.protobuf.Timestamp + 2, // 2: cosmos.svip.v1.GenesisState.last_block_time:type_name -> google.protobuf.Timestamp + 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_cosmos_svip_v1_genesis_proto_init() } +func file_cosmos_svip_v1_genesis_proto_init() { + if File_cosmos_svip_v1_genesis_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); 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_cosmos_svip_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_svip_v1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_genesis_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_genesis_proto = out.File + file_cosmos_svip_v1_genesis_proto_rawDesc = nil + file_cosmos_svip_v1_genesis_proto_goTypes = nil + file_cosmos_svip_v1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/query.pulsar.go b/api/cosmos/svip/v1/query.pulsar.go new file mode 100644 index 00000000..7796bf26 --- /dev/null +++ b/api/cosmos/svip/v1/query.pulsar.go @@ -0,0 +1,2292 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryParamsRequest = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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.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().(*QueryParamsRequest) + 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 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryParamsResponse = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, 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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*QueryParamsResponse) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_QueryPoolStateRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryPoolStateRequest = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryPoolStateRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryPoolStateRequest)(nil) + +type fastReflection_QueryPoolStateRequest QueryPoolStateRequest + +func (x *QueryPoolStateRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPoolStateRequest)(x) +} + +func (x *QueryPoolStateRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_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_QueryPoolStateRequest_messageType fastReflection_QueryPoolStateRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryPoolStateRequest_messageType{} + +type fastReflection_QueryPoolStateRequest_messageType struct{} + +func (x fastReflection_QueryPoolStateRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPoolStateRequest)(nil) +} +func (x fastReflection_QueryPoolStateRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateRequest) +} +func (x fastReflection_QueryPoolStateRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPoolStateRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateRequest +} + +// 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_QueryPoolStateRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryPoolStateRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPoolStateRequest) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPoolStateRequest) Interface() protoreflect.ProtoMessage { + return (*QueryPoolStateRequest)(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_QueryPoolStateRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryPoolStateRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryPoolStateRequest", 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPoolStateRequest) + 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.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().(*QueryPoolStateRequest) + 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 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().(*QueryPoolStateRequest) + 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: QueryPoolStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPoolStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryPoolStateResponse protoreflect.MessageDescriptor + fd_QueryPoolStateResponse_pool_balance protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_total_distributed protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_current_rate_per_second protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_activated protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_paused protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_activation_time protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryPoolStateResponse = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryPoolStateResponse") + fd_QueryPoolStateResponse_pool_balance = md_QueryPoolStateResponse.Fields().ByName("pool_balance") + fd_QueryPoolStateResponse_total_distributed = md_QueryPoolStateResponse.Fields().ByName("total_distributed") + fd_QueryPoolStateResponse_current_rate_per_second = md_QueryPoolStateResponse.Fields().ByName("current_rate_per_second") + fd_QueryPoolStateResponse_activated = md_QueryPoolStateResponse.Fields().ByName("activated") + fd_QueryPoolStateResponse_paused = md_QueryPoolStateResponse.Fields().ByName("paused") + fd_QueryPoolStateResponse_activation_time = md_QueryPoolStateResponse.Fields().ByName("activation_time") +} + +var _ protoreflect.Message = (*fastReflection_QueryPoolStateResponse)(nil) + +type fastReflection_QueryPoolStateResponse QueryPoolStateResponse + +func (x *QueryPoolStateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPoolStateResponse)(x) +} + +func (x *QueryPoolStateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[3] + 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_QueryPoolStateResponse_messageType fastReflection_QueryPoolStateResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryPoolStateResponse_messageType{} + +type fastReflection_QueryPoolStateResponse_messageType struct{} + +func (x fastReflection_QueryPoolStateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPoolStateResponse)(nil) +} +func (x fastReflection_QueryPoolStateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateResponse) +} +func (x fastReflection_QueryPoolStateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPoolStateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateResponse +} + +// 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_QueryPoolStateResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryPoolStateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPoolStateResponse) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPoolStateResponse) Interface() protoreflect.ProtoMessage { + return (*QueryPoolStateResponse)(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_QueryPoolStateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PoolBalance != nil { + value := protoreflect.ValueOfMessage(x.PoolBalance.ProtoReflect()) + if !f(fd_QueryPoolStateResponse_pool_balance, value) { + return + } + } + if x.TotalDistributed != "" { + value := protoreflect.ValueOfString(x.TotalDistributed) + if !f(fd_QueryPoolStateResponse_total_distributed, value) { + return + } + } + if x.CurrentRatePerSecond != "" { + value := protoreflect.ValueOfString(x.CurrentRatePerSecond) + if !f(fd_QueryPoolStateResponse_current_rate_per_second, value) { + return + } + } + if x.Activated != false { + value := protoreflect.ValueOfBool(x.Activated) + if !f(fd_QueryPoolStateResponse_activated, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_QueryPoolStateResponse_paused, value) { + return + } + } + if x.ActivationTime != nil { + value := protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + if !f(fd_QueryPoolStateResponse_activation_time, 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_QueryPoolStateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + return x.PoolBalance != nil + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + return x.TotalDistributed != "" + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + return x.CurrentRatePerSecond != "" + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + return x.Activated != false + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + return x.Paused != false + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + return x.ActivationTime != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + x.PoolBalance = nil + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + x.TotalDistributed = "" + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + x.CurrentRatePerSecond = "" + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + x.Activated = false + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + x.Paused = false + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + x.ActivationTime = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + value := x.PoolBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + value := x.TotalDistributed + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + value := x.CurrentRatePerSecond + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + value := x.Activated + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + value := x.ActivationTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + x.PoolBalance = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + x.TotalDistributed = value.Interface().(string) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + x.CurrentRatePerSecond = value.Interface().(string) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + x.Activated = value.Bool() + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + x.Paused = value.Bool() + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + x.ActivationTime = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + if x.PoolBalance == nil { + x.PoolBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.PoolBalance.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + if x.ActivationTime == nil { + x.ActivationTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + panic(fmt.Errorf("field total_distributed of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + panic(fmt.Errorf("field current_rate_per_second of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + panic(fmt.Errorf("field activated of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryPoolStateResponse", 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPoolStateResponse) + 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.PoolBalance != nil { + l = options.Size(x.PoolBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TotalDistributed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CurrentRatePerSecond) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Activated { + n += 2 + } + if x.Paused { + n += 2 + } + if x.ActivationTime != nil { + l = options.Size(x.ActivationTime) + 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().(*QueryPoolStateResponse) + 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.ActivationTime != nil { + encoded, err := options.Marshal(x.ActivationTime) + 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] = 0x32 + } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.Activated { + i-- + if x.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(x.CurrentRatePerSecond) > 0 { + i -= len(x.CurrentRatePerSecond) + copy(dAtA[i:], x.CurrentRatePerSecond) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentRatePerSecond))) + i-- + dAtA[i] = 0x1a + } + if len(x.TotalDistributed) > 0 { + i -= len(x.TotalDistributed) + copy(dAtA[i:], x.TotalDistributed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TotalDistributed))) + i-- + dAtA[i] = 0x12 + } + if x.PoolBalance != nil { + encoded, err := options.Marshal(x.PoolBalance) + 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().(*QueryPoolStateResponse) + 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: QueryPoolStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPoolStateResponse: 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 PoolBalance", 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.PoolBalance == nil { + x.PoolBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PoolBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.TotalDistributed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentRatePerSecond", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.CurrentRatePerSecond = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Activated = bool(v != 0) + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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.ActivationTime == nil { + x.ActivationTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ActivationTime); 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: cosmos/svip/v1/query.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) +) + +// QueryParamsRequest defines the request type for querying x/svip parameters. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse defines the response type for querying x/svip parameters. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params define the svip module parameters. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryPoolStateRequest defines the request type for querying pool state. +type QueryPoolStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryPoolStateRequest) Reset() { + *x = QueryPoolStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPoolStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPoolStateRequest) ProtoMessage() {} + +// Deprecated: Use QueryPoolStateRequest.ProtoReflect.Descriptor instead. +func (*QueryPoolStateRequest) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{2} +} + +// QueryPoolStateResponse returns the current SVIP pool state. +type QueryPoolStateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pool_balance is the current balance in the SVIP module account. + PoolBalance *v1beta1.Coin `protobuf:"bytes,1,opt,name=pool_balance,json=poolBalance,proto3" json:"pool_balance,omitempty"` + // total_distributed is cumulative tokens sent to FeeCollector. + TotalDistributed string `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3" json:"total_distributed,omitempty"` + // current_rate_per_second is the current reward rate after decay. + CurrentRatePerSecond string `protobuf:"bytes,3,opt,name=current_rate_per_second,json=currentRatePerSecond,proto3" json:"current_rate_per_second,omitempty"` + // activated indicates whether SVIP is active. + Activated bool `protobuf:"varint,4,opt,name=activated,proto3" json:"activated,omitempty"` + // paused indicates whether SVIP is paused. + Paused bool `protobuf:"varint,5,opt,name=paused,proto3" json:"paused,omitempty"` + // activation_time is when SVIP was activated. + ActivationTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=activation_time,json=activationTime,proto3" json:"activation_time,omitempty"` +} + +func (x *QueryPoolStateResponse) Reset() { + *x = QueryPoolStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPoolStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPoolStateResponse) ProtoMessage() {} + +// Deprecated: Use QueryPoolStateResponse.ProtoReflect.Descriptor instead. +func (*QueryPoolStateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryPoolStateResponse) GetPoolBalance() *v1beta1.Coin { + if x != nil { + return x.PoolBalance + } + return nil +} + +func (x *QueryPoolStateResponse) GetTotalDistributed() string { + if x != nil { + return x.TotalDistributed + } + return "" +} + +func (x *QueryPoolStateResponse) GetCurrentRatePerSecond() string { + if x != nil { + return x.CurrentRatePerSecond + } + return "" +} + +func (x *QueryPoolStateResponse) GetActivated() bool { + if x != nil { + return x.Activated + } + return false +} + +func (x *QueryPoolStateResponse) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +func (x *QueryPoolStateResponse) GetActivationTime() *timestamppb.Timestamp { + if x != nil { + return x.ActivationTime + } + return nil +} + +var File_cosmos_svip_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x76, 0x69, 0x70, 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, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x89, 0x03, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0b, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x4a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, 0x5a, 0x0a, 0x17, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, + 0x63, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x50, 0x65, + 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x12, 0x4d, 0x0a, + 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x32, 0xfa, 0x01, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x71, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x12, 0x16, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x7e, 0x0a, 0x09, 0x50, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0xa2, 0x01, 0x0a, 0x12, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, + 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_query_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_query_proto_rawDescData = file_cosmos_svip_v1_query_proto_rawDesc +) + +func file_cosmos_svip_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_query_proto_rawDescData) + }) + return file_cosmos_svip_v1_query_proto_rawDescData +} + +var file_cosmos_svip_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_svip_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: cosmos.svip.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: cosmos.svip.v1.QueryParamsResponse + (*QueryPoolStateRequest)(nil), // 2: cosmos.svip.v1.QueryPoolStateRequest + (*QueryPoolStateResponse)(nil), // 3: cosmos.svip.v1.QueryPoolStateResponse + (*Params)(nil), // 4: cosmos.svip.v1.Params + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_cosmos_svip_v1_query_proto_depIdxs = []int32{ + 4, // 0: cosmos.svip.v1.QueryParamsResponse.params:type_name -> cosmos.svip.v1.Params + 5, // 1: cosmos.svip.v1.QueryPoolStateResponse.pool_balance:type_name -> cosmos.base.v1beta1.Coin + 6, // 2: cosmos.svip.v1.QueryPoolStateResponse.activation_time:type_name -> google.protobuf.Timestamp + 0, // 3: cosmos.svip.v1.Query.Params:input_type -> cosmos.svip.v1.QueryParamsRequest + 2, // 4: cosmos.svip.v1.Query.PoolState:input_type -> cosmos.svip.v1.QueryPoolStateRequest + 1, // 5: cosmos.svip.v1.Query.Params:output_type -> cosmos.svip.v1.QueryParamsResponse + 3, // 6: cosmos.svip.v1.Query.PoolState:output_type -> cosmos.svip.v1.QueryPoolStateResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] 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_cosmos_svip_v1_query_proto_init() } +func file_cosmos_svip_v1_query_proto_init() { + if File_cosmos_svip_v1_query_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPoolStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPoolStateResponse); 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_cosmos_svip_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_svip_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_query_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_query_proto = out.File + file_cosmos_svip_v1_query_proto_rawDesc = nil + file_cosmos_svip_v1_query_proto_goTypes = nil + file_cosmos_svip_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/query_grpc.pb.go b/api/cosmos/svip/v1/query_grpc.pb.go new file mode 100644 index 00000000..053061b4 --- /dev/null +++ b/api/cosmos/svip/v1/query_grpc.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/svip/v1/query.proto + +package svipv1 + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/cosmos.svip.v1.Query/Params" + Query_PoolState_FullMethodName = "/cosmos.svip.v1.Query/PoolState" +) + +// 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. +type QueryClient interface { + // Params queries the parameters of x/svip module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, 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) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) { + out := new(QueryPoolStateResponse) + err := c.cc.Invoke(ctx, Query_PoolState_FullMethodName, in, out, opts...) + 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 +type QueryServer interface { + // Params queries the parameters of x/svip module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, 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) PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolState 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_PoolState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PoolState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_PoolState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolState(ctx, req.(*QueryPoolStateRequest)) + } + 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: "cosmos.svip.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "PoolState", + Handler: _Query_PoolState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/query.proto", +} diff --git a/api/cosmos/svip/v1/svip.pulsar.go b/api/cosmos/svip/v1/svip.pulsar.go new file mode 100644 index 00000000..2306887a --- /dev/null +++ b/api/cosmos/svip/v1/svip.pulsar.go @@ -0,0 +1,692 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + 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_Params protoreflect.MessageDescriptor + fd_Params_activated protoreflect.FieldDescriptor + fd_Params_paused protoreflect.FieldDescriptor + fd_Params_half_life_seconds protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_svip_proto_init() + md_Params = File_cosmos_svip_v1_svip_proto.Messages().ByName("Params") + fd_Params_activated = md_Params.Fields().ByName("activated") + fd_Params_paused = md_Params.Fields().ByName("paused") + fd_Params_half_life_seconds = md_Params.Fields().ByName("half_life_seconds") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_svip_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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Activated != false { + value := protoreflect.ValueOfBool(x.Activated) + if !f(fd_Params_activated, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_Params_paused, value) { + return + } + } + if x.HalfLifeSeconds != int64(0) { + value := protoreflect.ValueOfInt64(x.HalfLifeSeconds) + if !f(fd_Params_half_life_seconds, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.Params.activated": + return x.Activated != false + case "cosmos.svip.v1.Params.paused": + return x.Paused != false + case "cosmos.svip.v1.Params.half_life_seconds": + return x.HalfLifeSeconds != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.Params.activated": + x.Activated = false + case "cosmos.svip.v1.Params.paused": + x.Paused = false + case "cosmos.svip.v1.Params.half_life_seconds": + x.HalfLifeSeconds = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.Params.activated": + value := x.Activated + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.Params.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.Params.half_life_seconds": + value := x.HalfLifeSeconds + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.Params.activated": + x.Activated = value.Bool() + case "cosmos.svip.v1.Params.paused": + x.Paused = value.Bool() + case "cosmos.svip.v1.Params.half_life_seconds": + x.HalfLifeSeconds = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.Params.activated": + panic(fmt.Errorf("field activated of message cosmos.svip.v1.Params is not mutable")) + case "cosmos.svip.v1.Params.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.Params is not mutable")) + case "cosmos.svip.v1.Params.half_life_seconds": + panic(fmt.Errorf("field half_life_seconds of message cosmos.svip.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.Params.activated": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.Params.paused": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.Params.half_life_seconds": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + 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.Activated { + n += 2 + } + if x.Paused { + n += 2 + } + if x.HalfLifeSeconds != 0 { + n += 1 + runtime.Sov(uint64(x.HalfLifeSeconds)) + } + 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().(*Params) + 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.HalfLifeSeconds != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.HalfLifeSeconds)) + i-- + dAtA[i] = 0x18 + } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if x.Activated { + i-- + if x.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + 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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Activated = bool(v != 0) + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) + } + x.HalfLifeSeconds = 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.HalfLifeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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: cosmos/svip/v1/svip.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) +) + +// Params defines the x/svip module parameters. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,1,opt,name=activated,proto3" json:"activated,omitempty"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` + // half_life_seconds is the half-life for exponential decay, in seconds. + HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_svip_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_svip_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetActivated() bool { + if x != nil { + return x.Activated + } + return false +} + +func (x *Params) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +func (x *Params) GetHalfLifeSeconds() int64 { + if x != nil { + return x.HalfLifeSeconds + } + return 0 +} + +var File_cosmos_svip_v1_svip_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_svip_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 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, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x30, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x27, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x11, 0x68, 0x61, + 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x11, 0x68, 0x61, 0x6c, 0x66, 0x5f, + 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0f, 0x68, 0x61, 0x6c, 0x66, 0x4c, 0x69, 0x66, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x3a, 0x19, 0x8a, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa1, 0x01, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, + 0x70, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x53, 0x76, 0x69, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, + 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, + 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_svip_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_svip_proto_rawDescData = file_cosmos_svip_v1_svip_proto_rawDesc +) + +func file_cosmos_svip_v1_svip_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_svip_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_svip_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_svip_proto_rawDescData) + }) + return file_cosmos_svip_v1_svip_proto_rawDescData +} + +var file_cosmos_svip_v1_svip_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_svip_v1_svip_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: cosmos.svip.v1.Params +} +var file_cosmos_svip_v1_svip_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_svip_proto_init() } +func file_cosmos_svip_v1_svip_proto_init() { + if File_cosmos_svip_v1_svip_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_svip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); 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_cosmos_svip_v1_svip_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_svip_v1_svip_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_svip_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_svip_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_svip_proto = out.File + file_cosmos_svip_v1_svip_proto_rawDesc = nil + file_cosmos_svip_v1_svip_proto_goTypes = nil + file_cosmos_svip_v1_svip_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/tx.pulsar.go b/api/cosmos/svip/v1/tx.pulsar.go new file mode 100644 index 00000000..437d2278 --- /dev/null +++ b/api/cosmos/svip/v1/tx.pulsar.go @@ -0,0 +1,4826 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + 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_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.svip.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.svip.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.svip.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.svip.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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.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().(*MsgUpdateParamsResponse) + 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 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgActivate protoreflect.MessageDescriptor + fd_MsgActivate_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgActivate = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgActivate") + fd_MsgActivate_authority = md_MsgActivate.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivate)(nil) + +type fastReflection_MsgActivate MsgActivate + +func (x *MsgActivate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivate)(x) +} + +func (x *MsgActivate) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_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_MsgActivate_messageType fastReflection_MsgActivate_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivate_messageType{} + +type fastReflection_MsgActivate_messageType struct{} + +func (x fastReflection_MsgActivate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivate)(nil) +} +func (x fastReflection_MsgActivate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} +func (x fastReflection_MsgActivate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// 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_MsgActivate) Type() protoreflect.MessageType { + return _fastReflection_MsgActivate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivate) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivate) Interface() protoreflect.ProtoMessage { + return (*MsgActivate)(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_MsgActivate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgActivate_authority, 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_MsgActivate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgActivate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgActivate", 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivate) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + 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().(*MsgActivate) + 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 len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgActivate) + 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: MsgActivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivate: 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 Authority", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.Authority = string(dAtA[iNdEx:postIndex]) + 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_MsgActivateResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgActivateResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgActivateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivateResponse)(nil) + +type fastReflection_MsgActivateResponse MsgActivateResponse + +func (x *MsgActivateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(x) +} + +func (x *MsgActivateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[3] + 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_MsgActivateResponse_messageType fastReflection_MsgActivateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivateResponse_messageType{} + +type fastReflection_MsgActivateResponse_messageType struct{} + +func (x fastReflection_MsgActivateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(nil) +} +func (x fastReflection_MsgActivateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} +func (x fastReflection_MsgActivateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// 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_MsgActivateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgActivateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivateResponse) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgActivateResponse)(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_MsgActivateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgActivateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgActivateResponse", 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivateResponse) + 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.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().(*MsgActivateResponse) + 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 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().(*MsgActivateResponse) + 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: MsgActivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgReactivate protoreflect.MessageDescriptor + fd_MsgReactivate_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgReactivate = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgReactivate") + fd_MsgReactivate_authority = md_MsgReactivate.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgReactivate)(nil) + +type fastReflection_MsgReactivate MsgReactivate + +func (x *MsgReactivate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReactivate)(x) +} + +func (x *MsgReactivate) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[4] + 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_MsgReactivate_messageType fastReflection_MsgReactivate_messageType +var _ protoreflect.MessageType = fastReflection_MsgReactivate_messageType{} + +type fastReflection_MsgReactivate_messageType struct{} + +func (x fastReflection_MsgReactivate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReactivate)(nil) +} +func (x fastReflection_MsgReactivate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReactivate) +} +func (x fastReflection_MsgReactivate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReactivate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivate +} + +// 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_MsgReactivate) Type() protoreflect.MessageType { + return _fastReflection_MsgReactivate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReactivate) New() protoreflect.Message { + return new(fastReflection_MsgReactivate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReactivate) Interface() protoreflect.ProtoMessage { + return (*MsgReactivate)(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_MsgReactivate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgReactivate_authority, 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_MsgReactivate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgReactivate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgReactivate", 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_MsgReactivate) 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_MsgReactivate) 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_MsgReactivate) 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_MsgReactivate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReactivate) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + 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().(*MsgReactivate) + 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 len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgReactivate) + 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: MsgReactivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReactivate: 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 Authority", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.Authority = string(dAtA[iNdEx:postIndex]) + 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_MsgReactivateResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgReactivateResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgReactivateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgReactivateResponse)(nil) + +type fastReflection_MsgReactivateResponse MsgReactivateResponse + +func (x *MsgReactivateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReactivateResponse)(x) +} + +func (x *MsgReactivateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[5] + 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_MsgReactivateResponse_messageType fastReflection_MsgReactivateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgReactivateResponse_messageType{} + +type fastReflection_MsgReactivateResponse_messageType struct{} + +func (x fastReflection_MsgReactivateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReactivateResponse)(nil) +} +func (x fastReflection_MsgReactivateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReactivateResponse) +} +func (x fastReflection_MsgReactivateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReactivateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivateResponse +} + +// 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_MsgReactivateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgReactivateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReactivateResponse) New() protoreflect.Message { + return new(fastReflection_MsgReactivateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReactivateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgReactivateResponse)(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_MsgReactivateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgReactivateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgReactivateResponse", 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_MsgReactivateResponse) 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_MsgReactivateResponse) 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_MsgReactivateResponse) 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_MsgReactivateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReactivateResponse) + 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.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().(*MsgReactivateResponse) + 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 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().(*MsgReactivateResponse) + 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: MsgReactivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReactivateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgPause protoreflect.MessageDescriptor + fd_MsgPause_authority protoreflect.FieldDescriptor + fd_MsgPause_paused protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgPause = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgPause") + fd_MsgPause_authority = md_MsgPause.Fields().ByName("authority") + fd_MsgPause_paused = md_MsgPause.Fields().ByName("paused") +} + +var _ protoreflect.Message = (*fastReflection_MsgPause)(nil) + +type fastReflection_MsgPause MsgPause + +func (x *MsgPause) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPause)(x) +} + +func (x *MsgPause) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[6] + 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_MsgPause_messageType fastReflection_MsgPause_messageType +var _ protoreflect.MessageType = fastReflection_MsgPause_messageType{} + +type fastReflection_MsgPause_messageType struct{} + +func (x fastReflection_MsgPause_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPause)(nil) +} +func (x fastReflection_MsgPause_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPause) +} +func (x fastReflection_MsgPause_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPause +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPause) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPause +} + +// 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_MsgPause) Type() protoreflect.MessageType { + return _fastReflection_MsgPause_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPause) New() protoreflect.Message { + return new(fastReflection_MsgPause) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPause) Interface() protoreflect.ProtoMessage { + return (*MsgPause)(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_MsgPause) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgPause_authority, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_MsgPause_paused, 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_MsgPause) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + return x.Authority != "" + case "cosmos.svip.v1.MsgPause.paused": + return x.Paused != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + x.Authority = "" + case "cosmos.svip.v1.MsgPause.paused": + x.Paused = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgPause.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + x.Authority = value.Interface().(string) + case "cosmos.svip.v1.MsgPause.paused": + x.Paused = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgPause is not mutable")) + case "cosmos.svip.v1.MsgPause.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.MsgPause is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgPause.paused": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgPause", 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_MsgPause) 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_MsgPause) 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_MsgPause) 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_MsgPause) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPause) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Paused { + n += 2 + } + 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().(*MsgPause) + 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.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgPause) + 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: MsgPause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPause: 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 Authority", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + 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_MsgPauseResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgPauseResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgPauseResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgPauseResponse)(nil) + +type fastReflection_MsgPauseResponse MsgPauseResponse + +func (x *MsgPauseResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPauseResponse)(x) +} + +func (x *MsgPauseResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[7] + 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_MsgPauseResponse_messageType fastReflection_MsgPauseResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgPauseResponse_messageType{} + +type fastReflection_MsgPauseResponse_messageType struct{} + +func (x fastReflection_MsgPauseResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPauseResponse)(nil) +} +func (x fastReflection_MsgPauseResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPauseResponse) +} +func (x fastReflection_MsgPauseResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPauseResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPauseResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPauseResponse +} + +// 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_MsgPauseResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgPauseResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPauseResponse) New() protoreflect.Message { + return new(fastReflection_MsgPauseResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPauseResponse) Interface() protoreflect.ProtoMessage { + return (*MsgPauseResponse)(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_MsgPauseResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgPauseResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgPauseResponse", 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_MsgPauseResponse) 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_MsgPauseResponse) 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_MsgPauseResponse) 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_MsgPauseResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPauseResponse) + 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.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().(*MsgPauseResponse) + 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 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().(*MsgPauseResponse) + 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: MsgPauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPauseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 _ protoreflect.List = (*_MsgFundPool_2_list)(nil) + +type _MsgFundPool_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgFundPool_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgFundPool_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgFundPool_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgFundPool_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgFundPool_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgFundPool protoreflect.MessageDescriptor + fd_MsgFundPool_depositor protoreflect.FieldDescriptor + fd_MsgFundPool_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgFundPool = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgFundPool") + fd_MsgFundPool_depositor = md_MsgFundPool.Fields().ByName("depositor") + fd_MsgFundPool_amount = md_MsgFundPool.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundPool)(nil) + +type fastReflection_MsgFundPool MsgFundPool + +func (x *MsgFundPool) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundPool)(x) +} + +func (x *MsgFundPool) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[8] + 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_MsgFundPool_messageType fastReflection_MsgFundPool_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundPool_messageType{} + +type fastReflection_MsgFundPool_messageType struct{} + +func (x fastReflection_MsgFundPool_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundPool)(nil) +} +func (x fastReflection_MsgFundPool_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundPool) +} +func (x fastReflection_MsgFundPool_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPool +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundPool) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPool +} + +// 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_MsgFundPool) Type() protoreflect.MessageType { + return _fastReflection_MsgFundPool_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundPool) New() protoreflect.Message { + return new(fastReflection_MsgFundPool) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundPool) Interface() protoreflect.ProtoMessage { + return (*MsgFundPool)(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_MsgFundPool) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Depositor != "" { + value := protoreflect.ValueOfString(x.Depositor) + if !f(fd_MsgFundPool_depositor, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgFundPool_2_list{list: &x.Amount}) + if !f(fd_MsgFundPool_amount, 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_MsgFundPool) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + return x.Depositor != "" + case "cosmos.svip.v1.MsgFundPool.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + x.Depositor = "" + case "cosmos.svip.v1.MsgFundPool.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + value := x.Depositor + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgFundPool.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgFundPool_2_list{}) + } + listValue := &_MsgFundPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + x.Depositor = value.Interface().(string) + case "cosmos.svip.v1.MsgFundPool.amount": + lv := value.List() + clv := lv.(*_MsgFundPool_2_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_MsgFundPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.svip.v1.MsgFundPool.depositor": + panic(fmt.Errorf("field depositor of message cosmos.svip.v1.MsgFundPool is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgFundPool.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgFundPool_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgFundPool", 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_MsgFundPool) 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_MsgFundPool) 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_MsgFundPool) 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_MsgFundPool) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundPool) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Depositor) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + 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().(*MsgFundPool) + 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 len(x.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + 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] = 0x12 + } + } + if len(x.Depositor) > 0 { + i -= len(x.Depositor) + copy(dAtA[i:], x.Depositor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Depositor))) + 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().(*MsgFundPool) + 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: MsgFundPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundPool: 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 Depositor", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + 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 + } + x.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 + } + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); 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_MsgFundPoolResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgFundPoolResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgFundPoolResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundPoolResponse)(nil) + +type fastReflection_MsgFundPoolResponse MsgFundPoolResponse + +func (x *MsgFundPoolResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundPoolResponse)(x) +} + +func (x *MsgFundPoolResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[9] + 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_MsgFundPoolResponse_messageType fastReflection_MsgFundPoolResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundPoolResponse_messageType{} + +type fastReflection_MsgFundPoolResponse_messageType struct{} + +func (x fastReflection_MsgFundPoolResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundPoolResponse)(nil) +} +func (x fastReflection_MsgFundPoolResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundPoolResponse) +} +func (x fastReflection_MsgFundPoolResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPoolResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundPoolResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPoolResponse +} + +// 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_MsgFundPoolResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgFundPoolResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundPoolResponse) New() protoreflect.Message { + return new(fastReflection_MsgFundPoolResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundPoolResponse) Interface() protoreflect.ProtoMessage { + return (*MsgFundPoolResponse)(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_MsgFundPoolResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgFundPoolResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgFundPoolResponse", 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundPoolResponse) + 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.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().(*MsgFundPoolResponse) + 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 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().(*MsgFundPoolResponse) + 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: MsgFundPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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: cosmos/svip/v1/tx.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) +) + +// MsgUpdateParams defines a Msg for updating the x/svip module parameters. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/svip parameters to update. + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgActivate activates SVIP reward distribution. Governance-only. +type MsgActivate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgActivate) Reset() { + *x = MsgActivate{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivate) ProtoMessage() {} + +// Deprecated: Use MsgActivate.ProtoReflect.Descriptor instead. +func (*MsgActivate) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgActivate) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgActivateResponse defines the response for MsgActivate. +type MsgActivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgActivateResponse) Reset() { + *x = MsgActivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivateResponse) ProtoMessage() {} + +// Deprecated: Use MsgActivateResponse.ProtoReflect.Descriptor instead. +func (*MsgActivateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +type MsgReactivate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgReactivate) Reset() { + *x = MsgReactivate{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReactivate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReactivate) ProtoMessage() {} + +// Deprecated: Use MsgReactivate.ProtoReflect.Descriptor instead. +func (*MsgReactivate) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgReactivate) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgReactivateResponse defines the response for MsgReactivate. +type MsgReactivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgReactivateResponse) Reset() { + *x = MsgReactivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReactivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReactivateResponse) ProtoMessage() {} + +// Deprecated: Use MsgReactivateResponse.ProtoReflect.Descriptor instead. +func (*MsgReactivateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +type MsgPause struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // paused is the desired pause state. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (x *MsgPause) Reset() { + *x = MsgPause{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPause) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPause) ProtoMessage() {} + +// Deprecated: Use MsgPause.ProtoReflect.Descriptor instead. +func (*MsgPause) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgPause) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgPause) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +// MsgPauseResponse defines the response for MsgPause. +type MsgPauseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgPauseResponse) Reset() { + *x = MsgPauseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPauseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPauseResponse) ProtoMessage() {} + +// Deprecated: Use MsgPauseResponse.ProtoReflect.Descriptor instead. +func (*MsgPauseResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +type MsgFundPool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // depositor is the address funding the pool. + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount is the coins to transfer. Only the native denom is accepted. + Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgFundPool) Reset() { + *x = MsgFundPool{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundPool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundPool) ProtoMessage() {} + +// Deprecated: Use MsgFundPool.ProtoReflect.Descriptor instead. +func (*MsgFundPool) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgFundPool) GetDepositor() string { + if x != nil { + return x.Depositor + } + return "" +} + +func (x *MsgFundPool) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +type MsgFundPoolResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgFundPoolResponse) Reset() { + *x = MsgFundPoolResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundPoolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundPoolResponse) ProtoMessage() {} + +// Deprecated: Use MsgFundPoolResponse.ProtoReflect.Descriptor instead. +func (*MsgFundPoolResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{9} +} + +var File_cosmos_svip_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x76, 0x69, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x30, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x15, 0x0a, 0x13, + 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x17, 0x0a, 0x15, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6a, 0x0a, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, + 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, + 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x15, 0x0a, 0x13, 0x4d, + 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x9b, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, 0x23, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x12, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, + 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x50, 0x61, 0x75, 0x73, 0x65, 0x12, + 0x18, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, 0x65, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, + 0x75, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x46, + 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, + 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, + 0x42, 0x9f, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, + 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, + 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_tx_proto_rawDescData = file_cosmos_svip_v1_tx_proto_rawDesc +) + +func file_cosmos_svip_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_tx_proto_rawDescData) + }) + return file_cosmos_svip_v1_tx_proto_rawDescData +} + +var file_cosmos_svip_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_svip_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: cosmos.svip.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.svip.v1.MsgUpdateParamsResponse + (*MsgActivate)(nil), // 2: cosmos.svip.v1.MsgActivate + (*MsgActivateResponse)(nil), // 3: cosmos.svip.v1.MsgActivateResponse + (*MsgReactivate)(nil), // 4: cosmos.svip.v1.MsgReactivate + (*MsgReactivateResponse)(nil), // 5: cosmos.svip.v1.MsgReactivateResponse + (*MsgPause)(nil), // 6: cosmos.svip.v1.MsgPause + (*MsgPauseResponse)(nil), // 7: cosmos.svip.v1.MsgPauseResponse + (*MsgFundPool)(nil), // 8: cosmos.svip.v1.MsgFundPool + (*MsgFundPoolResponse)(nil), // 9: cosmos.svip.v1.MsgFundPoolResponse + (*Params)(nil), // 10: cosmos.svip.v1.Params + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin +} +var file_cosmos_svip_v1_tx_proto_depIdxs = []int32{ + 10, // 0: cosmos.svip.v1.MsgUpdateParams.params:type_name -> cosmos.svip.v1.Params + 11, // 1: cosmos.svip.v1.MsgFundPool.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 2: cosmos.svip.v1.Msg.UpdateParams:input_type -> cosmos.svip.v1.MsgUpdateParams + 2, // 3: cosmos.svip.v1.Msg.Activate:input_type -> cosmos.svip.v1.MsgActivate + 4, // 4: cosmos.svip.v1.Msg.Reactivate:input_type -> cosmos.svip.v1.MsgReactivate + 6, // 5: cosmos.svip.v1.Msg.Pause:input_type -> cosmos.svip.v1.MsgPause + 8, // 6: cosmos.svip.v1.Msg.FundPool:input_type -> cosmos.svip.v1.MsgFundPool + 1, // 7: cosmos.svip.v1.Msg.UpdateParams:output_type -> cosmos.svip.v1.MsgUpdateParamsResponse + 3, // 8: cosmos.svip.v1.Msg.Activate:output_type -> cosmos.svip.v1.MsgActivateResponse + 5, // 9: cosmos.svip.v1.Msg.Reactivate:output_type -> cosmos.svip.v1.MsgReactivateResponse + 7, // 10: cosmos.svip.v1.Msg.Pause:output_type -> cosmos.svip.v1.MsgPauseResponse + 9, // 11: cosmos.svip.v1.Msg.FundPool:output_type -> cosmos.svip.v1.MsgFundPoolResponse + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_tx_proto_init() } +func file_cosmos_svip_v1_tx_proto_init() { + if File_cosmos_svip_v1_tx_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReactivate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReactivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPause); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPauseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundPool); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundPoolResponse); 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_cosmos_svip_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_svip_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_tx_proto = out.File + file_cosmos_svip_v1_tx_proto_rawDesc = nil + file_cosmos_svip_v1_tx_proto_goTypes = nil + file_cosmos_svip_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/tx_grpc.pb.go b/api/cosmos/svip/v1/tx_grpc.pb.go new file mode 100644 index 00000000..908b18fd --- /dev/null +++ b/api/cosmos/svip/v1/tx_grpc.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/svip/v1/tx.proto + +package svipv1 + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/cosmos.svip.v1.Msg/UpdateParams" + Msg_Activate_FullMethodName = "/cosmos.svip.v1.Msg/Activate" + Msg_Reactivate_FullMethodName = "/cosmos.svip.v1.Msg/Reactivate" + Msg_Pause_FullMethodName = "/cosmos.svip.v1.Msg/Pause" + Msg_FundPool_FullMethodName = "/cosmos.svip.v1.Msg/FundPool" +) + +// 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. +type MsgClient interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, 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) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { + out := new(MsgActivateResponse) + err := c.cc.Invoke(ctx, Msg_Activate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) { + out := new(MsgReactivateResponse) + err := c.cc.Invoke(ctx, Msg_Reactivate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { + out := new(MsgPauseResponse) + err := c.cc.Invoke(ctx, Msg_Pause_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) { + out := new(MsgFundPoolResponse) + err := c.cc.Invoke(ctx, Msg_FundPool_FullMethodName, in, out, opts...) + 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 +type MsgServer interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, 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) Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (UnimplementedMsgServer) Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reactivate not implemented") +} +func (UnimplementedMsgServer) Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") +} +func (UnimplementedMsgServer) FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundPool 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_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgActivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Activate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Reactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReactivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Reactivate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Reactivate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Reactivate(ctx, req.(*MsgReactivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Pause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Pause_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_FundPool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundPool(ctx, req.(*MsgFundPool)) + } + 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: "cosmos.svip.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Activate", + Handler: _Msg_Activate_Handler, + }, + { + MethodName: "Reactivate", + Handler: _Msg_Reactivate_Handler, + }, + { + MethodName: "Pause", + Handler: _Msg_Pause_Handler, + }, + { + MethodName: "FundPool", + Handler: _Msg_FundPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/tx.proto", +} diff --git a/proto/cosmos/evm/svip/v1/genesis.proto b/proto/cosmos/svip/v1/genesis.proto similarity index 74% rename from proto/cosmos/evm/svip/v1/genesis.proto rename to proto/cosmos/svip/v1/genesis.proto index fe9df0da..ac9c063a 100644 --- a/proto/cosmos/evm/svip/v1/genesis.proto +++ b/proto/cosmos/svip/v1/genesis.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package cosmos.evm.svip.v1; +package cosmos.svip.v1; import "amino/amino.proto"; -import "cosmos/evm/svip/v1/svip.proto"; +import "cosmos/svip/v1/svip.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -26,4 +26,8 @@ message GenesisState { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; + // last_block_time is the timestamp of the last processed block. + google.protobuf.Timestamp last_block_time = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // total_paused_seconds is the cumulative seconds spent in paused state. + int64 total_paused_seconds = 6; } diff --git a/proto/cosmos/evm/svip/v1/query.proto b/proto/cosmos/svip/v1/query.proto similarity index 90% rename from proto/cosmos/evm/svip/v1/query.proto rename to proto/cosmos/svip/v1/query.proto index 5adfc9f3..5677c3d1 100644 --- a/proto/cosmos/evm/svip/v1/query.proto +++ b/proto/cosmos/svip/v1/query.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package cosmos.evm.svip.v1; +package cosmos.svip.v1; import "amino/amino.proto"; -import "cosmos/evm/svip/v1/svip.proto"; +import "cosmos/svip/v1/svip.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; @@ -15,13 +15,13 @@ option go_package = "github.com/cosmos/evm/x/svip/types"; service Query { // Params queries the parameters of x/svip module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/evm/svip/v1/params"; + option (google.api.http).get = "/cosmos/svip/v1/params"; } // PoolState queries the current SVIP pool balance, distribution stats, and // reward rate. rpc PoolState(QueryPoolStateRequest) returns (QueryPoolStateResponse) { - option (google.api.http).get = "/cosmos/evm/svip/v1/pool_state"; + option (google.api.http).get = "/cosmos/svip/v1/pool_state"; } } diff --git a/proto/cosmos/evm/svip/v1/svip.proto b/proto/cosmos/svip/v1/svip.proto similarity index 89% rename from proto/cosmos/evm/svip/v1/svip.proto rename to proto/cosmos/svip/v1/svip.proto index 67fee700..f801e474 100644 --- a/proto/cosmos/evm/svip/v1/svip.proto +++ b/proto/cosmos/svip/v1/svip.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package cosmos.evm.svip.v1; +package cosmos.svip.v1; import "amino/amino.proto"; import "gogoproto/gogo.proto"; @@ -9,7 +9,7 @@ option go_package = "github.com/cosmos/evm/x/svip/types"; // Params defines the x/svip module parameters. message Params { - option (amino.name) = "cosmos/evm/x/svip/Params"; + option (amino.name) = "cosmos/x/svip/Params"; // activated indicates whether SVIP reward distribution is active. bool activated = 1 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "activated"]; diff --git a/proto/cosmos/evm/svip/v1/tx.proto b/proto/cosmos/svip/v1/tx.proto similarity index 96% rename from proto/cosmos/evm/svip/v1/tx.proto rename to proto/cosmos/svip/v1/tx.proto index 247f6cdc..8f341019 100644 --- a/proto/cosmos/evm/svip/v1/tx.proto +++ b/proto/cosmos/svip/v1/tx.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package cosmos.evm.svip.v1; +package cosmos.svip.v1; import "amino/amino.proto"; -import "cosmos/evm/svip/v1/svip.proto"; +import "cosmos/svip/v1/svip.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -29,7 +29,7 @@ service Msg { // MsgUpdateParams defines a Msg for updating the x/svip module parameters. message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos/evm/x/svip/MsgUpdateParams"; + option (amino.name) = "cosmos/x/svip/MsgUpdateParams"; // authority is the address of the governance account. string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; diff --git a/x/svip/types/codec.go b/x/svip/types/codec.go index 451bdb0d..f0547721 100644 --- a/x/svip/types/codec.go +++ b/x/svip/types/codec.go @@ -14,11 +14,11 @@ var ( ) const ( - updateParamsName = "cosmos/evm/svip/MsgUpdateParams" - activateName = "cosmos/evm/svip/MsgActivate" - reactivateName = "cosmos/evm/svip/MsgReactivate" - pauseName = "cosmos/evm/svip/MsgPause" - fundPoolName = "cosmos/evm/svip/MsgFundPool" + updateParamsName = "cosmos/svip/MsgUpdateParams" + activateName = "cosmos/svip/MsgActivate" + reactivateName = "cosmos/svip/MsgReactivate" + pauseName = "cosmos/svip/MsgPause" + fundPoolName = "cosmos/svip/MsgFundPool" ) func init() { diff --git a/x/svip/types/genesis.pb.go b/x/svip/types/genesis.pb.go index cbc3840d..a0738d16 100644 --- a/x/svip/types/genesis.pb.go +++ b/x/svip/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/svip/v1/genesis.proto +// source: cosmos/svip/v1/genesis.proto package types @@ -39,13 +39,17 @@ type GenesisState struct { ActivationTime time.Time `protobuf:"bytes,3,opt,name=activation_time,json=activationTime,proto3,stdtime" json:"activation_time"` // pool_balance_at_activation is the pool snapshot used to derive R₀. PoolBalanceAtActivation cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=pool_balance_at_activation,json=poolBalanceAtActivation,proto3,customtype=cosmossdk.io/math.Int" json:"pool_balance_at_activation"` + // last_block_time is the timestamp of the last processed block. + LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` + // total_paused_seconds is the cumulative seconds spent in paused state. + TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` } 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_61b7422785f20091, []int{0} + return fileDescriptor_9fc4f2cc3c482b1c, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -88,38 +92,55 @@ func (m *GenesisState) GetActivationTime() time.Time { return time.Time{} } +func (m *GenesisState) GetLastBlockTime() time.Time { + if m != nil { + return m.LastBlockTime + } + return time.Time{} +} + +func (m *GenesisState) GetTotalPausedSeconds() int64 { + if m != nil { + return m.TotalPausedSeconds + } + return 0 +} + func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.evm.svip.v1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "cosmos.svip.v1.GenesisState") } -func init() { proto.RegisterFile("cosmos/evm/svip/v1/genesis.proto", fileDescriptor_61b7422785f20091) } +func init() { proto.RegisterFile("cosmos/svip/v1/genesis.proto", fileDescriptor_9fc4f2cc3c482b1c) } -var fileDescriptor_61b7422785f20091 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xe3, 0x40, - 0x14, 0xc7, 0x33, 0xdd, 0xa5, 0x6c, 0xb3, 0xcb, 0xee, 0x36, 0xec, 0xb2, 0x21, 0xd0, 0xa4, 0xf4, - 0x54, 0xf6, 0x30, 0x43, 0xf5, 0xaa, 0x87, 0x06, 0x41, 0x14, 0x04, 0xa9, 0x9e, 0x7a, 0x09, 0x93, - 0x74, 0x4c, 0x07, 0x33, 0x99, 0xd0, 0x79, 0x0d, 0xfa, 0x2d, 0xfa, 0x31, 0x3c, 0xfa, 0x21, 0x3c, - 0xf4, 0xd8, 0xa3, 0x78, 0xa8, 0xd2, 0x1e, 0xfc, 0x1a, 0x92, 0x4c, 0x6a, 0x05, 0x3d, 0x78, 0x19, - 0xde, 0xcc, 0xfb, 0xff, 0xde, 0xfc, 0xff, 0x3c, 0xb3, 0x1d, 0x49, 0x25, 0xa4, 0x22, 0x2c, 0x17, - 0x44, 0xe5, 0x3c, 0x23, 0x79, 0x8f, 0xc4, 0x2c, 0x65, 0x8a, 0x2b, 0x9c, 0x4d, 0x24, 0x48, 0xcb, - 0xd2, 0x0a, 0xcc, 0x72, 0x81, 0x0b, 0x05, 0xce, 0x7b, 0x4e, 0x93, 0x0a, 0x9e, 0x4a, 0x52, 0x9e, - 0x5a, 0xe6, 0xb4, 0x3e, 0x18, 0x54, 0xca, 0x75, 0xfb, 0x4f, 0x2c, 0x63, 0x59, 0x96, 0xa4, 0xa8, - 0xaa, 0x57, 0x2f, 0x96, 0x32, 0x4e, 0x18, 0x29, 0x6f, 0xe1, 0xf4, 0x82, 0x00, 0x17, 0x4c, 0x01, - 0x15, 0x15, 0xd6, 0xb9, 0xab, 0x99, 0x3f, 0x0e, 0xb5, 0x9d, 0x33, 0xa0, 0xc0, 0xac, 0x7d, 0xb3, - 0x9e, 0xd1, 0x09, 0x15, 0xca, 0x46, 0x6d, 0xd4, 0xfd, 0xbe, 0xe3, 0xe0, 0xf7, 0xf6, 0xf0, 0x69, - 0xa9, 0xf0, 0x1b, 0xf3, 0xa5, 0x67, 0xdc, 0x3c, 0xdf, 0xfe, 0x47, 0x83, 0x0a, 0xb2, 0x8e, 0xcd, - 0x26, 0x48, 0xa0, 0x49, 0x30, 0xe2, 0x0a, 0x26, 0x3c, 0x9c, 0x02, 0x1b, 0xd9, 0xb5, 0x36, 0xea, - 0x36, 0xfc, 0x56, 0xa1, 0x7e, 0x58, 0x7a, 0x7f, 0xf5, 0x40, 0x35, 0xba, 0xc4, 0x5c, 0x12, 0x41, - 0x61, 0x8c, 0x8f, 0x52, 0x18, 0xfc, 0x2e, 0xb9, 0x83, 0x2d, 0x66, 0x9d, 0x98, 0xbf, 0x68, 0x04, - 0x3c, 0xa7, 0xc0, 0x65, 0x1a, 0x14, 0xce, 0xed, 0x2f, 0x95, 0x27, 0x1d, 0x0b, 0x6f, 0x62, 0xe1, - 0xf3, 0x4d, 0x2c, 0xff, 0x5b, 0xf1, 0xcb, 0xec, 0xd1, 0x43, 0x83, 0x9f, 0x5b, 0xb8, 0x68, 0x5b, - 0x43, 0xd3, 0xc9, 0xa4, 0x4c, 0x82, 0x90, 0x26, 0x34, 0x8d, 0x58, 0x40, 0x21, 0xd8, 0x2a, 0xec, - 0xaf, 0x9f, 0xf1, 0xf8, 0xaf, 0x18, 0xe0, 0x6b, 0xbe, 0x0f, 0xfd, 0x57, 0xda, 0xdf, 0x9b, 0xaf, - 0x5c, 0xb4, 0x58, 0xb9, 0xe8, 0x69, 0xe5, 0xa2, 0xd9, 0xda, 0x35, 0x16, 0x6b, 0xd7, 0xb8, 0x5f, - 0xbb, 0xc6, 0xb0, 0x13, 0x73, 0x18, 0x4f, 0x43, 0x1c, 0x49, 0x41, 0xde, 0x6c, 0xf0, 0x4a, 0xef, - 0x10, 0xae, 0x33, 0xa6, 0xc2, 0x7a, 0x99, 0x63, 0xf7, 0x25, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x2d, - 0x35, 0x2c, 0x2c, 0x02, 0x00, 0x00, +var fileDescriptor_9fc4f2cc3c482b1c = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0xcf, 0x1c, 0x9c, 0xa8, 0x81, 0x96, 0x46, 0x05, 0xc2, 0x09, 0x92, 0x53, 0xa7, 0x13, + 0x83, 0x4d, 0x61, 0x42, 0x62, 0x69, 0x84, 0x84, 0x40, 0x20, 0x55, 0x29, 0x53, 0x97, 0xc8, 0x49, + 0x4c, 0x6a, 0x35, 0xce, 0x8b, 0xce, 0x2f, 0x11, 0x7c, 0x8b, 0x7e, 0x0c, 0x46, 0x3e, 0x02, 0x63, + 0xc7, 0x8e, 0x88, 0xa1, 0xa0, 0xbb, 0x81, 0xaf, 0x81, 0x6c, 0xa7, 0x9c, 0x60, 0x82, 0x25, 0x72, + 0xf2, 0x7f, 0xbf, 0x97, 0xdf, 0xb3, 0x1e, 0x7d, 0x50, 0x80, 0xd1, 0x60, 0xb8, 0xe9, 0x55, 0xcb, + 0xfb, 0x3d, 0x5e, 0xc9, 0x46, 0x1a, 0x65, 0x58, 0xbb, 0x00, 0x84, 0x60, 0xd3, 0xa7, 0xcc, 0xa6, + 0xac, 0xdf, 0x9b, 0x6e, 0x0b, 0xad, 0x1a, 0xe0, 0xee, 0xe9, 0x4b, 0xa6, 0xf7, 0xff, 0x6a, 0xe0, + 0x4a, 0x7d, 0xb4, 0x53, 0x41, 0x05, 0xee, 0xc8, 0xed, 0x69, 0xf8, 0x1a, 0x57, 0x00, 0x55, 0x2d, + 0xb9, 0x7b, 0xcb, 0xbb, 0xf7, 0x1c, 0x95, 0x96, 0x06, 0x85, 0x1e, 0xb0, 0xdd, 0x2f, 0x63, 0x7a, + 0xf3, 0xa5, 0xd7, 0x38, 0x44, 0x81, 0x32, 0x78, 0x46, 0x27, 0xad, 0x58, 0x08, 0x6d, 0x42, 0x32, + 0x23, 0xf3, 0x1b, 0x4f, 0xee, 0xb2, 0x3f, 0xb5, 0xd8, 0x81, 0x4b, 0x93, 0x8d, 0xb3, 0x8b, 0x78, + 0xf4, 0xe9, 0xe7, 0xe7, 0x47, 0x24, 0x1d, 0x80, 0xe0, 0x35, 0xdd, 0x46, 0x40, 0x51, 0x67, 0xa5, + 0x32, 0xb8, 0x50, 0x79, 0x87, 0xb2, 0x0c, 0xaf, 0xcc, 0xc8, 0x7c, 0x23, 0x79, 0x68, 0xab, 0xbf, + 0x5d, 0xc4, 0x77, 0x7c, 0x33, 0x53, 0x9e, 0x30, 0x05, 0x5c, 0x0b, 0x3c, 0x66, 0xaf, 0x1a, 0x4c, + 0x6f, 0x3b, 0xee, 0xc5, 0x1a, 0x0b, 0xde, 0xd2, 0x2d, 0x51, 0xa0, 0xea, 0x05, 0x2a, 0x68, 0x32, + 0x6b, 0x1d, 0x8e, 0x9d, 0xcf, 0x94, 0xf9, 0x91, 0xd8, 0xe5, 0x48, 0xec, 0xdd, 0xe5, 0x48, 0xc9, + 0x75, 0xfb, 0x97, 0xd3, 0xef, 0x31, 0x49, 0x37, 0xd7, 0xb0, 0x8d, 0x83, 0x23, 0x3a, 0x6d, 0x01, + 0xea, 0x2c, 0x17, 0xb5, 0x68, 0x0a, 0x99, 0x09, 0xcc, 0xd6, 0x15, 0xe1, 0xd5, 0x7f, 0x71, 0xbc, + 0x67, 0x1b, 0x24, 0x9e, 0xdf, 0xc7, 0xfd, 0xdf, 0x74, 0xf0, 0x86, 0x6e, 0xd5, 0xc2, 0x60, 0x96, + 0xd7, 0x50, 0x9c, 0x78, 0xd5, 0x6b, 0xff, 0xa1, 0x7a, 0xcb, 0xc2, 0x89, 0x65, 0x9d, 0xe9, 0x63, + 0xba, 0xe3, 0x2f, 0xb1, 0x15, 0x9d, 0x91, 0x65, 0x66, 0x64, 0x01, 0x4d, 0x69, 0xc2, 0xc9, 0x8c, + 0xcc, 0xc7, 0x69, 0xe0, 0xb2, 0x03, 0x17, 0x1d, 0xfa, 0x24, 0x79, 0x7e, 0xb6, 0x8c, 0xc8, 0xf9, + 0x32, 0x22, 0x3f, 0x96, 0x11, 0x39, 0x5d, 0x45, 0xa3, 0xf3, 0x55, 0x34, 0xfa, 0xba, 0x8a, 0x46, + 0x47, 0xbb, 0x95, 0xc2, 0xe3, 0x2e, 0x67, 0x05, 0x68, 0x3e, 0x6c, 0x8e, 0xec, 0x35, 0xff, 0xe0, + 0xf7, 0x07, 0x3f, 0xb6, 0xd2, 0xe4, 0x13, 0x27, 0xf7, 0xf4, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x11, 0x8a, 0x9c, 0x81, 0x9c, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -142,6 +163,19 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TotalPausedSeconds != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.TotalPausedSeconds)) + i-- + dAtA[i] = 0x30 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a { size := m.PoolBalanceAtActivation.Size() i -= size @@ -152,12 +186,12 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) - if err1 != nil { - return 0, err1 + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) + if err2 != nil { + return 0, err2 } - i -= n1 - i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i -= n2 + i = encodeVarintGenesis(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x1a { @@ -208,6 +242,11 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) l = m.PoolBalanceAtActivation.Size() n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime) + n += 1 + l + sovGenesis(uint64(l)) + if m.TotalPausedSeconds != 0 { + n += 1 + sovGenesis(uint64(m.TotalPausedSeconds)) + } return n } @@ -380,6 +419,58 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPausedSeconds", wireType) + } + m.TotalPausedSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalPausedSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/svip/types/query.pb.go b/x/svip/types/query.pb.go index bc51abbf..858cddea 100644 --- a/x/svip/types/query.pb.go +++ b/x/svip/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/svip/v1/query.proto +// source: cosmos/svip/v1/query.proto package types @@ -44,7 +44,7 @@ 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_cc249c053fe9cff2, []int{0} + return fileDescriptor_fcdeace1067afd47, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -83,7 +83,7 @@ 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_cc249c053fe9cff2, []int{1} + return fileDescriptor_fcdeace1067afd47, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -127,7 +127,7 @@ func (m *QueryPoolStateRequest) Reset() { *m = QueryPoolStateRequest{} } func (m *QueryPoolStateRequest) String() string { return proto.CompactTextString(m) } func (*QueryPoolStateRequest) ProtoMessage() {} func (*QueryPoolStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cc249c053fe9cff2, []int{2} + return fileDescriptor_fcdeace1067afd47, []int{2} } func (m *QueryPoolStateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -176,7 +176,7 @@ func (m *QueryPoolStateResponse) Reset() { *m = QueryPoolStateResponse{} func (m *QueryPoolStateResponse) String() string { return proto.CompactTextString(m) } func (*QueryPoolStateResponse) ProtoMessage() {} func (*QueryPoolStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cc249c053fe9cff2, []int{3} + return fileDescriptor_fcdeace1067afd47, []int{3} } func (m *QueryPoolStateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -234,53 +234,53 @@ func (m *QueryPoolStateResponse) GetActivationTime() time.Time { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.evm.svip.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.evm.svip.v1.QueryParamsResponse") - proto.RegisterType((*QueryPoolStateRequest)(nil), "cosmos.evm.svip.v1.QueryPoolStateRequest") - proto.RegisterType((*QueryPoolStateResponse)(nil), "cosmos.evm.svip.v1.QueryPoolStateResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.svip.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.svip.v1.QueryParamsResponse") + proto.RegisterType((*QueryPoolStateRequest)(nil), "cosmos.svip.v1.QueryPoolStateRequest") + proto.RegisterType((*QueryPoolStateResponse)(nil), "cosmos.svip.v1.QueryPoolStateResponse") } -func init() { proto.RegisterFile("cosmos/evm/svip/v1/query.proto", fileDescriptor_cc249c053fe9cff2) } +func init() { proto.RegisterFile("cosmos/svip/v1/query.proto", fileDescriptor_fcdeace1067afd47) } -var fileDescriptor_cc249c053fe9cff2 = []byte{ - // 590 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xbb, 0x6e, 0xd4, 0x40, - 0x14, 0x5d, 0xe7, 0xb1, 0xca, 0x4e, 0x10, 0x90, 0x21, 0x8f, 0x65, 0x49, 0xbc, 0xab, 0x45, 0x0a, - 0x21, 0xc5, 0x8c, 0x36, 0xb4, 0xd0, 0x98, 0x34, 0x20, 0x90, 0x82, 0x93, 0x2a, 0x8d, 0x35, 0xf6, - 0x0e, 0xce, 0x88, 0xf5, 0x8c, 0xe3, 0x19, 0x5b, 0xa4, 0xa0, 0xa1, 0x83, 0x2a, 0x52, 0x7e, 0x82, - 0x92, 0xcf, 0x48, 0x19, 0x89, 0x06, 0x51, 0x04, 0x94, 0x20, 0xf1, 0x1b, 0x68, 0x1e, 0x26, 0x90, - 0x2c, 0x82, 0x66, 0x65, 0xdf, 0x73, 0xcf, 0xb9, 0xf7, 0xee, 0x39, 0x06, 0x7e, 0x22, 0x64, 0x26, - 0x24, 0xa6, 0x55, 0x86, 0x65, 0xc5, 0x72, 0x5c, 0x0d, 0xf0, 0x7e, 0x49, 0x8b, 0x03, 0x94, 0x17, - 0x42, 0x09, 0x08, 0x2d, 0x8e, 0x68, 0x95, 0x21, 0x8d, 0xa3, 0x6a, 0xd0, 0x99, 0x23, 0x19, 0xe3, - 0x02, 0x9b, 0x5f, 0xdb, 0xd6, 0x59, 0x19, 0x23, 0x63, 0xda, 0x2d, 0x3c, 0x9f, 0x8a, 0x54, 0x98, - 0x47, 0xac, 0x9f, 0x5c, 0x75, 0x39, 0x15, 0x22, 0x1d, 0x51, 0x4c, 0x72, 0x86, 0x09, 0xe7, 0x42, - 0x11, 0xc5, 0x04, 0x97, 0x0e, 0xed, 0x3a, 0xd4, 0xbc, 0xc5, 0xe5, 0x4b, 0xac, 0x58, 0x46, 0xa5, - 0x22, 0x59, 0x2d, 0x5a, 0xaf, 0x1e, 0x13, 0x49, 0x71, 0x35, 0x88, 0xa9, 0x22, 0x03, 0x9c, 0x08, - 0xc6, 0x2d, 0xde, 0x9f, 0x07, 0xf0, 0x85, 0xbe, 0x64, 0x8b, 0x14, 0x24, 0x93, 0x21, 0xdd, 0x2f, - 0xa9, 0x54, 0xfd, 0x1d, 0x70, 0xeb, 0x8f, 0xaa, 0xcc, 0x05, 0x97, 0x14, 0x3e, 0x02, 0xcd, 0xdc, - 0x54, 0xda, 0x5e, 0xcf, 0x5b, 0x9b, 0xdd, 0xe8, 0xa0, 0xab, 0x87, 0x23, 0xcb, 0x09, 0x5a, 0xc7, - 0xa7, 0xdd, 0xc6, 0x87, 0x1f, 0x1f, 0xd7, 0xbd, 0xd0, 0x91, 0xfa, 0x4b, 0x60, 0xc1, 0xaa, 0x0a, - 0x31, 0xda, 0x56, 0x44, 0xd1, 0x7a, 0xdc, 0xbb, 0x49, 0xb0, 0x78, 0x19, 0x71, 0x23, 0x03, 0x70, - 0x2d, 0x17, 0x62, 0x14, 0xc5, 0x64, 0x44, 0x78, 0x42, 0xdd, 0xe0, 0xdb, 0xf5, 0x60, 0x7d, 0x16, - 0x72, 0x67, 0xa1, 0xc7, 0x82, 0xf1, 0x60, 0x4a, 0xcf, 0x0d, 0x67, 0x35, 0x29, 0xb0, 0x1c, 0xf8, - 0x14, 0xcc, 0x29, 0xa1, 0xc8, 0x28, 0x1a, 0x32, 0xa9, 0x0a, 0x16, 0x97, 0x8a, 0x0e, 0xdb, 0x13, - 0x3d, 0x6f, 0xad, 0x15, 0xac, 0xe8, 0xee, 0x2f, 0xa7, 0xdd, 0x05, 0xab, 0x27, 0x87, 0xaf, 0x10, - 0x13, 0x38, 0x23, 0x6a, 0x0f, 0x3d, 0xe1, 0x2a, 0xbc, 0x69, 0x78, 0x9b, 0x17, 0x34, 0xb8, 0x0b, - 0x96, 0x92, 0xb2, 0x28, 0x28, 0x57, 0x51, 0x41, 0x14, 0x8d, 0x72, 0x5a, 0x44, 0x92, 0x26, 0x82, - 0x0f, 0xdb, 0x93, 0x46, 0xf1, 0xae, 0x53, 0xbc, 0x73, 0x55, 0xf1, 0x19, 0x4d, 0x49, 0x72, 0xb0, - 0x49, 0x93, 0x70, 0xde, 0x69, 0x84, 0x44, 0xd1, 0x2d, 0x5a, 0x6c, 0x1b, 0x01, 0xb8, 0x0c, 0x5a, - 0x24, 0x51, 0xac, 0x22, 0x7a, 0xbf, 0xa9, 0x9e, 0xb7, 0x36, 0x13, 0x5e, 0x14, 0xe0, 0xa2, 0xfe, - 0xf3, 0x4b, 0x49, 0x87, 0xed, 0x69, 0x03, 0xb9, 0x37, 0xf8, 0x1c, 0xdc, 0x70, 0x4d, 0x4c, 0xf0, - 0x48, 0xfb, 0xdf, 0x6e, 0x3a, 0x77, 0x6c, 0x38, 0x50, 0x1d, 0x0e, 0xb4, 0x53, 0x87, 0x23, 0x98, - 0xd1, 0x5b, 0x1e, 0x7e, 0xed, 0x7a, 0xe1, 0xf5, 0x0b, 0xb2, 0x86, 0x37, 0x8e, 0x26, 0xc0, 0xb4, - 0xf1, 0x02, 0xbe, 0x01, 0x4d, 0xeb, 0x25, 0x5c, 0x1d, 0xe7, 0xf3, 0xd5, 0xd8, 0x74, 0xee, 0xfd, - 0xb3, 0xcf, 0xba, 0xda, 0xef, 0xbf, 0xfd, 0xf4, 0xfd, 0x68, 0x62, 0x19, 0x76, 0xf0, 0x98, 0x4f, - 0xc2, 0xa6, 0x05, 0xbe, 0xf7, 0x40, 0xeb, 0x57, 0x1e, 0xe0, 0xfd, 0xbf, 0x4b, 0x5f, 0x4a, 0x53, - 0x67, 0xfd, 0x7f, 0x5a, 0xdd, 0x22, 0xab, 0x66, 0x91, 0x1e, 0xf4, 0xc7, 0x2e, 0xa2, 0x83, 0x27, - 0x75, 0x7f, 0xf0, 0xf0, 0xf8, 0xcc, 0xf7, 0x4e, 0xce, 0x7c, 0xef, 0xdb, 0x99, 0xef, 0x1d, 0x9e, - 0xfb, 0x8d, 0x93, 0x73, 0xbf, 0xf1, 0xf9, 0xdc, 0x6f, 0xec, 0xf6, 0x53, 0xa6, 0xf6, 0xca, 0x18, - 0x25, 0x22, 0xfb, 0x5d, 0xe3, 0xb5, 0x55, 0x51, 0x07, 0x39, 0x95, 0x71, 0xd3, 0x38, 0xf0, 0xe0, - 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xfb, 0xcd, 0x02, 0x48, 0x04, 0x00, 0x00, +var fileDescriptor_fcdeace1067afd47 = []byte{ + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3d, 0x6f, 0xd3, 0x4c, + 0x1c, 0x8f, 0xfb, 0x12, 0x35, 0xd7, 0x47, 0x7d, 0xe8, 0xd1, 0xa6, 0xa9, 0x29, 0x4e, 0xe5, 0x0a, + 0x54, 0x31, 0xdc, 0x29, 0x65, 0x42, 0x62, 0x32, 0x5d, 0x40, 0x20, 0x15, 0x97, 0xa9, 0x4b, 0x74, + 0x76, 0x0e, 0xf7, 0x44, 0x7c, 0xe7, 0xfa, 0xce, 0x16, 0x5d, 0x18, 0xd8, 0xd8, 0x2a, 0xf1, 0x25, + 0x18, 0xf9, 0x18, 0x1d, 0x2b, 0xb1, 0x20, 0x86, 0x82, 0x5a, 0x24, 0xbe, 0x03, 0x13, 0xba, 0x17, + 0x53, 0x35, 0x41, 0xb0, 0x44, 0xf6, 0xfd, 0xde, 0xfc, 0xbf, 0xff, 0x2f, 0xc0, 0x4f, 0x85, 0xcc, + 0x85, 0xc4, 0xb2, 0x66, 0x05, 0xae, 0x07, 0xf8, 0xa8, 0xa2, 0xe5, 0x31, 0x2a, 0x4a, 0xa1, 0x04, + 0x5c, 0xb2, 0x18, 0xd2, 0x18, 0xaa, 0x07, 0xfe, 0x32, 0xc9, 0x19, 0x17, 0xd8, 0xfc, 0x5a, 0x8a, + 0xbf, 0x3e, 0x21, 0x37, 0x54, 0x0b, 0xad, 0x64, 0x22, 0x13, 0xe6, 0x11, 0xeb, 0x27, 0x77, 0xba, + 0x91, 0x09, 0x91, 0x8d, 0x29, 0x26, 0x05, 0xc3, 0x84, 0x73, 0xa1, 0x88, 0x62, 0x82, 0x4b, 0x87, + 0xf6, 0x1d, 0x6a, 0xde, 0x92, 0xea, 0x25, 0x56, 0x2c, 0xa7, 0x52, 0x91, 0xbc, 0x31, 0x0d, 0x5c, + 0x5e, 0x42, 0x24, 0xc5, 0xf5, 0x20, 0xa1, 0x8a, 0x0c, 0x70, 0x2a, 0x18, 0xb7, 0x78, 0xb8, 0x02, + 0xe0, 0x73, 0x3d, 0xc1, 0x1e, 0x29, 0x49, 0x2e, 0x63, 0x7a, 0x54, 0x51, 0xa9, 0xc2, 0x3d, 0x70, + 0xf3, 0xda, 0xa9, 0x2c, 0x04, 0x97, 0x14, 0x3e, 0x00, 0xed, 0xc2, 0x9c, 0xf4, 0xbc, 0x4d, 0x6f, + 0x7b, 0x71, 0xa7, 0x8b, 0xae, 0x0f, 0x8c, 0x2c, 0x3f, 0xea, 0x9c, 0x9e, 0xf7, 0x5b, 0x1f, 0x7e, + 0x7c, 0xbc, 0xe7, 0xc5, 0x4e, 0x10, 0xae, 0x81, 0x55, 0xeb, 0x28, 0xc4, 0x78, 0x5f, 0x11, 0x45, + 0x9b, 0xa8, 0x77, 0xb3, 0xa0, 0x3b, 0x89, 0xb8, 0xb8, 0x08, 0xfc, 0x57, 0x08, 0x31, 0x1e, 0x26, + 0x64, 0x4c, 0x78, 0x4a, 0x5d, 0xe8, 0x7a, 0x13, 0xaa, 0x47, 0x42, 0x6e, 0x24, 0xf4, 0x48, 0x30, + 0x1e, 0xcd, 0xe9, 0xdc, 0x78, 0x51, 0x8b, 0x22, 0xab, 0x81, 0x4f, 0xc0, 0xb2, 0x12, 0x8a, 0x8c, + 0x87, 0x23, 0x26, 0x55, 0xc9, 0x92, 0x4a, 0xd1, 0x51, 0x6f, 0x66, 0xd3, 0xdb, 0xee, 0x44, 0xb7, + 0x35, 0xfb, 0xcb, 0x79, 0x7f, 0xd5, 0xfa, 0xc9, 0xd1, 0x2b, 0xc4, 0x04, 0xce, 0x89, 0x3a, 0x44, + 0x8f, 0xb9, 0x8a, 0x6f, 0x18, 0xdd, 0xee, 0x95, 0x0c, 0x1e, 0x80, 0xb5, 0xb4, 0x2a, 0x4b, 0xca, + 0xd5, 0xb0, 0x24, 0x8a, 0x0e, 0x0b, 0x5a, 0x0e, 0x25, 0x4d, 0x05, 0x1f, 0xf5, 0x66, 0x8d, 0xe3, + 0x96, 0x73, 0xbc, 0x35, 0xed, 0xf8, 0x94, 0x66, 0x24, 0x3d, 0xde, 0xa5, 0x69, 0xbc, 0xe2, 0x3c, + 0x62, 0xa2, 0xe8, 0x1e, 0x2d, 0xf7, 0x8d, 0x01, 0xdc, 0x00, 0x1d, 0x92, 0x2a, 0x56, 0x13, 0xfd, + 0x7d, 0x73, 0x9b, 0xde, 0xf6, 0x42, 0x7c, 0x75, 0x00, 0xbb, 0xfa, 0xe2, 0x2b, 0x49, 0x47, 0xbd, + 0x79, 0x03, 0xb9, 0x37, 0xf8, 0x0c, 0xfc, 0xef, 0x48, 0x4c, 0xf0, 0xa1, 0xde, 0x7d, 0xaf, 0x6d, + 0x2e, 0xc9, 0x47, 0xb6, 0x18, 0xa8, 0x29, 0x06, 0x7a, 0xd1, 0x14, 0x23, 0x5a, 0xd0, 0x5f, 0x79, + 0xf2, 0xb5, 0xef, 0xc5, 0x4b, 0x57, 0x62, 0x0d, 0xef, 0xfc, 0xf4, 0xc0, 0xbc, 0xd9, 0x05, 0x3c, + 0x02, 0x6d, 0xbb, 0x4b, 0x18, 0x4e, 0xee, 0x78, 0xba, 0x2e, 0xfe, 0xd6, 0x5f, 0x39, 0x76, 0x9b, + 0x61, 0xf0, 0xf6, 0xd3, 0xf7, 0xf7, 0x33, 0x3d, 0xd8, 0xc5, 0x13, 0x7f, 0x01, 0xdb, 0x10, 0xf8, + 0x06, 0x74, 0x7e, 0x57, 0x00, 0xde, 0xf9, 0xb3, 0xe3, 0x44, 0x79, 0xfc, 0xbb, 0xff, 0xa2, 0xb9, + 0xec, 0xd0, 0x64, 0x6f, 0x40, 0x7f, 0x2a, 0x5b, 0xf7, 0x4b, 0x6a, 0x6e, 0xf4, 0xf0, 0xf4, 0x22, + 0xf0, 0xce, 0x2e, 0x02, 0xef, 0xdb, 0x45, 0xe0, 0x9d, 0x5c, 0x06, 0xad, 0xb3, 0xcb, 0xa0, 0xf5, + 0xf9, 0x32, 0x68, 0x1d, 0x84, 0x19, 0x53, 0x87, 0x55, 0x82, 0x52, 0x91, 0x37, 0x7a, 0x5a, 0xe7, + 0xf8, 0xb5, 0x75, 0x51, 0xc7, 0x05, 0x95, 0x49, 0xdb, 0x5c, 0xf4, 0xfd, 0x5f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xa5, 0x62, 0xe6, 0x7b, 0x1f, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -312,7 +312,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -321,7 +321,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) { out := new(QueryPoolStateResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Query/PoolState", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Query/PoolState", in, out, opts...) if err != nil { return nil, err } @@ -362,7 +362,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Query/Params", + FullMethod: "/cosmos.svip.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -380,7 +380,7 @@ func _Query_PoolState_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Query/PoolState", + FullMethod: "/cosmos.svip.v1.Query/PoolState", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PoolState(ctx, req.(*QueryPoolStateRequest)) @@ -388,9 +388,8 @@ func _Query_PoolState_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.evm.svip.v1.Query", + ServiceName: "cosmos.svip.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -403,7 +402,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/evm/svip/v1/query.proto", + Metadata: "cosmos/svip/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/svip/types/query.pb.gw.go b/x/svip/types/query.pb.gw.go index ca1d037a..a2052090 100644 --- a/x/svip/types/query.pb.gw.go +++ b/x/svip/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/evm/svip/v1/query.proto +// source: cosmos/svip/v1/query.proto /* Package types is a reverse proxy. @@ -206,9 +206,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "evm", "svip", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "svip", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_PoolState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "evm", "svip", "v1", "pool_state"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PoolState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "svip", "v1", "pool_state"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/svip/types/svip.pb.go b/x/svip/types/svip.pb.go index ac874e5e..62cc65ae 100644 --- a/x/svip/types/svip.pb.go +++ b/x/svip/types/svip.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/svip/v1/svip.proto +// source: cosmos/svip/v1/svip.proto package types @@ -38,7 +38,7 @@ 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_cb60517721160df2, []int{0} + return fileDescriptor_37b8c507ba0d74ab, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -89,30 +89,30 @@ func (m *Params) GetHalfLifeSeconds() int64 { } func init() { - proto.RegisterType((*Params)(nil), "cosmos.evm.svip.v1.Params") + proto.RegisterType((*Params)(nil), "cosmos.svip.v1.Params") } -func init() { proto.RegisterFile("cosmos/evm/svip/v1/svip.proto", fileDescriptor_cb60517721160df2) } +func init() { proto.RegisterFile("cosmos/svip/v1/svip.proto", fileDescriptor_37b8c507ba0d74ab) } -var fileDescriptor_cb60517721160df2 = []byte{ - // 272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0x2e, 0xcb, 0x2c, 0xd0, 0x2f, 0x33, 0x04, 0xd3, - 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0x10, 0x69, 0xbd, 0xd4, 0xb2, 0x5c, 0x3d, 0xb0, - 0x70, 0x99, 0xa1, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x28, 0x93, 0x12, - 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0x88, 0xa8, 0xd2, 0x29, 0x46, 0x2e, 0xb6, - 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x03, 0x2e, 0xce, 0xc4, 0xe4, 0x92, 0xcc, 0xb2, 0xc4, - 0x92, 0xd4, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x0e, 0x27, 0xa1, 0x57, 0xf7, 0xe4, 0x11, 0x82, - 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0xf0, 0x85, 0xd4, 0xb9, 0xd8, 0x0a, 0x12, 0x4b, 0x8b, - 0x53, 0x53, 0x24, 0x98, 0xc0, 0xca, 0xf9, 0x5f, 0xdd, 0x93, 0x87, 0x8a, 0x40, 0xd4, 0x42, 0x39, - 0x42, 0x6e, 0x5c, 0x82, 0x19, 0x89, 0x39, 0x69, 0xf1, 0x39, 0x99, 0x69, 0xa9, 0xf1, 0xc5, 0xa9, - 0xc9, 0xf9, 0x79, 0x29, 0xc5, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xcc, 0x4e, 0x52, 0xaf, 0xee, 0xc9, - 0x63, 0x4a, 0x42, 0xb4, 0xf3, 0x83, 0xc4, 0x7d, 0x32, 0xd3, 0x52, 0x83, 0x21, 0xa2, 0x56, 0xb2, - 0x5d, 0xcf, 0x37, 0x68, 0x49, 0x20, 0x05, 0x47, 0x05, 0x24, 0x40, 0x20, 0x3e, 0x70, 0xb2, 0x39, - 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, - 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, - 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x4c, 0xed, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, - 0x10, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x10, 0x40, 0x86, 0x6f, 0x01, 0x00, 0x00, +var fileDescriptor_37b8c507ba0d74ab = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x2f, 0x2e, 0xcb, 0x2c, 0xd0, 0x2f, 0x33, 0x04, 0xd3, 0x7a, 0x05, 0x45, 0xf9, + 0x25, 0xf9, 0x42, 0x7c, 0x10, 0x29, 0x3d, 0xb0, 0x50, 0x99, 0xa1, 0x94, 0x60, 0x62, 0x6e, 0x66, + 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x28, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, + 0x2c, 0x88, 0xa8, 0xd2, 0x31, 0x46, 0x2e, 0xb6, 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x03, + 0x2e, 0xce, 0xc4, 0xe4, 0x92, 0xcc, 0xb2, 0xc4, 0x92, 0xd4, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, + 0x0e, 0x27, 0xa1, 0x57, 0xf7, 0xe4, 0x11, 0x82, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0xf0, + 0x85, 0xd4, 0xb9, 0xd8, 0x0a, 0x12, 0x4b, 0x8b, 0x53, 0x53, 0x24, 0x98, 0xc0, 0xca, 0xf9, 0x5f, + 0xdd, 0x93, 0x87, 0x8a, 0x40, 0xd4, 0x42, 0x39, 0x42, 0x6e, 0x5c, 0x82, 0x19, 0x89, 0x39, 0x69, + 0xf1, 0x39, 0x99, 0x69, 0xa9, 0xf1, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5, 0x12, 0xcc, 0x0a, + 0x8c, 0x1a, 0xcc, 0x4e, 0x52, 0xaf, 0xee, 0xc9, 0x63, 0x4a, 0x42, 0xb4, 0xf3, 0x83, 0xc4, 0x7d, + 0x32, 0xd3, 0x52, 0x83, 0x21, 0xa2, 0x56, 0x92, 0x5d, 0xcf, 0x37, 0x68, 0x89, 0x40, 0x83, 0xa1, + 0x02, 0x12, 0x10, 0x10, 0xd7, 0x3b, 0xd9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, + 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, + 0x43, 0x94, 0x52, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x54, 0x6b, + 0x6a, 0x59, 0x2e, 0x4c, 0x7b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x34, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xba, 0x01, 0x40, 0x92, 0x63, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/svip/types/tx.pb.go b/x/svip/types/tx.pb.go index 03a5539e..b03e4d21 100644 --- a/x/svip/types/tx.pb.go +++ b/x/svip/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/svip/v1/tx.proto +// source: cosmos/svip/v1/tx.proto package types @@ -45,7 +45,7 @@ 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_ff92e457852a6541, []int{0} + return fileDescriptor_53f7d4525d63aef9, []int{0} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -96,7 +96,7 @@ 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_ff92e457852a6541, []int{1} + return fileDescriptor_53f7d4525d63aef9, []int{1} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -135,7 +135,7 @@ func (m *MsgActivate) Reset() { *m = MsgActivate{} } func (m *MsgActivate) String() string { return proto.CompactTextString(m) } func (*MsgActivate) ProtoMessage() {} func (*MsgActivate) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{2} + return fileDescriptor_53f7d4525d63aef9, []int{2} } func (m *MsgActivate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -179,7 +179,7 @@ func (m *MsgActivateResponse) Reset() { *m = MsgActivateResponse{} } func (m *MsgActivateResponse) String() string { return proto.CompactTextString(m) } func (*MsgActivateResponse) ProtoMessage() {} func (*MsgActivateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{3} + return fileDescriptor_53f7d4525d63aef9, []int{3} } func (m *MsgActivateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -219,7 +219,7 @@ func (m *MsgReactivate) Reset() { *m = MsgReactivate{} } func (m *MsgReactivate) String() string { return proto.CompactTextString(m) } func (*MsgReactivate) ProtoMessage() {} func (*MsgReactivate) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{4} + return fileDescriptor_53f7d4525d63aef9, []int{4} } func (m *MsgReactivate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -263,7 +263,7 @@ func (m *MsgReactivateResponse) Reset() { *m = MsgReactivateResponse{} } func (m *MsgReactivateResponse) String() string { return proto.CompactTextString(m) } func (*MsgReactivateResponse) ProtoMessage() {} func (*MsgReactivateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{5} + return fileDescriptor_53f7d4525d63aef9, []int{5} } func (m *MsgReactivateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -304,7 +304,7 @@ func (m *MsgPause) Reset() { *m = MsgPause{} } func (m *MsgPause) String() string { return proto.CompactTextString(m) } func (*MsgPause) ProtoMessage() {} func (*MsgPause) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{6} + return fileDescriptor_53f7d4525d63aef9, []int{6} } func (m *MsgPause) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +355,7 @@ func (m *MsgPauseResponse) Reset() { *m = MsgPauseResponse{} } func (m *MsgPauseResponse) String() string { return proto.CompactTextString(m) } func (*MsgPauseResponse) ProtoMessage() {} func (*MsgPauseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{7} + return fileDescriptor_53f7d4525d63aef9, []int{7} } func (m *MsgPauseResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -396,7 +396,7 @@ func (m *MsgFundPool) Reset() { *m = MsgFundPool{} } func (m *MsgFundPool) String() string { return proto.CompactTextString(m) } func (*MsgFundPool) ProtoMessage() {} func (*MsgFundPool) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{8} + return fileDescriptor_53f7d4525d63aef9, []int{8} } func (m *MsgFundPool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -447,7 +447,7 @@ func (m *MsgFundPoolResponse) Reset() { *m = MsgFundPoolResponse{} } func (m *MsgFundPoolResponse) String() string { return proto.CompactTextString(m) } func (*MsgFundPoolResponse) ProtoMessage() {} func (*MsgFundPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff92e457852a6541, []int{9} + return fileDescriptor_53f7d4525d63aef9, []int{9} } func (m *MsgFundPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -477,59 +477,58 @@ func (m *MsgFundPoolResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgFundPoolResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.evm.svip.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.evm.svip.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgActivate)(nil), "cosmos.evm.svip.v1.MsgActivate") - proto.RegisterType((*MsgActivateResponse)(nil), "cosmos.evm.svip.v1.MsgActivateResponse") - proto.RegisterType((*MsgReactivate)(nil), "cosmos.evm.svip.v1.MsgReactivate") - proto.RegisterType((*MsgReactivateResponse)(nil), "cosmos.evm.svip.v1.MsgReactivateResponse") - proto.RegisterType((*MsgPause)(nil), "cosmos.evm.svip.v1.MsgPause") - proto.RegisterType((*MsgPauseResponse)(nil), "cosmos.evm.svip.v1.MsgPauseResponse") - proto.RegisterType((*MsgFundPool)(nil), "cosmos.evm.svip.v1.MsgFundPool") - proto.RegisterType((*MsgFundPoolResponse)(nil), "cosmos.evm.svip.v1.MsgFundPoolResponse") -} - -func init() { proto.RegisterFile("cosmos/evm/svip/v1/tx.proto", fileDescriptor_ff92e457852a6541) } - -var fileDescriptor_ff92e457852a6541 = []byte{ - // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x18, 0x8d, 0x1b, 0x35, 0x4a, 0x2e, 0xfc, 0x34, 0x2d, 0x49, 0x0c, 0xb8, 0x69, 0x40, 0x22, 0x04, - 0x61, 0x2b, 0x01, 0x31, 0x54, 0x65, 0x68, 0x90, 0x58, 0x90, 0xa5, 0xc8, 0x50, 0x21, 0x75, 0x81, - 0x4b, 0x7c, 0xba, 0x1a, 0x61, 0x9f, 0xe5, 0x3b, 0x5b, 0xed, 0x86, 0x18, 0x99, 0x90, 0xf8, 0x27, - 0x18, 0x33, 0x30, 0xb3, 0xb0, 0x74, 0xac, 0x98, 0x98, 0x10, 0x4a, 0x86, 0xfc, 0x1b, 0xc8, 0xbe, - 0xb3, 0xf3, 0xab, 0x26, 0xa8, 0x62, 0x89, 0xe2, 0x7b, 0xef, 0x7b, 0xef, 0xbb, 0xef, 0x7b, 0x3a, - 0x70, 0x63, 0x40, 0xa8, 0x43, 0xa8, 0x8e, 0x42, 0x47, 0xa7, 0xa1, 0xed, 0xe9, 0x61, 0x5b, 0x67, - 0x47, 0x9a, 0xe7, 0x13, 0x46, 0x64, 0x99, 0x83, 0x1a, 0x0a, 0x1d, 0x2d, 0x02, 0xb5, 0xb0, 0xad, - 0x5c, 0x85, 0x8e, 0xed, 0x12, 0x3d, 0xfe, 0xe5, 0x34, 0xe5, 0xd6, 0x19, 0x1a, 0x31, 0x9d, 0xc3, - 0x15, 0x01, 0x3b, 0x14, 0x47, 0x88, 0x43, 0xb1, 0x00, 0x6a, 0x1c, 0x78, 0x1d, 0x7f, 0xe9, 0xc2, - 0x8b, 0x43, 0x1b, 0x98, 0x60, 0xc2, 0xcf, 0xa3, 0x7f, 0xe2, 0x54, 0x15, 0x4a, 0x7d, 0x48, 0x91, - 0x1e, 0xb6, 0xfb, 0x88, 0xc1, 0xb6, 0x3e, 0x20, 0xb6, 0xcb, 0xf1, 0xc6, 0x37, 0x09, 0x5c, 0x36, - 0x28, 0xde, 0xf7, 0x2c, 0xc8, 0x50, 0x0f, 0xfa, 0xd0, 0xa1, 0xf2, 0x63, 0x50, 0x82, 0x01, 0x3b, - 0x24, 0xbe, 0xcd, 0x8e, 0xab, 0x52, 0x5d, 0x6a, 0x96, 0xba, 0xd5, 0x1f, 0x5f, 0x1f, 0x6c, 0x08, - 0xbb, 0x3d, 0xcb, 0xf2, 0x11, 0xa5, 0x2f, 0x98, 0x6f, 0xbb, 0xd8, 0x9c, 0x52, 0xe5, 0x27, 0xa0, - 0xe0, 0xc5, 0x0a, 0xd5, 0xb5, 0xba, 0xd4, 0x2c, 0x77, 0x14, 0x6d, 0x79, 0x18, 0x1a, 0xf7, 0xe8, - 0x96, 0x4e, 0x7e, 0x6d, 0xe5, 0xbe, 0x4c, 0x86, 0x2d, 0xc9, 0x14, 0x45, 0x3b, 0x8f, 0x3e, 0x4c, - 0x86, 0xad, 0xa9, 0xdc, 0xc7, 0xc9, 0xb0, 0xb5, 0x3d, 0x33, 0xa6, 0x23, 0x3e, 0xa8, 0x85, 0x66, - 0x1b, 0x35, 0x50, 0x59, 0x38, 0x32, 0x11, 0xf5, 0x88, 0x4b, 0x51, 0x63, 0x1f, 0x94, 0x0d, 0x8a, - 0xf7, 0x06, 0xcc, 0x0e, 0x21, 0x43, 0xe7, 0xbd, 0xd6, 0xce, 0xa5, 0xf9, 0xbe, 0x1a, 0x9b, 0xe0, - 0xda, 0x8c, 0x6c, 0xea, 0xf6, 0x0a, 0x5c, 0x34, 0x28, 0x36, 0x11, 0xfc, 0xdf, 0x7e, 0x15, 0xb0, - 0x39, 0x27, 0x9c, 0x3a, 0xbe, 0x05, 0x45, 0x83, 0xe2, 0x1e, 0x0c, 0xe8, 0xb9, 0xcd, 0xe4, 0xeb, - 0xd1, 0xce, 0x02, 0x8a, 0xac, 0x78, 0x67, 0x45, 0x53, 0x7c, 0x2d, 0x35, 0x21, 0x83, 0x2b, 0x89, - 0x57, 0xea, 0xff, 0x59, 0x8a, 0x07, 0xfc, 0x2c, 0x70, 0xad, 0x1e, 0x21, 0xef, 0xa2, 0x1e, 0x2c, - 0xe4, 0x11, 0x6a, 0x33, 0xe2, 0xaf, 0xee, 0x21, 0xa5, 0xca, 0xbb, 0xa0, 0x00, 0x1d, 0x12, 0xb8, - 0xac, 0xba, 0x56, 0xcf, 0x37, 0xcb, 0x9d, 0x5a, 0x92, 0x9b, 0x28, 0xb4, 0x9a, 0x08, 0xad, 0xf6, - 0x94, 0xd8, 0xee, 0x5c, 0x6c, 0x78, 0x8d, 0xe8, 0x34, 0x55, 0x13, 0xeb, 0x49, 0x9a, 0x4a, 0x9a, - 0xed, 0x7c, 0xcf, 0x83, 0xbc, 0x41, 0xb1, 0xfc, 0x06, 0x5c, 0x98, 0x0b, 0xfb, 0xed, 0xb3, 0x42, - 0xba, 0x90, 0x28, 0xe5, 0xfe, 0x3f, 0x90, 0x12, 0x27, 0xf9, 0x25, 0x28, 0xa6, 0x99, 0xdb, 0xca, - 0x28, 0x4c, 0x08, 0xca, 0xdd, 0x15, 0x84, 0x54, 0xf5, 0x00, 0x80, 0x99, 0x6c, 0x6d, 0x67, 0x94, - 0x4d, 0x29, 0xca, 0xbd, 0x95, 0x94, 0x54, 0xfb, 0x39, 0x58, 0xe7, 0x29, 0xba, 0x99, 0x51, 0x13, - 0xa3, 0xca, 0x9d, 0xbf, 0xa1, 0xb3, 0xd7, 0x4f, 0x13, 0x91, 0x75, 0xfd, 0x84, 0x90, 0x79, 0xfd, - 0xc5, 0xf5, 0x29, 0xeb, 0xef, 0xa3, 0xa5, 0x77, 0x77, 0x4f, 0x46, 0xaa, 0x74, 0x3a, 0x52, 0xa5, - 0xdf, 0x23, 0x55, 0xfa, 0x34, 0x56, 0x73, 0xa7, 0x63, 0x35, 0xf7, 0x73, 0xac, 0xe6, 0x0e, 0x1a, - 0xd8, 0x66, 0x87, 0x41, 0x5f, 0x1b, 0x10, 0x47, 0x5f, 0x7e, 0x35, 0xd8, 0xb1, 0x87, 0x68, 0xbf, - 0x10, 0xbf, 0x79, 0x0f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x7c, 0xc4, 0x2a, 0xc2, 0x05, - 0x00, 0x00, + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.svip.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.svip.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgActivate)(nil), "cosmos.svip.v1.MsgActivate") + proto.RegisterType((*MsgActivateResponse)(nil), "cosmos.svip.v1.MsgActivateResponse") + proto.RegisterType((*MsgReactivate)(nil), "cosmos.svip.v1.MsgReactivate") + proto.RegisterType((*MsgReactivateResponse)(nil), "cosmos.svip.v1.MsgReactivateResponse") + proto.RegisterType((*MsgPause)(nil), "cosmos.svip.v1.MsgPause") + proto.RegisterType((*MsgPauseResponse)(nil), "cosmos.svip.v1.MsgPauseResponse") + proto.RegisterType((*MsgFundPool)(nil), "cosmos.svip.v1.MsgFundPool") + proto.RegisterType((*MsgFundPoolResponse)(nil), "cosmos.svip.v1.MsgFundPoolResponse") +} + +func init() { proto.RegisterFile("cosmos/svip/v1/tx.proto", fileDescriptor_53f7d4525d63aef9) } + +var fileDescriptor_53f7d4525d63aef9 = []byte{ + // 571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0x6e, 0xb6, 0x6c, 0x69, 0xa7, 0xba, 0x6a, 0xdc, 0xdd, 0xb6, 0x91, 0xcd, 0x96, 0x8a, 0x58, + 0x0a, 0x26, 0xb6, 0x82, 0xe0, 0xb2, 0x97, 0xed, 0x82, 0x27, 0x0b, 0x25, 0xb2, 0x28, 0x5e, 0x64, + 0xda, 0x0c, 0xb3, 0x11, 0x93, 0x09, 0x79, 0x93, 0xb0, 0x7b, 0x13, 0x8f, 0x9e, 0x04, 0x8f, 0xfe, + 0x01, 0x8f, 0x3d, 0x88, 0xbf, 0x61, 0x8f, 0x8b, 0x27, 0x4f, 0x22, 0xed, 0xa1, 0x7f, 0x43, 0x92, + 0x4c, 0xd2, 0x26, 0xd6, 0x5d, 0x58, 0xf6, 0x52, 0x9a, 0xf9, 0xde, 0xfb, 0xbe, 0xef, 0xcd, 0xfb, + 0x18, 0x54, 0x1b, 0x33, 0xb0, 0x19, 0xe8, 0x10, 0x58, 0xae, 0x1e, 0x74, 0x75, 0x7e, 0xa2, 0xb9, + 0x1e, 0xe3, 0x4c, 0xde, 0x88, 0x01, 0x2d, 0x04, 0xb4, 0xa0, 0xab, 0xdc, 0xc1, 0xb6, 0xe5, 0x30, + 0x3d, 0xfa, 0x8d, 0x4b, 0x94, 0x46, 0xae, 0x37, 0x2a, 0x8d, 0xa1, 0x84, 0xd6, 0x06, 0x1a, 0x22, + 0x36, 0xd0, 0x6c, 0xcf, 0xdb, 0xe8, 0x4b, 0x17, 0x1a, 0x31, 0xb4, 0x49, 0x19, 0x65, 0xf1, 0x79, + 0xf8, 0x4f, 0x9c, 0xaa, 0x82, 0x69, 0x84, 0x81, 0xe8, 0x41, 0x77, 0x44, 0x38, 0xee, 0xea, 0x63, + 0x66, 0x39, 0x31, 0xde, 0xfa, 0x21, 0xa1, 0x5b, 0x03, 0xa0, 0x47, 0xae, 0x89, 0x39, 0x19, 0x62, + 0x0f, 0xdb, 0x20, 0x3f, 0x45, 0x15, 0xec, 0xf3, 0x63, 0xe6, 0x59, 0xfc, 0xb4, 0x2e, 0x35, 0xa5, + 0x76, 0xa5, 0x5f, 0xff, 0xf9, 0xfd, 0xd1, 0xa6, 0x90, 0x3b, 0x30, 0x4d, 0x8f, 0x00, 0xbc, 0xe4, + 0x9e, 0xe5, 0x50, 0x63, 0x51, 0x2a, 0x3f, 0x43, 0x25, 0x37, 0x62, 0xa8, 0xaf, 0x35, 0xa5, 0x76, + 0xb5, 0xb7, 0xad, 0x65, 0x2f, 0x41, 0x8b, 0xf9, 0xfb, 0x95, 0xb3, 0xdf, 0xbb, 0x85, 0x6f, 0xf3, + 0x49, 0x47, 0x32, 0x44, 0xc3, 0xde, 0xe3, 0x8f, 0xf3, 0x49, 0x67, 0x41, 0xf5, 0x69, 0x3e, 0xe9, + 0xec, 0x08, 0xe7, 0x27, 0xf1, 0x05, 0xe5, 0x4c, 0xb6, 0x1a, 0xa8, 0x96, 0x3b, 0x32, 0x08, 0xb8, + 0xcc, 0x01, 0xd2, 0x3a, 0x42, 0xd5, 0x01, 0xd0, 0x83, 0x31, 0xb7, 0x02, 0xcc, 0xc9, 0x55, 0xc7, + 0xd9, 0xdb, 0xc8, 0x7a, 0x6a, 0x6d, 0xa1, 0xbb, 0x4b, 0xb4, 0xa9, 0xda, 0x2b, 0x74, 0x73, 0x00, + 0xd4, 0x20, 0xf8, 0xba, 0xf5, 0x6a, 0x68, 0x2b, 0x43, 0x9c, 0x2a, 0xbe, 0x43, 0xe5, 0x01, 0xd0, + 0x21, 0xf6, 0xe1, 0xca, 0x62, 0xf2, 0x76, 0xb8, 0x2b, 0x1f, 0x88, 0x19, 0xed, 0xaa, 0x6c, 0x88, + 0xaf, 0x7f, 0x4c, 0xc8, 0xe8, 0x76, 0xa2, 0x95, 0xea, 0x7f, 0x91, 0xa2, 0x0b, 0x7e, 0xee, 0x3b, + 0xe6, 0x90, 0xb1, 0xf7, 0xa1, 0x07, 0x93, 0xb8, 0x0c, 0x2c, 0xce, 0xbc, 0xcb, 0x3d, 0xa4, 0xa5, + 0xf2, 0x3e, 0x2a, 0x61, 0x9b, 0xf9, 0x0e, 0xaf, 0xaf, 0x35, 0x8b, 0xed, 0x6a, 0xaf, 0x91, 0xe4, + 0x25, 0x0c, 0xab, 0x26, 0xc2, 0xaa, 0x1d, 0x32, 0xcb, 0xc9, 0x44, 0x26, 0xee, 0x11, 0x4e, 0x53, + 0x36, 0xb1, 0x9e, 0xc4, 0x54, 0x62, 0xb6, 0xf7, 0xb5, 0x88, 0x8a, 0x03, 0xa0, 0xf2, 0x6b, 0x74, + 0x23, 0x13, 0xf2, 0xdd, 0x7c, 0x38, 0x73, 0x69, 0x52, 0x1e, 0x5e, 0x52, 0x90, 0x28, 0xc8, 0x2f, + 0x50, 0x39, 0xcd, 0xda, 0xbd, 0x15, 0x4d, 0x09, 0xa8, 0xdc, 0xbf, 0x00, 0x4c, 0xd9, 0x0c, 0x84, + 0x96, 0xb2, 0xb4, 0xb3, 0xa2, 0x65, 0x01, 0x2b, 0x0f, 0x2e, 0x84, 0x53, 0xce, 0x43, 0xb4, 0x1e, + 0xa7, 0xa5, 0xbe, 0xa2, 0x3e, 0x42, 0x94, 0xe6, 0xff, 0x90, 0xe5, 0x31, 0xd3, 0x8d, 0xaf, 0x1a, + 0x33, 0x01, 0x57, 0x8e, 0x99, 0x5f, 0x8b, 0xb2, 0xfe, 0x21, 0x5c, 0x66, 0x7f, 0xff, 0x6c, 0xaa, + 0x4a, 0xe7, 0x53, 0x55, 0xfa, 0x33, 0x55, 0xa5, 0xcf, 0x33, 0xb5, 0x70, 0x3e, 0x53, 0x0b, 0xbf, + 0x66, 0x6a, 0xe1, 0x4d, 0x8b, 0x5a, 0xfc, 0xd8, 0x1f, 0x69, 0x63, 0x66, 0x8b, 0x77, 0x4e, 0x27, + 0x81, 0x9d, 0xbc, 0x06, 0xfc, 0xd4, 0x25, 0x30, 0x2a, 0x45, 0x6f, 0xd8, 0x93, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x52, 0xb7, 0xef, 0x3f, 0x86, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -566,7 +565,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -575,7 +574,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { out := new(MsgActivateResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Activate", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Activate", in, out, opts...) if err != nil { return nil, err } @@ -584,7 +583,7 @@ func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc. func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) { out := new(MsgReactivateResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Reactivate", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Reactivate", in, out, opts...) if err != nil { return nil, err } @@ -593,7 +592,7 @@ func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...g func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { out := new(MsgPauseResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/Pause", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Pause", in, out, opts...) if err != nil { return nil, err } @@ -602,7 +601,7 @@ func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOp func (c *msgClient) FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) { out := new(MsgFundPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.evm.svip.v1.Msg/FundPool", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/FundPool", in, out, opts...) if err != nil { return nil, err } @@ -657,7 +656,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Msg/UpdateParams", + FullMethod: "/cosmos.svip.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -675,7 +674,7 @@ func _Msg_Activate_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Msg/Activate", + FullMethod: "/cosmos.svip.v1.Msg/Activate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) @@ -693,7 +692,7 @@ func _Msg_Reactivate_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Msg/Reactivate", + FullMethod: "/cosmos.svip.v1.Msg/Reactivate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Reactivate(ctx, req.(*MsgReactivate)) @@ -711,7 +710,7 @@ func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Msg/Pause", + FullMethod: "/cosmos.svip.v1.Msg/Pause", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) @@ -729,7 +728,7 @@ func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.evm.svip.v1.Msg/FundPool", + FullMethod: "/cosmos.svip.v1.Msg/FundPool", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).FundPool(ctx, req.(*MsgFundPool)) @@ -737,9 +736,8 @@ func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.evm.svip.v1.Msg", + ServiceName: "cosmos.svip.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -764,7 +762,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/evm/svip/v1/tx.proto", + Metadata: "cosmos/svip/v1/tx.proto", } func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { From 5a81d9ce251af6b824afefc4da073846dbdcdd9a Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 23:45:53 +0530 Subject: [PATCH 07/12] fix(svip): fix reward rounding and pause time leak --- x/svip/genesis.go | 11 ++++++++++- x/svip/keeper/abci.go | 3 ++- x/svip/keeper/keeper.go | 25 +++++++++++++++++++++++++ x/svip/keeper/msg_server.go | 18 ++++++++++++++++-- x/svip/keeper/query_server.go | 3 ++- x/svip/keeper/reward.go | 4 ++-- x/svip/types/genesis_logic.go | 6 ++++++ x/svip/types/keys.go | 2 ++ 8 files changed, 65 insertions(+), 7 deletions(-) diff --git a/x/svip/genesis.go b/x/svip/genesis.go index bb0917ac..915439d6 100644 --- a/x/svip/genesis.go +++ b/x/svip/genesis.go @@ -19,7 +19,14 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) []ab } if !data.ActivationTime.IsZero() { k.SetActivationTime(ctx, data.ActivationTime) - k.SetLastBlockTime(ctx, data.ActivationTime) + if !data.LastBlockTime.IsZero() { + k.SetLastBlockTime(ctx, data.LastBlockTime) + } else { + k.SetLastBlockTime(ctx, data.ActivationTime) + } + } + if data.TotalPausedSeconds > 0 { + k.SetTotalPausedSeconds(ctx, data.TotalPausedSeconds) } if data.PoolBalanceAtActivation.IsPositive() { k.SetPoolBalanceAtActivation(ctx, data.PoolBalanceAtActivation) @@ -34,5 +41,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { TotalDistributed: k.GetTotalDistributed(ctx), ActivationTime: k.GetActivationTime(ctx), PoolBalanceAtActivation: k.GetPoolBalanceAtActivation(ctx), + LastBlockTime: k.GetLastBlockTime(ctx), + TotalPausedSeconds: k.GetTotalPausedSeconds(ctx), } } diff --git a/x/svip/keeper/abci.go b/x/svip/keeper/abci.go index 7cad9f8b..b572f9a9 100644 --- a/x/svip/keeper/abci.go +++ b/x/svip/keeper/abci.go @@ -21,7 +21,8 @@ func (k Keeper) BeginBlock(ctx sdk.Context) error { activationTime := k.GetActivationTime(ctx) lastBlockTime := k.GetLastBlockTime(ctx) - totalElapsed := now.Sub(activationTime).Seconds() + totalPausedSec := float64(k.GetTotalPausedSeconds(ctx)) + totalElapsed := now.Sub(activationTime).Seconds() - totalPausedSec blockDelta := now.Sub(lastBlockTime).Seconds() if totalElapsed <= 0 || blockDelta <= 0 { diff --git a/x/svip/keeper/keeper.go b/x/svip/keeper/keeper.go index 6c0de87c..f8a037e0 100644 --- a/x/svip/keeper/keeper.go +++ b/x/svip/keeper/keeper.go @@ -152,6 +152,31 @@ func (k Keeper) SetPoolBalanceAtActivation(ctx sdk.Context, val sdkmath.Int) { store.Set(types.PoolBalanceAtActivationKey, bz) } +// GetTotalPausedSeconds returns the cumulative seconds SVIP has been paused. +func (k Keeper) GetTotalPausedSeconds(ctx sdk.Context) int64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.TotalPausedSecondsKey) + if bz == nil { + return 0 + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val.Int64() +} + +// SetTotalPausedSeconds stores the cumulative seconds SVIP has been paused. +func (k Keeper) SetTotalPausedSeconds(ctx sdk.Context, secs int64) { + store := ctx.KVStore(k.storeKey) + val := sdkmath.NewInt(secs) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.TotalPausedSecondsKey, bz) +} + // getPoolBalance reads the live pool balance from x/bank (not from custom state). func (k Keeper) getPoolBalance(ctx sdk.Context) sdkmath.Int { moduleAddr := k.ak.GetModuleAddress(types.ModuleName) diff --git a/x/svip/keeper/msg_server.go b/x/svip/keeper/msg_server.go index 5c7108d2..9fbf825d 100644 --- a/x/svip/keeper/msg_server.go +++ b/x/svip/keeper/msg_server.go @@ -117,8 +117,17 @@ func (s msgServer) Reactivate(goCtx context.Context, msg *types.MsgReactivate) ( s.SetActivationTime(ctx, ctx.BlockTime()) s.SetLastBlockTime(ctx, ctx.BlockTime()) - // Reset cumulative counter for the new curve + // Reset cumulative counters for the new curve s.SetTotalDistributed(ctx, sdkmath.ZeroInt()) + s.SetTotalPausedSeconds(ctx, 0) + + // Clear paused state if reactivating while paused + if params.Paused { + params.Paused = false + if err := s.SetParams(ctx, params); err != nil { + return nil, err + } + } ctx.EventManager().EmitEvent(sdk.NewEvent( "svip_reactivated", @@ -142,8 +151,13 @@ func (s msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.Msg return nil, err } - // On unpause: reset LastBlockTime to skip the paused gap + // On unpause: accumulate paused duration + reset LastBlockTime if wasPaused && !msg.Paused { + lastBlock := s.GetLastBlockTime(ctx) + pausedGap := int64(ctx.BlockTime().Sub(lastBlock).Seconds()) + if pausedGap > 0 { + s.SetTotalPausedSeconds(ctx, s.GetTotalPausedSeconds(ctx)+pausedGap) + } s.SetLastBlockTime(ctx, ctx.BlockTime()) } diff --git a/x/svip/keeper/query_server.go b/x/svip/keeper/query_server.go index ed05fbe5..8186a973 100644 --- a/x/svip/keeper/query_server.go +++ b/x/svip/keeper/query_server.go @@ -37,7 +37,8 @@ func (s queryServer) PoolState(goCtx context.Context, _ *types.QueryPoolStateReq var currentRate math.LegacyDec if params.Activated && !params.Paused { - elapsed := ctx.BlockTime().Sub(s.GetActivationTime(ctx)).Seconds() + totalPausedSec := float64(s.GetTotalPausedSeconds(ctx)) + elapsed := ctx.BlockTime().Sub(s.GetActivationTime(ctx)).Seconds() - totalPausedSec poolAtAct := s.GetPoolBalanceAtActivation(ctx) // Calculate tokens per second at current time reward := CalculateBlockReward(params.HalfLifeSeconds, poolAtAct, elapsed, 1.0) diff --git a/x/svip/keeper/reward.go b/x/svip/keeper/reward.go index 9eed1831..6e7cff93 100644 --- a/x/svip/keeper/reward.go +++ b/x/svip/keeper/reward.go @@ -44,8 +44,8 @@ func CalculateBlockReward( return sdkmath.ZeroInt() } - // Convert to integer (truncate — we never over-distribute) - rewardStr := fmt.Sprintf("%.0f", blockReward) + // Truncate to integer — we never over-distribute. + rewardStr := fmt.Sprintf("%.0f", math.Floor(blockReward)) reward, ok := sdkmath.NewIntFromString(rewardStr) if !ok { return sdkmath.ZeroInt() diff --git a/x/svip/types/genesis_logic.go b/x/svip/types/genesis_logic.go index 756faa86..7989b53f 100644 --- a/x/svip/types/genesis_logic.go +++ b/x/svip/types/genesis_logic.go @@ -1,6 +1,7 @@ package types import ( + "fmt" "time" sdkmath "cosmossdk.io/math" @@ -13,6 +14,8 @@ func DefaultGenesisState() *GenesisState { TotalDistributed: sdkmath.ZeroInt(), ActivationTime: time.Time{}, PoolBalanceAtActivation: sdkmath.ZeroInt(), + LastBlockTime: time.Time{}, + TotalPausedSeconds: 0, } } @@ -24,5 +27,8 @@ func (gs GenesisState) Validate() error { if gs.TotalDistributed.IsNegative() { return ErrPoolExhausted.Wrap("total_distributed cannot be negative") } + if gs.TotalPausedSeconds < 0 { + return fmt.Errorf("total_paused_seconds cannot be negative: %d", gs.TotalPausedSeconds) + } return nil } diff --git a/x/svip/types/keys.go b/x/svip/types/keys.go index 166c879e..5882f53e 100644 --- a/x/svip/types/keys.go +++ b/x/svip/types/keys.go @@ -13,6 +13,7 @@ const ( prefixActivationTime prefixLastBlockTime prefixPoolBalanceAtActivation + prefixTotalPausedSeconds ) var ( @@ -21,4 +22,5 @@ var ( ActivationTimeKey = []byte{prefixActivationTime} LastBlockTimeKey = []byte{prefixLastBlockTime} PoolBalanceAtActivationKey = []byte{prefixPoolBalanceAtActivation} + TotalPausedSecondsKey = []byte{prefixTotalPausedSeconds} ) From b635c6840fff55be2cde81921955585af8a51525 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 23:46:00 +0530 Subject: [PATCH 08/12] test(svip): fix mocks and add regression tests --- x/svip/keeper/msg_server_test.go | 441 ++++++++++++++++++++++++ x/svip/types/mocks/MockAccountKeeper.go | 9 +- x/svip/types/mocks/MockBankKeeper.go | 9 +- 3 files changed, 453 insertions(+), 6 deletions(-) create mode 100644 x/svip/keeper/msg_server_test.go diff --git a/x/svip/keeper/msg_server_test.go b/x/svip/keeper/msg_server_test.go new file mode 100644 index 00000000..3dcf1aa6 --- /dev/null +++ b/x/svip/keeper/msg_server_test.go @@ -0,0 +1,441 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + vmtypes "github.com/cosmos/evm/x/vm/types" + + sdkmath "cosmossdk.io/math" + 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" +) + +func govAuthority() string { + return authtypes.NewModuleAddress(govtypes.ModuleName).String() +} + +func TestUpdateParams_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: "invalid", + Params: types.DefaultParams(), + }) + require.ErrorContains(t, err, "invalid authority") +} + +func TestUpdateParams_CannotDeactivate(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Set as activated + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 31536000, + })) + + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: false, HalfLifeSeconds: 31536000}, + }) + require.ErrorContains(t, err, "cannot deactivate") +} + +func TestUpdateParams_HalfLifeChangeCap(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 100_000_000, + })) + + // >50% increase (1.6x) should fail + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: true, HalfLifeSeconds: 160_000_000}, + }) + require.ErrorIs(t, err, types.ErrHalfLifeChange) + + // >50% decrease (0.4x) should fail + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: true, HalfLifeSeconds: 40_000_000}, + }) + require.ErrorIs(t, err, types.ErrHalfLifeChange) + + // Exact 0.5x boundary (ratio == 0.5) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: true, HalfLifeSeconds: 50_000_000}, + }) + require.NoError(t, err) + + // Reset to 100M for next boundary test + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 100_000_000, + })) + + // Exact 1.5x boundary (ratio == 1.5) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: true, HalfLifeSeconds: 150_000_000}, + }) + require.NoError(t, err) + + // Reset to 100M for next test + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 100_000_000, + })) + + // Within 50% (1.3x) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: true, HalfLifeSeconds: 130_000_000}, + }) + require.NoError(t, err) +} + +func TestUpdateParams_HalfLifeMinimum(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{Activated: false, HalfLifeSeconds: 1000}, // < 1 year + }) + require.ErrorContains(t, err, "half_life_seconds must be >= 1 year") +} + +func TestUpdateParams_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + newParams := types.Params{Activated: false, HalfLifeSeconds: 63072000} // 2 years + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: newParams, + }) + require.NoError(t, err) + require.Equal(t, newParams, td.keeper.GetParams(td.ctx)) +} + +func TestActivate_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: "bad"}) + require.ErrorContains(t, err, "invalid authority") +} + +func TestActivate_AlreadyActivated(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 31536000, + })) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrAlreadyActivated) +} + +func TestActivate_MissingHalfLife(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Default params: half_life = 0 + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorContains(t, err, "half_life_seconds must be set") +} + +func TestActivate_PoolNotFunded(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: false, HalfLifeSeconds: 31536000, + })) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, sdkmath.ZeroInt())) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrPoolNotFunded) +} + +func TestActivate_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: false, HalfLifeSeconds: halfLife, + })) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + + blockTime := time.Date(2025, 6, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + params := td.keeper.GetParams(ctx) + require.True(t, params.Activated) + require.Equal(t, poolBalance, td.keeper.GetPoolBalanceAtActivation(ctx)) + require.Equal(t, blockTime, td.keeper.GetActivationTime(ctx).UTC()) + require.Equal(t, blockTime, td.keeper.GetLastBlockTime(ctx).UTC()) +} + +func TestReactivate_NotActivated(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Reactivate(td.ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrNotYetActivated) +} + +func TestReactivate_PoolNotFunded(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 31536000, + })) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, sdkmath.ZeroInt())) + + _, err := srv.Reactivate(td.ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrPoolNotFunded) +} + +func TestReactivate_ClearsPaused(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, Paused: true, HalfLifeSeconds: 31536000, + })) + td.keeper.SetTotalPausedSeconds(td.ctx, 500) + + poolBalance := sdkmath.NewInt(1_000_000_000_000) + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + + blockTime := time.Date(2025, 7, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Reactivate(ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.NoError(t, err) + + params := td.keeper.GetParams(ctx) + require.False(t, params.Paused, "reactivate should clear paused flag") + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) + require.True(t, td.keeper.GetTotalDistributed(ctx).IsZero()) +} + +func TestReactivate_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, HalfLifeSeconds: 31536000, + })) + td.keeper.SetTotalDistributed(td.ctx, sdkmath.NewInt(5000)) + + newPoolBalance := sdkmath.NewInt(500_000_000_000) + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, newPoolBalance)) + + blockTime := time.Date(2025, 8, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Reactivate(ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.NoError(t, err) + + require.Equal(t, newPoolBalance, td.keeper.GetPoolBalanceAtActivation(ctx)) + require.Equal(t, blockTime, td.keeper.GetActivationTime(ctx).UTC()) + require.True(t, td.keeper.GetTotalDistributed(ctx).IsZero()) + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) +} + +func TestPause_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: "bad", Paused: true}) + require.ErrorContains(t, err, "invalid authority") +} + +func TestPause_AccumulatesPausedDuration(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Start with activated + paused + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: true, Paused: true, HalfLifeSeconds: 31536000, + })) + + pauseStart := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetLastBlockTime(td.ctx, pauseStart) + + // Unpause 100 seconds later + unpauseTime := pauseStart.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(unpauseTime) + + _, err := srv.Pause(ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + + require.Equal(t, int64(100), td.keeper.GetTotalPausedSeconds(ctx)) + require.Equal(t, unpauseTime, td.keeper.GetLastBlockTime(ctx).UTC()) + + // Verify params updated + params := td.keeper.GetParams(ctx) + require.False(t, params.Paused) +} + +func TestPause_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Set LastBlockTime so unpause has a valid reference point + td.keeper.SetLastBlockTime(td.ctx, td.ctx.BlockTime()) + + // Pause + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.NoError(t, err) + require.True(t, td.keeper.GetParams(td.ctx).Paused) + + // Unpause + _, err = srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + require.False(t, td.keeper.GetParams(td.ctx).Paused) +} + +func TestFundPool_InvalidDepositor(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: "invalid", + Amount: sdk.NewCoins(sdk.NewInt64Coin("ogwei", 1000)), + }) + require.Error(t, err) +} + +func TestFundPool_WrongDenom(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + depositor := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: depositor, + Amount: sdk.NewCoins(sdk.NewInt64Coin("wrongdenom", 1000)), + }) + require.ErrorContains(t, err, "invalid denom") +} + +func TestFundPool_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + denom := vmtypes.GetEVMCoinDenom() + depositor := authtypes.NewModuleAddress(govtypes.ModuleName) + amount := sdk.NewCoins(sdk.NewInt64Coin(denom, 1000)) + + td.bk.On("SendCoinsFromAccountToModule", td.ctx, depositor, types.ModuleName, amount).Return(nil) + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: depositor.String(), + Amount: amount, + }) + require.NoError(t, err) + + td.bk.AssertCalled(t, "SendCoinsFromAccountToModule", td.ctx, depositor, types.ModuleName, amount) +} + +func TestBeginBlock_AfterPauseUnpause(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) // 1 year + poolBalance := sdkmath.NewInt(1_000_000_000_000_000) + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + td.bk.On("SendCoinsFromModuleToModule", + mock.Anything, types.ModuleName, authtypes.FeeCollectorName, mock.Anything, + ).Return(nil) + + // 1. Activate at T=0 + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ + Activated: false, HalfLifeSeconds: halfLife, + })) + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(activationTime) + _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + // 2. Run BeginBlock at T=100s (normal distribution) + t100 := activationTime.Add(100 * time.Second) + ctx100 := td.ctx.WithBlockTime(t100) + err = td.keeper.BeginBlock(ctx100) + require.NoError(t, err) + + step2Reward := td.keeper.GetTotalDistributed(ctx100) + + // 3. Pause at T=100s + _, err = srv.Pause(ctx100, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.NoError(t, err) + + // 4. Unpause after a full half-life of pause + pauseDuration := time.Duration(halfLife) * time.Second + tUnpause := activationTime.Add(100*time.Second + pauseDuration) + ctxUnpause := td.ctx.WithBlockTime(tUnpause) + _, err = srv.Pause(ctxUnpause, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + require.Equal(t, int64(halfLife), td.keeper.GetTotalPausedSeconds(ctxUnpause)) + + // 5. Run BeginBlock 5s after unpause + // Active time = (100 + halfLife + 5) - 0 - halfLife(paused) = 105s, blockDelta = 5s + tPost := tUnpause.Add(5 * time.Second) + ctxPost := td.ctx.WithBlockTime(tPost) + err = td.keeper.BeginBlock(ctxPost) + require.NoError(t, err) + + // 6. Verify the exact reward distributed matches elapsed=105s (not halfLife+105s) + correctReward := keeper.CalculateBlockReward(halfLife, poolBalance, 105, 5) + buggyReward := keeper.CalculateBlockReward(halfLife, poolBalance, float64(halfLife)+105, 5) + + expectedTotal := step2Reward.Add(correctReward) + require.Equal(t, expectedTotal, td.keeper.GetTotalDistributed(ctxPost), + "total distributed should match correct elapsed, not buggy elapsed") + + // Sanity: correct reward must be ~2x buggy reward after 1 half-life pause + require.True(t, correctReward.GT(buggyReward), + "correct reward (%s) should be ~2x buggy reward (%s)", correctReward, buggyReward) +} diff --git a/x/svip/types/mocks/MockAccountKeeper.go b/x/svip/types/mocks/MockAccountKeeper.go index 58ea56a5..8ad9ca22 100644 --- a/x/svip/types/mocks/MockAccountKeeper.go +++ b/x/svip/types/mocks/MockAccountKeeper.go @@ -12,10 +12,13 @@ type AccountKeeper struct { } // NewAccountKeeper creates a new AccountKeeper mock and registers cleanup. -func NewAccountKeeper(t interface{ Cleanup(func()) }) *AccountKeeper { +func NewAccountKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *AccountKeeper { m := &AccountKeeper{} - m.Mock.Test(nil) - t.Cleanup(func() { m.AssertExpectations(nil) }) + m.Mock.Test(t) + t.Cleanup(func() { m.AssertExpectations(t) }) return m } diff --git a/x/svip/types/mocks/MockBankKeeper.go b/x/svip/types/mocks/MockBankKeeper.go index b5b2e883..892a1e49 100644 --- a/x/svip/types/mocks/MockBankKeeper.go +++ b/x/svip/types/mocks/MockBankKeeper.go @@ -14,10 +14,13 @@ type BankKeeper struct { } // NewBankKeeper creates a new BankKeeper mock and registers cleanup. -func NewBankKeeper(t interface{ Cleanup(func()) }) *BankKeeper { +func NewBankKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *BankKeeper { m := &BankKeeper{} - m.Mock.Test(nil) - t.Cleanup(func() { m.AssertExpectations(nil) }) + m.Mock.Test(t) + t.Cleanup(func() { m.AssertExpectations(t) }) return m } From d7248ffea0c2d79fec19567081b9b73076ce0af5 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Wed, 18 Mar 2026 23:46:09 +0530 Subject: [PATCH 09/12] docs(svip): update module guide and proposal templates --- evmd/docs/SVIP.md | 157 +++++++++++---------- evmd/docs/svip_activate_proposal.json | 2 +- evmd/docs/svip_pause_proposal.json | 2 +- evmd/docs/svip_reactivate_proposal.json | 2 +- evmd/docs/svip_update_params_proposal.json | 2 +- 5 files changed, 90 insertions(+), 75 deletions(-) diff --git a/evmd/docs/SVIP.md b/evmd/docs/SVIP.md index aeebd01a..1671ad2e 100644 --- a/evmd/docs/SVIP.md +++ b/evmd/docs/SVIP.md @@ -1,8 +1,8 @@ # Sustained Validator Incentive Pool (SVIP) -The SVIP module distributes rewards to validators from a pre-funded token pool using exponential decay. It deposits tokens into the FeeCollector every block, and the existing `x/distribution` module splits them across validators by voting power. +SVIP pays validators from a pre-funded token pool. The rewards start high and slowly decrease over time (exponential decay). Every block, the module sends a small amount to the FeeCollector, and the existing `x/distribution` module splits it across validators based on their voting power. -There is no inflation. The pool is funded by bridging tokens from Base. +There's no inflation. The pool is funded by bridging tokens from Base. Proposal templates: `evmd/docs/svip_update_params_proposal.json`, `evmd/docs/svip_activate_proposal.json` @@ -10,27 +10,31 @@ Proposal templates: `evmd/docs/svip_update_params_proposal.json`, `evmd/docs/svi ## How it works -Every block, SVIP runs in the BeginBlocker: +Every block, SVIP does this: -1. Reads the pool balance snapshot and time since activation. -2. Computes the reward using exponential decay: `reward = R₀ × e^(-λt) × Δt`. -3. Transfers the reward from the SVIP module account to the FeeCollector. -4. `x/distribution` picks it up and distributes to validators. +1. Checks how much time has passed since activation. +2. Calculates the reward for this block using exponential decay: `reward = R₀ × e^(-λt) × Δt`. +3. Sends that amount from the SVIP module account to the FeeCollector. +4. `x/distribution` takes it from there and pays validators. -The initial rate `R₀` is derived from the pool balance and half-life: `R₀ = (ln2 / half_life) × pool_balance`. This guarantees the pool never over-distributes — the total converges to exactly the pool size over infinite time. +The starting rate `R₀` comes from the pool size and half-life: `R₀ = (ln2 / half_life) × pool_balance`. This math guarantees the pool can never pay out more than it holds. The total converges to exactly the pool size over infinite time. -### `fund-pool` CLI +### Funding the pool -- You cannot send tokens directly to the SVIP module address via `bank send` — it will fail with `unauthorized`. This is standard Cosmos SDK behavior for module accounts. -- Instead, use the dedicated command: `evmd tx svip fund-pool `. -- This command uses a manual CLI handler (not the SDK's auto-generated one) to avoid a known SDK compatibility issue. +You can't send tokens directly to the SVIP module address with `bank send`. That will fail with `unauthorized` (standard Cosmos SDK behavior for module accounts). Use the dedicated command instead: + +```bash +evmd tx svip fund-pool +``` + +This command uses a manual CLI handler (not the SDK's auto-generated one) to work around a known SDK compatibility issue. --- ## Lifecycle ``` -1. Genesis → SVIP module registered, pool empty, not activated +1. Genesis → Module registered, pool empty, not activated 2. Fund pool → Bridge tokens from Base, call MsgFundPool 3. Set params → Governance sets half_life_seconds via MsgUpdateParams 4. Activate → Governance activates via MsgActivate @@ -40,61 +44,64 @@ The initial rate `R₀` is derived from the pool balance and half-life: `R₀ = --- -## Prerequisites +## Before you start + +You'll need: - A running node connected to the network. -- Access to a funded account for submitting proposals, and access to a validator key (or coordination with validators) for voting. +- A funded account for submitting proposals, and a validator key (or coordination with validators) for voting. - The `evmd` binary installed. -- All token amounts are in base units with 18 decimals. To convert: multiply the token amount by 10^18. For example, 1000 tokens = `1000` followed by 18 zeros = `1000000000000000000000` ogwei. +- Token amounts are always in base units with 18 decimals. Multiply by 10^18 to convert. For example, 1000 tokens = `1000000000000000000000` ogwei. -> **Devnet:** Start a local chain with `./local_node.sh -y`. This gives you home `~/.og-evm-devnet`, chain ID `10740`, and test keyring. `mykey` is the genesis validator. `dev0`-`dev3` are funded accounts. The voting period is 30 seconds. +> **Devnet:** Run `./local_node.sh -y` to start a local chain. Home dir is `~/.og-evm-devnet`, chain ID is `10740`. `mykey` is the genesis validator. `dev0` through `dev3` are funded accounts. Voting period is 30 seconds. --- ## Governance basics -All SVIP operations except funding the pool require a governance proposal. +Everything except funding the pool goes through governance. -1. A funded account **submits** a proposal with a deposit. -2. Validators (or their delegators) **vote** (yes / no / abstain / veto). -3. After the voting period, if quorum (33.4%) is met and >50% voted yes, the proposal **passes** and the message executes. -4. If >33.4% vote "NoWithVeto", the deposit is burned. Otherwise it is returned. +1. Someone **submits** a proposal with a deposit. +2. Validators (or delegators) **vote**: yes, no, abstain, or veto. +3. After the voting period, if quorum (33.4%) is met and >50% voted yes, the proposal **passes** and the message runs. +4. If >33.4% vote "NoWithVeto", the deposit is burned. Otherwise it's returned. -**Finding the gov module address** (needed for all proposal templates): +**Get the gov module address** (you'll need this for every proposal template): ```bash evmd q auth module-account gov ``` -Look for the `address` field (e.g. `og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k`). Use this wherever you see `` in proposal templates. +Look for the `address` field (e.g. `og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k`). Use this wherever you see `` in the templates. -**Finding the minimum deposit** (needed for all proposals): +**Get the minimum deposit:** ```bash evmd q gov params ``` -Look for `min_deposit` — this is the minimum amount required for a proposal to enter the voting period. Use this value wherever you see `` in proposal templates. +Look for `min_deposit`. Use this wherever you see `` in the templates. -**Finding the proposal ID** after submitting: +**Find your proposal ID** after submitting: ```bash evmd q gov proposals ``` -The last proposal in the list is yours. Note the `id` field — you will need it to vote. +Your proposal is the last one in the list. Note the `id`, you'll need it to vote. -**If a proposal fails:** check the status with `evmd q gov proposal `. Common reasons: -- `PROPOSAL_STATUS_REJECTED` — not enough yes votes or quorum not met. -- `PROPOSAL_STATUS_FAILED` — the message execution failed (e.g. guardrail violation, empty pool). Submit a new corrected proposal. +**Check proposal outcome** with `evmd q gov proposal `: +- `PROPOSAL_STATUS_PASSED`: votes passed and the message executed successfully. +- `PROPOSAL_STATUS_REJECTED`: not enough yes votes, or quorum wasn't met. Deposit is returned (unless vetoed). +- `PROPOSAL_STATUS_FAILED`: votes passed, but the message itself failed (e.g. a guardrail blocked it, or the pool was empty). This is what you'll see when something like `MsgActivate` gets rejected at the keeper level. Fix the issue and submit a new proposal. -> **Devnet:** Add `--home ~/.og-evm-devnet` to all commands. Only `mykey` has staking power — use it for voting. Voting period is 30 seconds; vote immediately after submitting. +> **Devnet:** Add `--home ~/.og-evm-devnet` to all commands. Only `mykey` has staking power, so use it for voting. Voting period is 30 seconds, so vote right after submitting. --- ## Step 1. Fund the pool -Anyone can fund the pool. This is the only permissionless operation. On mainnet, tokens are bridged from Base via Hyperlane first, then the bridger calls `fund-pool`. +Anyone can do this. It's the only permissionless operation. On mainnet, tokens get bridged from Base via Hyperlane first, then the bridger calls `fund-pool`. ```bash evmd tx svip fund-pool \ @@ -105,7 +112,7 @@ evmd tx svip fund-pool \ --yes ``` -> **Devnet example** — fund 1000 tokens from dev0: +> **Devnet example**, fund 1000 tokens from dev0: > ```bash > evmd tx svip fund-pool 1000000000000000000000ogwei \ > --from dev0 --home ~/.og-evm-devnet --chain-id 10740 \ @@ -118,27 +125,27 @@ Verify: evmd q svip pool-state ``` -You should see `pool_balance` showing your funded amount. The pool must be funded before activation — `MsgActivate` will reject if the balance is zero. +You should see `pool_balance` with your funded amount. The pool must have funds before you can activate. `MsgActivate` will reject if the balance is zero. --- ## Step 2. Set half-life (governance) -Before activation, you must set `half_life_seconds` via a governance proposal. The recommended value for mainnet is **15 years** (`473364000` seconds). The minimum allowed value is 1 year (`31536000` seconds). +Before activating, you need to set `half_life_seconds` through a governance proposal. The recommended mainnet value is **15 years** (`473364000` seconds). Minimum allowed is 1 year (`31536000` seconds). -**2a.** Prepare the proposal file. Copy the template and fill in the gov module address: +**2a.** Copy the template and fill in the gov module address: ```bash cp evmd/docs/svip_update_params_proposal.json /tmp/svip_set_params.json ``` -Open `/tmp/svip_set_params.json` in any editor and replace `` with the address from the governance basics section. The file should look like: +Open `/tmp/svip_set_params.json` and replace `` with the address from the governance basics section. It should look like: ```json { "messages": [ { - "@type": "/cosmos.evm.svip.v1.MsgUpdateParams", + "@type": "/cosmos.svip.v1.MsgUpdateParams", "authority": "og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k", "params": { "activated": false, @@ -170,7 +177,7 @@ evmd tx gov submit-proposal /tmp/svip_set_params.json \ evmd q gov proposals ``` -**2d.** Coordinate with validators to vote yes before the voting period ends: +**2d.** Get validators to vote yes before the voting period ends: ```bash evmd tx gov vote yes \ @@ -181,7 +188,7 @@ evmd tx gov vote yes \ --yes ``` -**2e.** After the voting period ends, check the result: +**2e.** After the voting period, check the result: ```bash evmd q gov proposal @@ -189,23 +196,31 @@ evmd q gov proposal Status should be `PROPOSAL_STATUS_PASSED`. +**2f.** Verify the half-life was set: + +```bash +evmd q svip params +``` + +> **Heads up:** Don't be alarmed if this shows `params: {}`. Before activation, both `activated` and `paused` are `false`, and `half_life_seconds` is an integer. Proto3 serialization drops fields that equal their default values (`false`, `0`), so the whole thing looks empty even though the values are stored correctly. If you want proof, just move on to step 3. `MsgActivate` will reject with "half_life_seconds must be set before activation" if the value didn't stick. + > **Devnet:** Use `--from mykey --home ~/.og-evm-devnet --chain-id 10740 --keyring-backend test --gas 300000 --gas-prices 10000000ogwei` for both submit and vote. Deposit is `10000000ogwei`. Wait ~35 seconds after voting. -**Guardrails on UpdateParams:** -- Cannot set `activated` to `false` after activation (irreversible). -- `half_life_seconds` must be ≥ 1 year. -- `half_life_seconds` cannot change by more than 50% in a single proposal. +**Guardrails:** +- You can't set `activated` back to `false` once it's been turned on. Activation is permanent. +- `half_life_seconds` must be at least 1 year. +- After activation, `half_life_seconds` can't change by more than 50% in a single proposal. --- ## Step 3. Activate (governance) -Activation snapshots the current pool balance and starts the decay curve. Requirements: -- `half_life_seconds` must be set (step 2). -- The pool must have a non-zero balance (step 1). -- This is a one-time operation — once activated, it cannot be deactivated. +Activation snapshots the current pool balance and starts the decay curve. Before submitting, make sure: +- `half_life_seconds` is set (step 2). +- The pool has funds (step 1). +- You're ready. Once activated, it can't be deactivated. -**3a.** Prepare the proposal file: +**3a.** Copy the template: ```bash cp evmd/docs/svip_activate_proposal.json /tmp/svip_activate.json @@ -230,7 +245,7 @@ evmd tx gov submit-proposal /tmp/svip_activate.json \ evmd q gov proposals ``` -**3d.** Coordinate with validators to vote yes: +**3d.** Get validators to vote yes: ```bash evmd tx gov vote yes \ @@ -241,7 +256,7 @@ evmd tx gov vote yes \ --yes ``` -**3e.** After the voting period, verify rewards are flowing: +**3e.** After the voting period, check that rewards are flowing: ```bash evmd q svip pool-state @@ -249,11 +264,11 @@ evmd q svip pool-state You should see: - `activated: true` -- `pool_balance` decreasing over time -- `total_distributed` increasing -- `current_rate_per_second` non-zero +- `pool_balance` going down over time +- `total_distributed` going up +- `current_rate_per_second` showing a non-zero value -To confirm validators are receiving rewards: +To confirm validators are actually getting paid: ```bash evmd q distribution rewards @@ -261,7 +276,7 @@ evmd q distribution rewards You should see a non-zero `total` in ogwei. -> **Devnet:** Use the same flags as step 2 devnet note. To quickly check rewards: +> **Devnet:** Same flags as the step 2 devnet note. Quick rewards check: > ```bash > ADDR=$(evmd keys show mykey -a --keyring-backend test --home ~/.og-evm-devnet) > evmd q distribution rewards $ADDR --home ~/.og-evm-devnet @@ -271,11 +286,11 @@ You should see a non-zero `total` in ogwei. ## Step 4. Pause / unpause (governance) -Emergency pause stops all reward distribution immediately. When unpaused, the module skips the paused gap cleanly — there is no reward spike. +Emergency pause stops all rewards immediately. When you unpause later, the module skips over the paused time cleanly. There's no reward spike. **To pause:** -**4a.** Prepare the proposal file: +**4a.** Copy the template: ```bash cp evmd/docs/svip_pause_proposal.json /tmp/svip_pause.json @@ -294,7 +309,7 @@ evmd tx gov submit-proposal /tmp/svip_pause.json \ --yes ``` -**4c.** Find the proposal ID and coordinate voting: +**4c.** Find the proposal ID and vote: ```bash evmd q gov proposals @@ -309,27 +324,27 @@ evmd tx gov vote yes \ --yes ``` -**4d.** After the voting period, verify: +**4d.** Verify it's paused: ```bash evmd q svip pool-state ``` -You should see `paused: true`, `current_rate_per_second: 0`, and `total_distributed` frozen (query twice a few seconds apart — the number should not change). +You should see `paused: true`, `current_rate_per_second: 0`, and `total_distributed` frozen. Run the query twice a few seconds apart. The number shouldn't change. -**To unpause:** edit `/tmp/svip_pause.json` and change `"paused": true` to `"paused": false`. Then repeat steps 4b through 4d. +**To unpause:** Edit `/tmp/svip_pause.json` and change `"paused": true` to `"paused": false`. Then repeat steps 4b through 4d. After unpausing, `paused` will disappear from the output (proto3 hides `false`). Confirm it worked by checking that `current_rate_per_second` is non-zero again. --- ## Step 5. Reactivate (governance) -If the pool runs out and is refunded, `MsgReactivate` restarts the decay curve with a fresh pool snapshot. It resets `ActivationTime` and `TotalDistributed` — the curve starts over as if freshly activated. +If the pool runs dry and you refund it, use `MsgReactivate` to restart the decay curve with a fresh snapshot. This resets `ActivationTime` and `TotalDistributed`. The curve starts over as if you just activated for the first time. -This is needed because the decay formula derives the reward rate from the pool snapshot taken at activation. Without reactivation, refunded tokens would drain at the tail-end rate of the old curve (nearly zero). +Why is this needed? The decay formula bases the reward rate on the pool snapshot from activation time. Without reactivating, refunded tokens would trickle out at the tail-end rate of the old curve (basically zero). **5a.** Fund the pool again (step 1). -**5b.** Prepare the proposal file: +**5b.** Copy the template: ```bash cp evmd/docs/svip_reactivate_proposal.json /tmp/svip_reactivate.json @@ -348,7 +363,7 @@ evmd tx gov submit-proposal /tmp/svip_reactivate.json \ --yes ``` -**5d.** Find the proposal ID and coordinate voting: +**5d.** Find the proposal ID and vote: ```bash evmd q gov proposals @@ -363,13 +378,13 @@ evmd tx gov vote yes \ --yes ``` -**5e.** After the voting period, verify: +**5e.** Verify: ```bash evmd q svip pool-state ``` -`activation_time` should show the current time (not the original), and `total_distributed` should be near zero (counting from the new curve). +`activation_time` should show the current time (not the original one), and `total_distributed` should be near zero (counting fresh from the new curve). --- @@ -383,10 +398,10 @@ evmd q svip params evmd q svip pool-state ``` -> **Note:** `q svip params` may show `params: {}` when values are at defaults (false/0). This is cosmetic. The values are stored correctly — use `q svip pool-state` to confirm `activated: true` and see the current rate. +> **About `params: {}`:** The params query uses proto3 serialization, which drops fields that equal their default value (`false` for bools, `0` for integers). Before activation, this means you'll see `params: {}` even when `half_life_seconds` is set. After activation, `activated: true` shows up but `paused` still hides when it's false. Don't worry, the values are stored correctly. Use `q svip pool-state` for the full picture. --- ## Reward math -Rewards follow exponential decay — they start high and gradually decrease over time. With a 100M token pool and a 15-year half-life, roughly half the pool (50M) is distributed in the first 15 years. After 30 years, 75% is distributed. The rate slows down but never hits zero, and the pool can never over-distribute — the math guarantees total payouts converge to exactly the pool size. +Rewards follow exponential decay. They start high and gradually taper off. With a 100M token pool and a 15-year half-life, roughly half the pool (50M) gets distributed in the first 15 years. After 30 years, 75% is out. The rate keeps slowing down but never hits zero, and the pool can never overpay. The math guarantees total payouts converge to exactly the pool size. diff --git a/evmd/docs/svip_activate_proposal.json b/evmd/docs/svip_activate_proposal.json index 525adf03..5fe3f5be 100644 --- a/evmd/docs/svip_activate_proposal.json +++ b/evmd/docs/svip_activate_proposal.json @@ -1,7 +1,7 @@ { "messages": [ { - "@type": "/cosmos.evm.svip.v1.MsgActivate", + "@type": "/cosmos.svip.v1.MsgActivate", "authority": "" } ], diff --git a/evmd/docs/svip_pause_proposal.json b/evmd/docs/svip_pause_proposal.json index eca7822b..1dc4205e 100644 --- a/evmd/docs/svip_pause_proposal.json +++ b/evmd/docs/svip_pause_proposal.json @@ -1,7 +1,7 @@ { "messages": [ { - "@type": "/cosmos.evm.svip.v1.MsgPause", + "@type": "/cosmos.svip.v1.MsgPause", "authority": "", "paused": true } diff --git a/evmd/docs/svip_reactivate_proposal.json b/evmd/docs/svip_reactivate_proposal.json index b1c9e0d9..47cfd0d8 100644 --- a/evmd/docs/svip_reactivate_proposal.json +++ b/evmd/docs/svip_reactivate_proposal.json @@ -1,7 +1,7 @@ { "messages": [ { - "@type": "/cosmos.evm.svip.v1.MsgReactivate", + "@type": "/cosmos.svip.v1.MsgReactivate", "authority": "" } ], diff --git a/evmd/docs/svip_update_params_proposal.json b/evmd/docs/svip_update_params_proposal.json index f13873e9..120dec44 100644 --- a/evmd/docs/svip_update_params_proposal.json +++ b/evmd/docs/svip_update_params_proposal.json @@ -1,7 +1,7 @@ { "messages": [ { - "@type": "/cosmos.evm.svip.v1.MsgUpdateParams", + "@type": "/cosmos.svip.v1.MsgUpdateParams", "authority": "", "params": { "activated": false, From 76688cc853cc7325f767c1a5b665e15fb6fd0068 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Fri, 20 Mar 2026 22:10:08 +0530 Subject: [PATCH 10/12] refactor(svip): extract activated/paused from Params proto to GenesisState --- api/cosmos/svip/v1/genesis.pulsar.go | 155 +++++++++++++++++++++--- api/cosmos/svip/v1/svip.pulsar.go | 168 +++------------------------ api/cosmos/svip/v1/tx.pulsar.go | 2 +- proto/cosmos/svip/v1/genesis.proto | 4 + proto/cosmos/svip/v1/svip.proto | 4 - proto/cosmos/svip/v1/tx.proto | 2 +- x/svip/types/genesis.pb.go | 142 +++++++++++++++++----- x/svip/types/svip.pb.go | 109 ++--------------- x/svip/types/tx.pb.go | 2 +- 9 files changed, 292 insertions(+), 296 deletions(-) diff --git a/api/cosmos/svip/v1/genesis.pulsar.go b/api/cosmos/svip/v1/genesis.pulsar.go index 87033e04..fdccaac3 100644 --- a/api/cosmos/svip/v1/genesis.pulsar.go +++ b/api/cosmos/svip/v1/genesis.pulsar.go @@ -23,6 +23,8 @@ var ( fd_GenesisState_pool_balance_at_activation protoreflect.FieldDescriptor fd_GenesisState_last_block_time protoreflect.FieldDescriptor fd_GenesisState_total_paused_seconds protoreflect.FieldDescriptor + fd_GenesisState_activated protoreflect.FieldDescriptor + fd_GenesisState_paused protoreflect.FieldDescriptor ) func init() { @@ -34,6 +36,8 @@ func init() { fd_GenesisState_pool_balance_at_activation = md_GenesisState.Fields().ByName("pool_balance_at_activation") fd_GenesisState_last_block_time = md_GenesisState.Fields().ByName("last_block_time") fd_GenesisState_total_paused_seconds = md_GenesisState.Fields().ByName("total_paused_seconds") + fd_GenesisState_activated = md_GenesisState.Fields().ByName("activated") + fd_GenesisState_paused = md_GenesisState.Fields().ByName("paused") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -137,6 +141,18 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Activated != false { + value := protoreflect.ValueOfBool(x.Activated) + if !f(fd_GenesisState_activated, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_GenesisState_paused, value) { + return + } + } } // Has reports whether a field is populated. @@ -164,6 +180,10 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.LastBlockTime != nil case "cosmos.svip.v1.GenesisState.total_paused_seconds": return x.TotalPausedSeconds != int64(0) + case "cosmos.svip.v1.GenesisState.activated": + return x.Activated != false + case "cosmos.svip.v1.GenesisState.paused": + return x.Paused != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -192,6 +212,10 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.LastBlockTime = nil case "cosmos.svip.v1.GenesisState.total_paused_seconds": x.TotalPausedSeconds = int64(0) + case "cosmos.svip.v1.GenesisState.activated": + x.Activated = false + case "cosmos.svip.v1.GenesisState.paused": + x.Paused = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -226,6 +250,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "cosmos.svip.v1.GenesisState.total_paused_seconds": value := x.TotalPausedSeconds return protoreflect.ValueOfInt64(value) + case "cosmos.svip.v1.GenesisState.activated": + value := x.Activated + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.GenesisState.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -258,6 +288,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value x.LastBlockTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.svip.v1.GenesisState.total_paused_seconds": x.TotalPausedSeconds = value.Int() + case "cosmos.svip.v1.GenesisState.activated": + x.Activated = value.Bool() + case "cosmos.svip.v1.GenesisState.paused": + x.Paused = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -299,6 +333,10 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field pool_balance_at_activation of message cosmos.svip.v1.GenesisState is not mutable")) case "cosmos.svip.v1.GenesisState.total_paused_seconds": panic(fmt.Errorf("field total_paused_seconds of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.activated": + panic(fmt.Errorf("field activated of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.GenesisState is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -327,6 +365,10 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.svip.v1.GenesisState.total_paused_seconds": return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.svip.v1.GenesisState.activated": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.GenesisState.paused": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) @@ -419,6 +461,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if x.TotalPausedSeconds != 0 { n += 1 + runtime.Sov(uint64(x.TotalPausedSeconds)) } + if x.Activated { + n += 2 + } + if x.Paused { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -448,6 +496,26 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if x.Activated { + i-- + if x.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } if x.TotalPausedSeconds != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalPausedSeconds)) i-- @@ -749,6 +817,46 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { break } } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Activated = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -815,6 +923,10 @@ type GenesisState struct { LastBlockTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3" json:"last_block_time,omitempty"` // total_paused_seconds is the cumulative seconds spent in paused state. TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,7,opt,name=activated,proto3" json:"activated,omitempty"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,8,opt,name=paused,proto3" json:"paused,omitempty"` } func (x *GenesisState) Reset() { @@ -879,6 +991,20 @@ func (x *GenesisState) GetTotalPausedSeconds() int64 { return 0 } +func (x *GenesisState) GetActivated() bool { + if x != nil { + return x.Activated + } + return false +} + +func (x *GenesisState) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + var File_cosmos_svip_v1_genesis_proto protoreflect.FileDescriptor var file_cosmos_svip_v1_genesis_proto_rawDesc = []byte{ @@ -891,7 +1017,7 @@ var file_cosmos_svip_v1_genesis_proto_rawDesc = []byte{ 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, @@ -919,18 +1045,21 @@ var file_cosmos_svip_v1_genesis_proto_rawDesc = []byte{ 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x75, 0x73, 0x65, 0x64, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x42, 0xa4, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, - 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x42, 0xa4, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, + 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, + 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, + 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, + 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/svip/v1/svip.pulsar.go b/api/cosmos/svip/v1/svip.pulsar.go index 2306887a..af27baf9 100644 --- a/api/cosmos/svip/v1/svip.pulsar.go +++ b/api/cosmos/svip/v1/svip.pulsar.go @@ -16,16 +16,12 @@ import ( var ( md_Params protoreflect.MessageDescriptor - fd_Params_activated protoreflect.FieldDescriptor - fd_Params_paused protoreflect.FieldDescriptor fd_Params_half_life_seconds protoreflect.FieldDescriptor ) func init() { file_cosmos_svip_v1_svip_proto_init() md_Params = File_cosmos_svip_v1_svip_proto.Messages().ByName("Params") - fd_Params_activated = md_Params.Fields().ByName("activated") - fd_Params_paused = md_Params.Fields().ByName("paused") fd_Params_half_life_seconds = md_Params.Fields().ByName("half_life_seconds") } @@ -94,18 +90,6 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Activated != false { - value := protoreflect.ValueOfBool(x.Activated) - if !f(fd_Params_activated, value) { - return - } - } - if x.Paused != false { - value := protoreflect.ValueOfBool(x.Paused) - if !f(fd_Params_paused, value) { - return - } - } if x.HalfLifeSeconds != int64(0) { value := protoreflect.ValueOfInt64(x.HalfLifeSeconds) if !f(fd_Params_half_life_seconds, value) { @@ -127,10 +111,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.svip.v1.Params.activated": - return x.Activated != false - case "cosmos.svip.v1.Params.paused": - return x.Paused != false case "cosmos.svip.v1.Params.half_life_seconds": return x.HalfLifeSeconds != int64(0) default: @@ -149,10 +129,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.svip.v1.Params.activated": - x.Activated = false - case "cosmos.svip.v1.Params.paused": - x.Paused = false case "cosmos.svip.v1.Params.half_life_seconds": x.HalfLifeSeconds = int64(0) default: @@ -171,12 +147,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.svip.v1.Params.activated": - value := x.Activated - return protoreflect.ValueOfBool(value) - case "cosmos.svip.v1.Params.paused": - value := x.Paused - return protoreflect.ValueOfBool(value) case "cosmos.svip.v1.Params.half_life_seconds": value := x.HalfLifeSeconds return protoreflect.ValueOfInt64(value) @@ -200,10 +170,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.svip.v1.Params.activated": - x.Activated = value.Bool() - case "cosmos.svip.v1.Params.paused": - x.Paused = value.Bool() case "cosmos.svip.v1.Params.half_life_seconds": x.HalfLifeSeconds = value.Int() default: @@ -226,10 +192,6 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.svip.v1.Params.activated": - panic(fmt.Errorf("field activated of message cosmos.svip.v1.Params is not mutable")) - case "cosmos.svip.v1.Params.paused": - panic(fmt.Errorf("field paused of message cosmos.svip.v1.Params is not mutable")) case "cosmos.svip.v1.Params.half_life_seconds": panic(fmt.Errorf("field half_life_seconds of message cosmos.svip.v1.Params is not mutable")) default: @@ -245,10 +207,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.svip.v1.Params.activated": - return protoreflect.ValueOfBool(false) - case "cosmos.svip.v1.Params.paused": - return protoreflect.ValueOfBool(false) case "cosmos.svip.v1.Params.half_life_seconds": return protoreflect.ValueOfInt64(int64(0)) default: @@ -320,12 +278,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Activated { - n += 2 - } - if x.Paused { - n += 2 - } if x.HalfLifeSeconds != 0 { n += 1 + runtime.Sov(uint64(x.HalfLifeSeconds)) } @@ -363,26 +315,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x18 } - if x.Paused { - i-- - if x.Paused { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if x.Activated { - i-- - if x.Activated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -432,46 +364,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Activated = bool(v != 0) - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Paused = bool(v != 0) case 3: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) @@ -545,10 +437,6 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // activated indicates whether SVIP reward distribution is active. - Activated bool `protobuf:"varint,1,opt,name=activated,proto3" json:"activated,omitempty"` - // paused is an emergency pause flag. - Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` // half_life_seconds is the half-life for exponential decay, in seconds. HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds,omitempty"` } @@ -573,20 +461,6 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cosmos_svip_v1_svip_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetActivated() bool { - if x != nil { - return x.Activated - } - return false -} - -func (x *Params) GetPaused() bool { - if x != nil { - return x.Paused - } - return false -} - func (x *Params) GetHalfLifeSeconds() int64 { if x != nil { return x.HalfLifeSeconds @@ -602,30 +476,24 @@ var file_cosmos_svip_v1_svip_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 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, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x30, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x27, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x11, 0x68, 0x61, - 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x11, 0x68, 0x61, 0x6c, 0x66, 0x5f, - 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x0f, 0x68, 0x61, 0x6c, 0x66, 0x4c, 0x69, 0x66, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x73, 0x3a, 0x19, 0x8a, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa1, 0x01, - 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, - 0x70, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x53, 0x76, 0x69, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, - 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, - 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, + 0x0a, 0x11, 0x68, 0x61, 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x11, 0x68, + 0x61, 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x68, 0x61, 0x6c, 0x66, 0x4c, 0x69, 0x66, 0x65, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x19, 0x8a, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x53, 0x76, 0x69, 0x70, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, + 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, + 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, + 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, + 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, + 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/svip/v1/tx.pulsar.go b/api/cosmos/svip/v1/tx.pulsar.go index 437d2278..7c66588e 100644 --- a/api/cosmos/svip/v1/tx.pulsar.go +++ b/api/cosmos/svip/v1/tx.pulsar.go @@ -4190,7 +4190,7 @@ type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the x/svip parameters to update. - // NOTE: All parameters must be supplied. + // NOTE: Only half_life_seconds is configurable via this message. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } diff --git a/proto/cosmos/svip/v1/genesis.proto b/proto/cosmos/svip/v1/genesis.proto index ac9c063a..a2f3040d 100644 --- a/proto/cosmos/svip/v1/genesis.proto +++ b/proto/cosmos/svip/v1/genesis.proto @@ -30,4 +30,8 @@ message GenesisState { google.protobuf.Timestamp last_block_time = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; // total_paused_seconds is the cumulative seconds spent in paused state. int64 total_paused_seconds = 6; + // activated indicates whether SVIP reward distribution is active. + bool activated = 7; + // paused is an emergency pause flag. + bool paused = 8; } diff --git a/proto/cosmos/svip/v1/svip.proto b/proto/cosmos/svip/v1/svip.proto index f801e474..18a025d2 100644 --- a/proto/cosmos/svip/v1/svip.proto +++ b/proto/cosmos/svip/v1/svip.proto @@ -11,10 +11,6 @@ option go_package = "github.com/cosmos/evm/x/svip/types"; message Params { option (amino.name) = "cosmos/x/svip/Params"; - // activated indicates whether SVIP reward distribution is active. - bool activated = 1 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "activated"]; - // paused is an emergency pause flag. - bool paused = 2 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "paused"]; // half_life_seconds is the half-life for exponential decay, in seconds. int64 half_life_seconds = 3 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "half_life_seconds"]; } diff --git a/proto/cosmos/svip/v1/tx.proto b/proto/cosmos/svip/v1/tx.proto index 8f341019..290cb23e 100644 --- a/proto/cosmos/svip/v1/tx.proto +++ b/proto/cosmos/svip/v1/tx.proto @@ -34,7 +34,7 @@ message MsgUpdateParams { // authority is the address of the governance account. string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // params defines the x/svip parameters to update. - // NOTE: All parameters must be supplied. + // NOTE: Only half_life_seconds is configurable via this message. Params params = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } diff --git a/x/svip/types/genesis.pb.go b/x/svip/types/genesis.pb.go index a0738d16..8a9dad36 100644 --- a/x/svip/types/genesis.pb.go +++ b/x/svip/types/genesis.pb.go @@ -43,6 +43,10 @@ type GenesisState struct { LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` // total_paused_seconds is the cumulative seconds spent in paused state. TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,7,opt,name=activated,proto3" json:"activated,omitempty"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,8,opt,name=paused,proto3" json:"paused,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -106,6 +110,20 @@ func (m *GenesisState) GetTotalPausedSeconds() int64 { return 0 } +func (m *GenesisState) GetActivated() bool { + if m != nil { + return m.Activated + } + return false +} + +func (m *GenesisState) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + func init() { proto.RegisterType((*GenesisState)(nil), "cosmos.svip.v1.GenesisState") } @@ -113,34 +131,36 @@ func init() { func init() { proto.RegisterFile("cosmos/svip/v1/genesis.proto", fileDescriptor_9fc4f2cc3c482b1c) } var fileDescriptor_9fc4f2cc3c482b1c = []byte{ - // 424 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6f, 0xd4, 0x30, - 0x14, 0xc7, 0xcf, 0x1c, 0x9c, 0xa8, 0x81, 0x96, 0x46, 0x05, 0xc2, 0x09, 0x92, 0x53, 0xa7, 0x13, - 0x83, 0x4d, 0x61, 0x42, 0x62, 0x69, 0x84, 0x84, 0x40, 0x20, 0x55, 0x29, 0x53, 0x97, 0xc8, 0x49, - 0x4c, 0x6a, 0x35, 0xce, 0x8b, 0xce, 0x2f, 0x11, 0x7c, 0x8b, 0x7e, 0x0c, 0x46, 0x3e, 0x02, 0x63, - 0xc7, 0x8e, 0x88, 0xa1, 0xa0, 0xbb, 0x81, 0xaf, 0x81, 0x6c, 0xa7, 0x9c, 0x60, 0x82, 0x25, 0x72, - 0xf2, 0x7f, 0xbf, 0x97, 0xdf, 0xb3, 0x1e, 0x7d, 0x50, 0x80, 0xd1, 0x60, 0xb8, 0xe9, 0x55, 0xcb, - 0xfb, 0x3d, 0x5e, 0xc9, 0x46, 0x1a, 0x65, 0x58, 0xbb, 0x00, 0x84, 0x60, 0xd3, 0xa7, 0xcc, 0xa6, - 0xac, 0xdf, 0x9b, 0x6e, 0x0b, 0xad, 0x1a, 0xe0, 0xee, 0xe9, 0x4b, 0xa6, 0xf7, 0xff, 0x6a, 0xe0, - 0x4a, 0x7d, 0xb4, 0x53, 0x41, 0x05, 0xee, 0xc8, 0xed, 0x69, 0xf8, 0x1a, 0x57, 0x00, 0x55, 0x2d, - 0xb9, 0x7b, 0xcb, 0xbb, 0xf7, 0x1c, 0x95, 0x96, 0x06, 0x85, 0x1e, 0xb0, 0xdd, 0x2f, 0x63, 0x7a, - 0xf3, 0xa5, 0xd7, 0x38, 0x44, 0x81, 0x32, 0x78, 0x46, 0x27, 0xad, 0x58, 0x08, 0x6d, 0x42, 0x32, - 0x23, 0xf3, 0x1b, 0x4f, 0xee, 0xb2, 0x3f, 0xb5, 0xd8, 0x81, 0x4b, 0x93, 0x8d, 0xb3, 0x8b, 0x78, - 0xf4, 0xe9, 0xe7, 0xe7, 0x47, 0x24, 0x1d, 0x80, 0xe0, 0x35, 0xdd, 0x46, 0x40, 0x51, 0x67, 0xa5, - 0x32, 0xb8, 0x50, 0x79, 0x87, 0xb2, 0x0c, 0xaf, 0xcc, 0xc8, 0x7c, 0x23, 0x79, 0x68, 0xab, 0xbf, - 0x5d, 0xc4, 0x77, 0x7c, 0x33, 0x53, 0x9e, 0x30, 0x05, 0x5c, 0x0b, 0x3c, 0x66, 0xaf, 0x1a, 0x4c, - 0x6f, 0x3b, 0xee, 0xc5, 0x1a, 0x0b, 0xde, 0xd2, 0x2d, 0x51, 0xa0, 0xea, 0x05, 0x2a, 0x68, 0x32, - 0x6b, 0x1d, 0x8e, 0x9d, 0xcf, 0x94, 0xf9, 0x91, 0xd8, 0xe5, 0x48, 0xec, 0xdd, 0xe5, 0x48, 0xc9, - 0x75, 0xfb, 0x97, 0xd3, 0xef, 0x31, 0x49, 0x37, 0xd7, 0xb0, 0x8d, 0x83, 0x23, 0x3a, 0x6d, 0x01, - 0xea, 0x2c, 0x17, 0xb5, 0x68, 0x0a, 0x99, 0x09, 0xcc, 0xd6, 0x15, 0xe1, 0xd5, 0x7f, 0x71, 0xbc, - 0x67, 0x1b, 0x24, 0x9e, 0xdf, 0xc7, 0xfd, 0xdf, 0x74, 0xf0, 0x86, 0x6e, 0xd5, 0xc2, 0x60, 0x96, - 0xd7, 0x50, 0x9c, 0x78, 0xd5, 0x6b, 0xff, 0xa1, 0x7a, 0xcb, 0xc2, 0x89, 0x65, 0x9d, 0xe9, 0x63, - 0xba, 0xe3, 0x2f, 0xb1, 0x15, 0x9d, 0x91, 0x65, 0x66, 0x64, 0x01, 0x4d, 0x69, 0xc2, 0xc9, 0x8c, - 0xcc, 0xc7, 0x69, 0xe0, 0xb2, 0x03, 0x17, 0x1d, 0xfa, 0x24, 0x79, 0x7e, 0xb6, 0x8c, 0xc8, 0xf9, - 0x32, 0x22, 0x3f, 0x96, 0x11, 0x39, 0x5d, 0x45, 0xa3, 0xf3, 0x55, 0x34, 0xfa, 0xba, 0x8a, 0x46, - 0x47, 0xbb, 0x95, 0xc2, 0xe3, 0x2e, 0x67, 0x05, 0x68, 0x3e, 0x6c, 0x8e, 0xec, 0x35, 0xff, 0xe0, - 0xf7, 0x07, 0x3f, 0xb6, 0xd2, 0xe4, 0x13, 0x27, 0xf7, 0xf4, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x11, 0x8a, 0x9c, 0x81, 0x9c, 0x02, 0x00, 0x00, + // 449 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x6e, 0xd4, 0x30, + 0x1c, 0xc6, 0xcf, 0x1c, 0x1c, 0x77, 0x06, 0x5a, 0x6a, 0x95, 0x12, 0x4e, 0x25, 0x77, 0xea, 0x74, + 0x62, 0xb0, 0x29, 0x4c, 0x48, 0x2c, 0x8d, 0x90, 0x10, 0x08, 0xa4, 0x2a, 0x65, 0xea, 0x12, 0x39, + 0x89, 0x49, 0xad, 0x26, 0xf9, 0x47, 0xe7, 0xff, 0x45, 0xf0, 0x16, 0x7d, 0x0c, 0x46, 0x1e, 0xa3, + 0x63, 0x47, 0xc4, 0x50, 0xd0, 0xdd, 0xc0, 0x1b, 0x30, 0x23, 0xdb, 0x29, 0x27, 0x98, 0x60, 0x89, + 0x6c, 0x7f, 0xdf, 0xef, 0x9f, 0xef, 0x4b, 0x4c, 0x77, 0x33, 0x30, 0x15, 0x18, 0x61, 0x5a, 0xdd, + 0x88, 0x76, 0x5f, 0x14, 0xaa, 0x56, 0x46, 0x1b, 0xde, 0xcc, 0x01, 0x81, 0x6d, 0x78, 0x95, 0x5b, + 0x95, 0xb7, 0xfb, 0xe3, 0x2d, 0x59, 0xe9, 0x1a, 0x84, 0x7b, 0x7a, 0xcb, 0xf8, 0xc1, 0x5f, 0x03, + 0x9c, 0xd5, 0x4b, 0xdb, 0x05, 0x14, 0xe0, 0x96, 0xc2, 0xae, 0xba, 0xd3, 0x49, 0x01, 0x50, 0x94, + 0x4a, 0xb8, 0x5d, 0xba, 0x78, 0x2f, 0x50, 0x57, 0xca, 0xa0, 0xac, 0x3a, 0x6c, 0xef, 0x67, 0x9f, + 0xde, 0x7e, 0xe9, 0x63, 0x1c, 0xa1, 0x44, 0xc5, 0x9e, 0xd1, 0x41, 0x23, 0xe7, 0xb2, 0x32, 0x01, + 0x99, 0x92, 0xd9, 0xad, 0x27, 0x3b, 0xfc, 0xcf, 0x58, 0xfc, 0xd0, 0xa9, 0xd1, 0xe8, 0xfc, 0x72, + 0xd2, 0xfb, 0xf4, 0xe3, 0xf3, 0x23, 0x12, 0x77, 0x00, 0x7b, 0x4d, 0xb7, 0x10, 0x50, 0x96, 0x49, + 0xae, 0x0d, 0xce, 0x75, 0xba, 0x40, 0x95, 0x07, 0xd7, 0xa6, 0x64, 0x36, 0x8a, 0x1e, 0x5a, 0xf7, + 0xd7, 0xcb, 0xc9, 0x3d, 0x3f, 0xcc, 0xe4, 0xa7, 0x5c, 0x83, 0xa8, 0x24, 0x9e, 0xf0, 0x57, 0x35, + 0xc6, 0x77, 0x1d, 0xf7, 0x62, 0x8d, 0xb1, 0xb7, 0x74, 0x53, 0x66, 0xa8, 0x5b, 0x89, 0x1a, 0xea, + 0xc4, 0xa6, 0x0e, 0xfa, 0x2e, 0xcf, 0x98, 0xfb, 0x4a, 0xfc, 0xaa, 0x12, 0x7f, 0x77, 0x55, 0x29, + 0x1a, 0xda, 0xb7, 0x9c, 0x7d, 0x9b, 0x90, 0x78, 0x63, 0x0d, 0x5b, 0x99, 0x1d, 0xd3, 0x71, 0x03, + 0x50, 0x26, 0xa9, 0x2c, 0x65, 0x9d, 0xa9, 0x44, 0x62, 0xb2, 0x76, 0x04, 0xd7, 0xff, 0x25, 0xe3, + 0x7d, 0x3b, 0x20, 0xf2, 0xfc, 0x01, 0x1e, 0xfc, 0xa6, 0xd9, 0x1b, 0xba, 0x59, 0x4a, 0x83, 0x49, + 0x5a, 0x42, 0x76, 0xea, 0xa3, 0xde, 0xf8, 0x8f, 0xa8, 0x77, 0x2c, 0x1c, 0x59, 0xd6, 0x25, 0x7d, + 0x4c, 0xb7, 0xfd, 0x47, 0x6c, 0xe4, 0xc2, 0xa8, 0x3c, 0x31, 0x2a, 0x83, 0x3a, 0x37, 0xc1, 0x60, + 0x4a, 0x66, 0xfd, 0x98, 0x39, 0xed, 0xd0, 0x49, 0x47, 0x5e, 0x61, 0xbb, 0x74, 0xd4, 0x75, 0x51, + 0x79, 0x70, 0x73, 0x4a, 0x66, 0xc3, 0x78, 0x7d, 0xc0, 0x76, 0xec, 0xff, 0xb4, 0xf6, 0x60, 0xe8, + 0xa4, 0x6e, 0x17, 0x3d, 0x3f, 0x5f, 0x86, 0xe4, 0x62, 0x19, 0x92, 0xef, 0xcb, 0x90, 0x9c, 0xad, + 0xc2, 0xde, 0xc5, 0x2a, 0xec, 0x7d, 0x59, 0x85, 0xbd, 0xe3, 0xbd, 0x42, 0xe3, 0xc9, 0x22, 0xe5, + 0x19, 0x54, 0xa2, 0xbb, 0x6f, 0xaa, 0xad, 0xc4, 0x07, 0x7f, 0xeb, 0xf0, 0x63, 0xa3, 0x4c, 0x3a, + 0x70, 0x95, 0x9e, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xbd, 0x69, 0x30, 0xd2, 0x02, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -163,6 +183,26 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.Activated { + i-- + if m.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } if m.TotalPausedSeconds != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.TotalPausedSeconds)) i-- @@ -247,6 +287,12 @@ func (m *GenesisState) Size() (n int) { if m.TotalPausedSeconds != 0 { n += 1 + sovGenesis(uint64(m.TotalPausedSeconds)) } + if m.Activated { + n += 2 + } + if m.Paused { + n += 2 + } return n } @@ -471,6 +517,46 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Activated = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/svip/types/svip.pb.go b/x/svip/types/svip.pb.go index 62cc65ae..ee86760a 100644 --- a/x/svip/types/svip.pb.go +++ b/x/svip/types/svip.pb.go @@ -26,10 +26,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the x/svip module parameters. type Params struct { - // activated indicates whether SVIP reward distribution is active. - Activated bool `protobuf:"varint,1,opt,name=activated,proto3" json:"activated"` - // paused is an emergency pause flag. - Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused"` // half_life_seconds is the half-life for exponential decay, in seconds. HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds"` } @@ -67,20 +63,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetActivated() bool { - if m != nil { - return m.Activated - } - return false -} - -func (m *Params) GetPaused() bool { - if m != nil { - return m.Paused - } - return false -} - func (m *Params) GetHalfLifeSeconds() int64 { if m != nil { return m.HalfLifeSeconds @@ -95,24 +77,21 @@ func init() { func init() { proto.RegisterFile("cosmos/svip/v1/svip.proto", fileDescriptor_37b8c507ba0d74ab) } var fileDescriptor_37b8c507ba0d74ab = []byte{ - // 269 bytes of a gzipped FileDescriptorProto + // 213 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x2f, 0x2e, 0xcb, 0x2c, 0xd0, 0x2f, 0x33, 0x04, 0xd3, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x7c, 0x10, 0x29, 0x3d, 0xb0, 0x50, 0x99, 0xa1, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x28, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, - 0x2c, 0x88, 0xa8, 0xd2, 0x31, 0x46, 0x2e, 0xb6, 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x03, - 0x2e, 0xce, 0xc4, 0xe4, 0x92, 0xcc, 0xb2, 0xc4, 0x92, 0xd4, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, - 0x0e, 0x27, 0xa1, 0x57, 0xf7, 0xe4, 0x11, 0x82, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0xf0, - 0x85, 0xd4, 0xb9, 0xd8, 0x0a, 0x12, 0x4b, 0x8b, 0x53, 0x53, 0x24, 0x98, 0xc0, 0xca, 0xf9, 0x5f, - 0xdd, 0x93, 0x87, 0x8a, 0x40, 0xd4, 0x42, 0x39, 0x42, 0x6e, 0x5c, 0x82, 0x19, 0x89, 0x39, 0x69, - 0xf1, 0x39, 0x99, 0x69, 0xa9, 0xf1, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5, 0x12, 0xcc, 0x0a, - 0x8c, 0x1a, 0xcc, 0x4e, 0x52, 0xaf, 0xee, 0xc9, 0x63, 0x4a, 0x42, 0xb4, 0xf3, 0x83, 0xc4, 0x7d, - 0x32, 0xd3, 0x52, 0x83, 0x21, 0xa2, 0x56, 0x92, 0x5d, 0xcf, 0x37, 0x68, 0x89, 0x40, 0x83, 0xa1, - 0x02, 0x12, 0x10, 0x10, 0xd7, 0x3b, 0xd9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, - 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, - 0x43, 0x94, 0x52, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x54, 0x6b, - 0x6a, 0x59, 0x2e, 0x4c, 0x7b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x34, 0x8c, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xba, 0x01, 0x40, 0x92, 0x63, 0x01, 0x00, 0x00, + 0x2c, 0x88, 0xa8, 0x52, 0x36, 0x17, 0x5b, 0x40, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x90, 0x1b, 0x97, + 0x60, 0x46, 0x62, 0x4e, 0x5a, 0x7c, 0x4e, 0x66, 0x5a, 0x6a, 0x7c, 0x71, 0x6a, 0x72, 0x7e, 0x5e, + 0x4a, 0xb1, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0xb3, 0x93, 0xd4, 0xab, 0x7b, 0xf2, 0x98, 0x92, 0x2b, + 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0xe2, 0x07, 0x89, 0xfb, 0x64, 0xa6, 0xa5, 0x06, 0x43, 0x44, 0xad, + 0x24, 0xbb, 0x9e, 0x6f, 0xd0, 0x12, 0x81, 0x3a, 0xb5, 0x02, 0xe2, 0x58, 0x88, 0x15, 0x4e, 0x36, + 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, + 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, 0x51, + 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xd5, 0x9a, 0x5a, 0x96, 0x0b, 0xd3, 0x5e, 0x52, 0x59, + 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xb1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf7, 0x95, + 0x32, 0x07, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -140,26 +119,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if m.Paused { - i-- - if m.Paused { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Activated { - i-- - if m.Activated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } @@ -180,12 +139,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - if m.Activated { - n += 2 - } - if m.Paused { - n += 2 - } if m.HalfLifeSeconds != 0 { n += 1 + sovSvip(uint64(m.HalfLifeSeconds)) } @@ -227,46 +180,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { 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 Activated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSvip - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Activated = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSvip - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Paused = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) diff --git a/x/svip/types/tx.pb.go b/x/svip/types/tx.pb.go index b03e4d21..59a3788a 100644 --- a/x/svip/types/tx.pb.go +++ b/x/svip/types/tx.pb.go @@ -37,7 +37,7 @@ type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the x/svip parameters to update. - // NOTE: All parameters must be supplied. + // NOTE: Only half_life_seconds is configurable via this message. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } From 5b7c88726f44f578ff00c660a821030a55ace4d5 Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Fri, 20 Mar 2026 22:10:12 +0530 Subject: [PATCH 11/12] refactor(svip): store activated/paused as standalone KV state --- x/svip/genesis.go | 4 ++++ x/svip/keeper/abci.go | 6 +++--- x/svip/keeper/keeper.go | 32 ++++++++++++++++++++++++++++++++ x/svip/keeper/msg_server.go | 33 +++++++++------------------------ x/svip/keeper/query_server.go | 10 ++++++---- x/svip/module.go | 2 +- x/svip/types/genesis_logic.go | 5 +++++ x/svip/types/keys.go | 4 ++++ x/svip/types/params.go | 7 +------ 9 files changed, 65 insertions(+), 38 deletions(-) diff --git a/x/svip/genesis.go b/x/svip/genesis.go index 915439d6..cc7346c9 100644 --- a/x/svip/genesis.go +++ b/x/svip/genesis.go @@ -14,6 +14,8 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) []ab if err := k.SetParams(ctx, data.Params); err != nil { panic(errorsmod.Wrap(err, "could not set parameters at genesis")) } + k.SetActivated(ctx, data.Activated) + k.SetPaused(ctx, data.Paused) if data.TotalDistributed.IsPositive() { k.SetTotalDistributed(ctx, data.TotalDistributed) } @@ -43,5 +45,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { PoolBalanceAtActivation: k.GetPoolBalanceAtActivation(ctx), LastBlockTime: k.GetLastBlockTime(ctx), TotalPausedSeconds: k.GetTotalPausedSeconds(ctx), + Activated: k.GetActivated(ctx), + Paused: k.GetPaused(ctx), } } diff --git a/x/svip/keeper/abci.go b/x/svip/keeper/abci.go index b572f9a9..742bd064 100644 --- a/x/svip/keeper/abci.go +++ b/x/svip/keeper/abci.go @@ -9,13 +9,13 @@ import ( // BeginBlock distributes decayed rewards to FeeCollector. func (k Keeper) BeginBlock(ctx sdk.Context) error { - params := k.GetParams(ctx) - // 1. Guard: skip if not active - if !params.Activated || params.Paused { + if !k.GetActivated(ctx) || k.GetPaused(ctx) { return nil } + params := k.GetParams(ctx) + // 2. Time context now := ctx.BlockTime() activationTime := k.GetActivationTime(ctx) diff --git a/x/svip/keeper/keeper.go b/x/svip/keeper/keeper.go index f8a037e0..7abcf594 100644 --- a/x/svip/keeper/keeper.go +++ b/x/svip/keeper/keeper.go @@ -177,6 +177,38 @@ func (k Keeper) SetTotalPausedSeconds(ctx sdk.Context, secs int64) { store.Set(types.TotalPausedSecondsKey, bz) } +var isTrue = []byte("0x01") + +// GetActivated returns whether SVIP reward distribution is active. +func (k Keeper) GetActivated(ctx sdk.Context) bool { + return ctx.KVStore(k.storeKey).Has(types.ActivatedKey) +} + +// SetActivated stores the activated flag using a presence-based pattern. +func (k Keeper) SetActivated(ctx sdk.Context, activated bool) { + store := ctx.KVStore(k.storeKey) + if activated { + store.Set(types.ActivatedKey, isTrue) + return + } + store.Delete(types.ActivatedKey) +} + +// GetPaused returns whether SVIP is in emergency pause state. +func (k Keeper) GetPaused(ctx sdk.Context) bool { + return ctx.KVStore(k.storeKey).Has(types.PausedKey) +} + +// SetPaused stores the paused flag using a presence-based pattern. +func (k Keeper) SetPaused(ctx sdk.Context, paused bool) { + store := ctx.KVStore(k.storeKey) + if paused { + store.Set(types.PausedKey, isTrue) + return + } + store.Delete(types.PausedKey) +} + // getPoolBalance reads the live pool balance from x/bank (not from custom state). func (k Keeper) getPoolBalance(ctx sdk.Context) sdkmath.Int { moduleAddr := k.ak.GetModuleAddress(types.ModuleName) diff --git a/x/svip/keeper/msg_server.go b/x/svip/keeper/msg_server.go index 9fbf825d..41625c28 100644 --- a/x/svip/keeper/msg_server.go +++ b/x/svip/keeper/msg_server.go @@ -34,10 +34,7 @@ func (s msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam // Governance guardrails current := s.GetParams(ctx) - if current.Activated && !msg.Params.Activated { - return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "cannot deactivate SVIP after activation") - } - if current.Activated && current.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds > 0 { + if s.GetActivated(ctx) && current.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds > 0 { // Reject if half_life changes by more than 50% oldHL := float64(current.HalfLifeSeconds) newHL := float64(msg.Params.HalfLifeSeconds) @@ -63,11 +60,11 @@ func (s msgServer) Activate(goCtx context.Context, msg *types.MsgActivate) (*typ } ctx := sdk.UnwrapSDKContext(goCtx) - params := s.GetParams(ctx) - if params.Activated { + if s.GetActivated(ctx) { return nil, types.ErrAlreadyActivated } + params := s.GetParams(ctx) if params.HalfLifeSeconds <= 0 { return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be set before activation") } @@ -80,10 +77,7 @@ func (s msgServer) Activate(goCtx context.Context, msg *types.MsgActivate) (*typ s.SetPoolBalanceAtActivation(ctx, poolBalance) // Activate - params.Activated = true - if err := s.SetParams(ctx, params); err != nil { - return nil, err - } + s.SetActivated(ctx, true) s.SetActivationTime(ctx, ctx.BlockTime()) s.SetLastBlockTime(ctx, ctx.BlockTime()) @@ -103,8 +97,7 @@ func (s msgServer) Reactivate(goCtx context.Context, msg *types.MsgReactivate) ( } ctx := sdk.UnwrapSDKContext(goCtx) - params := s.GetParams(ctx) - if !params.Activated { + if !s.GetActivated(ctx) { return nil, types.ErrNotYetActivated } @@ -122,13 +115,9 @@ func (s msgServer) Reactivate(goCtx context.Context, msg *types.MsgReactivate) ( s.SetTotalPausedSeconds(ctx, 0) // Clear paused state if reactivating while paused - if params.Paused { - params.Paused = false - if err := s.SetParams(ctx, params); err != nil { - return nil, err - } - } + s.SetPaused(ctx, false) + params := s.GetParams(ctx) ctx.EventManager().EmitEvent(sdk.NewEvent( "svip_reactivated", sdk.NewAttribute("pool_balance", poolBalance.String()), @@ -144,12 +133,8 @@ func (s msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.Msg return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) - params := s.GetParams(ctx) - wasPaused := params.Paused - params.Paused = msg.Paused - if err := s.SetParams(ctx, params); err != nil { - return nil, err - } + wasPaused := s.GetPaused(ctx) + s.SetPaused(ctx, msg.Paused) // On unpause: accumulate paused duration + reset LastBlockTime if wasPaused && !msg.Paused { diff --git a/x/svip/keeper/query_server.go b/x/svip/keeper/query_server.go index 8186a973..d8017896 100644 --- a/x/svip/keeper/query_server.go +++ b/x/svip/keeper/query_server.go @@ -30,13 +30,15 @@ func (s queryServer) Params(goCtx context.Context, _ *types.QueryParamsRequest) // PoolState returns the current SVIP pool state including balance and distribution info. func (s queryServer) PoolState(goCtx context.Context, _ *types.QueryPoolStateRequest) (*types.QueryPoolStateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - params := s.GetParams(ctx) + activated := s.GetActivated(ctx) + paused := s.GetPaused(ctx) denom := s.getDenom(ctx) moduleAddr := s.ak.GetModuleAddress(types.ModuleName) balance := s.bk.GetBalance(ctx, moduleAddr, denom) var currentRate math.LegacyDec - if params.Activated && !params.Paused { + if activated && !paused { + params := s.GetParams(ctx) totalPausedSec := float64(s.GetTotalPausedSeconds(ctx)) elapsed := ctx.BlockTime().Sub(s.GetActivationTime(ctx)).Seconds() - totalPausedSec poolAtAct := s.GetPoolBalanceAtActivation(ctx) @@ -51,8 +53,8 @@ func (s queryServer) PoolState(goCtx context.Context, _ *types.QueryPoolStateReq PoolBalance: balance, TotalDistributed: s.GetTotalDistributed(ctx), CurrentRatePerSecond: currentRate, - Activated: params.Activated, - Paused: params.Paused, + Activated: activated, + Paused: paused, ActivationTime: s.GetActivationTime(ctx), }, nil } diff --git a/x/svip/module.go b/x/svip/module.go index c310d547..b0c593ce 100644 --- a/x/svip/module.go +++ b/x/svip/module.go @@ -23,7 +23,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" ) -const consensusVersion = 1 +const consensusVersion = 2 var ( _ module.AppModule = AppModule{} diff --git a/x/svip/types/genesis_logic.go b/x/svip/types/genesis_logic.go index 7989b53f..f74dc793 100644 --- a/x/svip/types/genesis_logic.go +++ b/x/svip/types/genesis_logic.go @@ -16,6 +16,8 @@ func DefaultGenesisState() *GenesisState { PoolBalanceAtActivation: sdkmath.ZeroInt(), LastBlockTime: time.Time{}, TotalPausedSeconds: 0, + Activated: false, + Paused: false, } } @@ -30,5 +32,8 @@ func (gs GenesisState) Validate() error { if gs.TotalPausedSeconds < 0 { return fmt.Errorf("total_paused_seconds cannot be negative: %d", gs.TotalPausedSeconds) } + if gs.Activated && gs.Params.HalfLifeSeconds == 0 { + return fmt.Errorf("half_life_seconds must be set when activated") + } return nil } diff --git a/x/svip/types/keys.go b/x/svip/types/keys.go index 5882f53e..6fab1871 100644 --- a/x/svip/types/keys.go +++ b/x/svip/types/keys.go @@ -14,6 +14,8 @@ const ( prefixLastBlockTime prefixPoolBalanceAtActivation prefixTotalPausedSeconds + prefixActivated + prefixPaused ) var ( @@ -23,4 +25,6 @@ var ( LastBlockTimeKey = []byte{prefixLastBlockTime} PoolBalanceAtActivationKey = []byte{prefixPoolBalanceAtActivation} TotalPausedSecondsKey = []byte{prefixTotalPausedSeconds} + ActivatedKey = []byte{prefixActivated} + PausedKey = []byte{prefixPaused} ) diff --git a/x/svip/types/params.go b/x/svip/types/params.go index db20d5a2..ebe9ac25 100644 --- a/x/svip/types/params.go +++ b/x/svip/types/params.go @@ -5,9 +5,7 @@ import "fmt" // DefaultParams returns the default SVIP module parameters. func DefaultParams() Params { return Params{ - Activated: false, - Paused: false, - HalfLifeSeconds: 0, // set on activation + HalfLifeSeconds: 0, // set before activation } } @@ -16,8 +14,5 @@ func (p Params) Validate() error { if p.HalfLifeSeconds < 0 { return fmt.Errorf("half_life_seconds cannot be negative: %d", p.HalfLifeSeconds) } - if p.Activated && p.HalfLifeSeconds == 0 { - return fmt.Errorf("half_life_seconds must be set when activated") - } return nil } From 5f40e82f2df30223b8d7e1aea1377d92dcc13d2d Mon Sep 17 00:00:00 2001 From: Yogesh Shahi Date: Fri, 20 Mar 2026 22:10:18 +0530 Subject: [PATCH 12/12] test+docs(svip): update tests and docs for standalone activated/paused state --- evmd/docs/SVIP.md | 9 +- evmd/docs/svip_update_params_proposal.json | 2 - x/svip/keeper/keeper_test.go | 47 +++++++++-- x/svip/keeper/msg_server_test.go | 97 +++++++--------------- x/svip/types/genesis_test.go | 13 ++- x/svip/types/msgs_test.go | 2 +- x/svip/types/params_test.go | 18 +--- 7 files changed, 90 insertions(+), 98 deletions(-) diff --git a/evmd/docs/SVIP.md b/evmd/docs/SVIP.md index 1671ad2e..4e3ae40f 100644 --- a/evmd/docs/SVIP.md +++ b/evmd/docs/SVIP.md @@ -148,8 +148,6 @@ Open `/tmp/svip_set_params.json` and replace `` with the address "@type": "/cosmos.svip.v1.MsgUpdateParams", "authority": "og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k", "params": { - "activated": false, - "paused": false, "half_life_seconds": "473364000" } } @@ -202,12 +200,11 @@ Status should be `PROPOSAL_STATUS_PASSED`. evmd q svip params ``` -> **Heads up:** Don't be alarmed if this shows `params: {}`. Before activation, both `activated` and `paused` are `false`, and `half_life_seconds` is an integer. Proto3 serialization drops fields that equal their default values (`false`, `0`), so the whole thing looks empty even though the values are stored correctly. If you want proof, just move on to step 3. `MsgActivate` will reject with "half_life_seconds must be set before activation" if the value didn't stick. +> **Heads up:** Don't be alarmed if this shows `params: {}`. `half_life_seconds` is an integer, and proto3 serialization drops fields that equal their default value (`0`), so the whole thing looks empty even though the value is stored correctly. If you want proof, just move on to step 3. `MsgActivate` will reject with "half_life_seconds must be set before activation" if the value didn't stick. > **Devnet:** Use `--from mykey --home ~/.og-evm-devnet --chain-id 10740 --keyring-backend test --gas 300000 --gas-prices 10000000ogwei` for both submit and vote. Deposit is `10000000ogwei`. Wait ~35 seconds after voting. **Guardrails:** -- You can't set `activated` back to `false` once it's been turned on. Activation is permanent. - `half_life_seconds` must be at least 1 year. - After activation, `half_life_seconds` can't change by more than 50% in a single proposal. @@ -391,14 +388,14 @@ evmd q svip pool-state ## Queries ```bash -# Module parameters (activated, paused, half_life_seconds) +# Module parameters (half_life_seconds) evmd q svip params # Pool state (balance, total distributed, current rate, activation time) evmd q svip pool-state ``` -> **About `params: {}`:** The params query uses proto3 serialization, which drops fields that equal their default value (`false` for bools, `0` for integers). Before activation, this means you'll see `params: {}` even when `half_life_seconds` is set. After activation, `activated: true` shows up but `paused` still hides when it's false. Don't worry, the values are stored correctly. Use `q svip pool-state` for the full picture. +> **About `params: {}`:** The params query uses proto3 serialization, which drops fields that equal their default value (`0` for integers). This means you'll see `params: {}` even when `half_life_seconds` is set to 0. Don't worry, the value is stored correctly. Use `q svip pool-state` for the full picture including activated/paused status. --- diff --git a/evmd/docs/svip_update_params_proposal.json b/evmd/docs/svip_update_params_proposal.json index 120dec44..ebf7c1e3 100644 --- a/evmd/docs/svip_update_params_proposal.json +++ b/evmd/docs/svip_update_params_proposal.json @@ -4,8 +4,6 @@ "@type": "/cosmos.svip.v1.MsgUpdateParams", "authority": "", "params": { - "activated": false, - "paused": false, "half_life_seconds": "473364000" } } diff --git a/x/svip/keeper/keeper_test.go b/x/svip/keeper/keeper_test.go index e3948788..add652d2 100644 --- a/x/svip/keeper/keeper_test.go +++ b/x/svip/keeper/keeper_test.go @@ -70,8 +70,6 @@ func TestGetSetParams(t *testing.T) { // Set custom params and read back custom := types.Params{ - Activated: true, - Paused: false, HalfLifeSeconds: 31536000, } require.NoError(t, td.keeper.SetParams(td.ctx, custom)) @@ -79,6 +77,36 @@ func TestGetSetParams(t *testing.T) { require.Equal(t, custom, got) } +func TestGetSetActivated(t *testing.T) { + td := newMockedTestData(t) + + // Default is false + require.False(t, td.keeper.GetActivated(td.ctx)) + + // Set true and read back + td.keeper.SetActivated(td.ctx, true) + require.True(t, td.keeper.GetActivated(td.ctx)) + + // Set false and read back + td.keeper.SetActivated(td.ctx, false) + require.False(t, td.keeper.GetActivated(td.ctx)) +} + +func TestGetSetPaused(t *testing.T) { + td := newMockedTestData(t) + + // Default is false + require.False(t, td.keeper.GetPaused(td.ctx)) + + // Set true and read back + td.keeper.SetPaused(td.ctx, true) + require.True(t, td.keeper.GetPaused(td.ctx)) + + // Set false and read back + td.keeper.SetPaused(td.ctx, false) + require.False(t, td.keeper.GetPaused(td.ctx)) +} + func TestGetSetTotalDistributed(t *testing.T) { td := newMockedTestData(t) @@ -144,8 +172,9 @@ func TestBeginBlock_NotActivated(t *testing.T) { func TestBeginBlock_Paused(t *testing.T) { td := newMockedTestData(t) - params := types.Params{Activated: true, Paused: true, HalfLifeSeconds: 31536000} - require.NoError(t, td.keeper.SetParams(td.ctx, params)) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) err := td.keeper.BeginBlock(td.ctx) require.NoError(t, err) @@ -160,9 +189,9 @@ func TestBeginBlock_Distributes(t *testing.T) { halfLife := int64(31536000) poolBalance := sdkmath.NewInt(1_000_000_000_000) - // Set params as activated - params := types.Params{Activated: true, Paused: false, HalfLifeSeconds: halfLife} - require.NoError(t, td.keeper.SetParams(td.ctx, params)) + // Set params and activate + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + td.keeper.SetActivated(td.ctx, true) // Set activation state activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) @@ -216,8 +245,8 @@ func TestBeginBlock_CapsAtPoolBalance(t *testing.T) { // Remaining pool balance is tiny — smaller than calculated reward tinyBalance := sdkmath.NewInt(1) - params := types.Params{Activated: true, Paused: false, HalfLifeSeconds: halfLife} - require.NoError(t, td.keeper.SetParams(td.ctx, params)) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + td.keeper.SetActivated(td.ctx, true) activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) td.keeper.SetActivationTime(td.ctx, activationTime) diff --git a/x/svip/keeper/msg_server_test.go b/x/svip/keeper/msg_server_test.go index 3dcf1aa6..e525963e 100644 --- a/x/svip/keeper/msg_server_test.go +++ b/x/svip/keeper/msg_server_test.go @@ -32,72 +32,51 @@ func TestUpdateParams_InvalidAuthority(t *testing.T) { require.ErrorContains(t, err, "invalid authority") } -func TestUpdateParams_CannotDeactivate(t *testing.T) { - td := newMockedTestData(t) - srv := keeper.NewMsgServerImpl(td.keeper) - - // Set as activated - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 31536000, - })) - - _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ - Authority: govAuthority(), - Params: types.Params{Activated: false, HalfLifeSeconds: 31536000}, - }) - require.ErrorContains(t, err, "cannot deactivate") -} - func TestUpdateParams_HalfLifeChangeCap(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 100_000_000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) + td.keeper.SetActivated(td.ctx, true) // >50% increase (1.6x) should fail _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: true, HalfLifeSeconds: 160_000_000}, + Params: types.Params{HalfLifeSeconds: 160_000_000}, }) require.ErrorIs(t, err, types.ErrHalfLifeChange) // >50% decrease (0.4x) should fail _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: true, HalfLifeSeconds: 40_000_000}, + Params: types.Params{HalfLifeSeconds: 40_000_000}, }) require.ErrorIs(t, err, types.ErrHalfLifeChange) // Exact 0.5x boundary (ratio == 0.5) should pass _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: true, HalfLifeSeconds: 50_000_000}, + Params: types.Params{HalfLifeSeconds: 50_000_000}, }) require.NoError(t, err) // Reset to 100M for next boundary test - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 100_000_000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) // Exact 1.5x boundary (ratio == 1.5) should pass _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: true, HalfLifeSeconds: 150_000_000}, + Params: types.Params{HalfLifeSeconds: 150_000_000}, }) require.NoError(t, err) // Reset to 100M for next test - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 100_000_000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) // Within 50% (1.3x) should pass _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: true, HalfLifeSeconds: 130_000_000}, + Params: types.Params{HalfLifeSeconds: 130_000_000}, }) require.NoError(t, err) } @@ -108,7 +87,7 @@ func TestUpdateParams_HalfLifeMinimum(t *testing.T) { _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), - Params: types.Params{Activated: false, HalfLifeSeconds: 1000}, // < 1 year + Params: types.Params{HalfLifeSeconds: 1000}, // < 1 year }) require.ErrorContains(t, err, "half_life_seconds must be >= 1 year") } @@ -117,7 +96,7 @@ func TestUpdateParams_HappyPath(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - newParams := types.Params{Activated: false, HalfLifeSeconds: 63072000} // 2 years + newParams := types.Params{HalfLifeSeconds: 63072000} // 2 years _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ Authority: govAuthority(), Params: newParams, @@ -138,9 +117,8 @@ func TestActivate_AlreadyActivated(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) require.ErrorIs(t, err, types.ErrAlreadyActivated) @@ -159,9 +137,7 @@ func TestActivate_PoolNotFunded(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: false, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) denom := vmtypes.GetEVMCoinDenom() moduleAddr := authtypes.NewModuleAddress(types.ModuleName) @@ -179,9 +155,7 @@ func TestActivate_HappyPath(t *testing.T) { halfLife := int64(31536000) poolBalance := sdkmath.NewInt(1_000_000_000_000) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: false, HalfLifeSeconds: halfLife, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) denom := vmtypes.GetEVMCoinDenom() moduleAddr := authtypes.NewModuleAddress(types.ModuleName) @@ -194,8 +168,7 @@ func TestActivate_HappyPath(t *testing.T) { _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) require.NoError(t, err) - params := td.keeper.GetParams(ctx) - require.True(t, params.Activated) + require.True(t, td.keeper.GetActivated(ctx)) require.Equal(t, poolBalance, td.keeper.GetPoolBalanceAtActivation(ctx)) require.Equal(t, blockTime, td.keeper.GetActivationTime(ctx).UTC()) require.Equal(t, blockTime, td.keeper.GetLastBlockTime(ctx).UTC()) @@ -213,9 +186,8 @@ func TestReactivate_PoolNotFunded(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) denom := vmtypes.GetEVMCoinDenom() moduleAddr := authtypes.NewModuleAddress(types.ModuleName) @@ -230,9 +202,9 @@ func TestReactivate_ClearsPaused(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, Paused: true, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) td.keeper.SetTotalPausedSeconds(td.ctx, 500) poolBalance := sdkmath.NewInt(1_000_000_000_000) @@ -247,8 +219,7 @@ func TestReactivate_ClearsPaused(t *testing.T) { _, err := srv.Reactivate(ctx, &types.MsgReactivate{Authority: govAuthority()}) require.NoError(t, err) - params := td.keeper.GetParams(ctx) - require.False(t, params.Paused, "reactivate should clear paused flag") + require.False(t, td.keeper.GetPaused(ctx), "reactivate should clear paused flag") require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) require.True(t, td.keeper.GetTotalDistributed(ctx).IsZero()) } @@ -257,9 +228,8 @@ func TestReactivate_HappyPath(t *testing.T) { td := newMockedTestData(t) srv := keeper.NewMsgServerImpl(td.keeper) - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) td.keeper.SetTotalDistributed(td.ctx, sdkmath.NewInt(5000)) newPoolBalance := sdkmath.NewInt(500_000_000_000) @@ -293,9 +263,9 @@ func TestPause_AccumulatesPausedDuration(t *testing.T) { srv := keeper.NewMsgServerImpl(td.keeper) // Start with activated + paused - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: true, Paused: true, HalfLifeSeconds: 31536000, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) pauseStart := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) td.keeper.SetLastBlockTime(td.ctx, pauseStart) @@ -310,9 +280,8 @@ func TestPause_AccumulatesPausedDuration(t *testing.T) { require.Equal(t, int64(100), td.keeper.GetTotalPausedSeconds(ctx)) require.Equal(t, unpauseTime, td.keeper.GetLastBlockTime(ctx).UTC()) - // Verify params updated - params := td.keeper.GetParams(ctx) - require.False(t, params.Paused) + // Verify paused flag cleared + require.False(t, td.keeper.GetPaused(ctx)) } func TestPause_HappyPath(t *testing.T) { @@ -325,12 +294,12 @@ func TestPause_HappyPath(t *testing.T) { // Pause _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: true}) require.NoError(t, err) - require.True(t, td.keeper.GetParams(td.ctx).Paused) + require.True(t, td.keeper.GetPaused(td.ctx)) // Unpause _, err = srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) require.NoError(t, err) - require.False(t, td.keeper.GetParams(td.ctx).Paused) + require.False(t, td.keeper.GetPaused(td.ctx)) } func TestFundPool_InvalidDepositor(t *testing.T) { @@ -392,9 +361,7 @@ func TestBeginBlock_AfterPauseUnpause(t *testing.T) { ).Return(nil) // 1. Activate at T=0 - require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{ - Activated: false, HalfLifeSeconds: halfLife, - })) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) ctx := td.ctx.WithBlockTime(activationTime) _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) diff --git a/x/svip/types/genesis_test.go b/x/svip/types/genesis_test.go index e4cb9b58..2af46862 100644 --- a/x/svip/types/genesis_test.go +++ b/x/svip/types/genesis_test.go @@ -55,12 +55,23 @@ func (suite *GenesisTestSuite) TestGenesisStateValidate() { { "invalid - activated with half_life=0", types.GenesisState{ - Params: types.Params{Activated: true, HalfLifeSeconds: 0}, + Params: types.Params{HalfLifeSeconds: 0}, + Activated: true, TotalDistributed: sdkmath.ZeroInt(), PoolBalanceAtActivation: sdkmath.ZeroInt(), }, true, }, + { + "valid - activated with half_life set", + types.GenesisState{ + Params: types.Params{HalfLifeSeconds: 31536000}, + Activated: true, + TotalDistributed: sdkmath.ZeroInt(), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + false, + }, } for _, tc := range testCases { diff --git a/x/svip/types/msgs_test.go b/x/svip/types/msgs_test.go index 9107be77..9ba31b46 100644 --- a/x/svip/types/msgs_test.go +++ b/x/svip/types/msgs_test.go @@ -36,7 +36,7 @@ func (suite *MsgsTestSuite) TestMsgUpdateParamsValidateBasic() { }, { "fail - valid authority but invalid params", - &types.MsgUpdateParams{Authority: govAddr, Params: types.Params{Activated: true, HalfLifeSeconds: 0}}, + &types.MsgUpdateParams{Authority: govAddr, Params: types.Params{HalfLifeSeconds: -1}}, false, }, { diff --git a/x/svip/types/params_test.go b/x/svip/types/params_test.go index 035fe7fd..0390b41f 100644 --- a/x/svip/types/params_test.go +++ b/x/svip/types/params_test.go @@ -32,23 +32,13 @@ func (suite *ParamsTestSuite) TestParamsValidate() { true, }, { - "activated but half_life=0", - types.Params{Activated: true, HalfLifeSeconds: 0}, - true, - }, - { - "not activated, half_life=0", - types.Params{Activated: false, HalfLifeSeconds: 0}, - false, - }, - { - "valid activated params", - types.Params{Activated: true, HalfLifeSeconds: 31536000}, + "half_life=0 valid", + types.Params{HalfLifeSeconds: 0}, false, }, { - "valid activated with paused", - types.Params{Activated: true, Paused: true, HalfLifeSeconds: 31536000}, + "valid half_life", + types.Params{HalfLifeSeconds: 31536000}, false, }, }