diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 3a46d378..3239dc5c 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -4,104 +4,54 @@ ## Table of Contents -- [osmosis/meshsecurity/v1beta1/meshsecurity.proto](#osmosis/meshsecurity/v1beta1/meshsecurity.proto) - - [Params](#osmosis.meshsecurity.v1beta1.Params) - - [VirtualStakingMaxCapInfo](#osmosis.meshsecurity.v1beta1.VirtualStakingMaxCapInfo) +- [osmosis/meshsecurityprovider/genesis.proto](#osmosis/meshsecurityprovider/genesis.proto) + - [GenesisState](#osmosis.meshsecurityprovider.GenesisState) + - [Params](#osmosis.meshsecurityprovider.Params) -- [osmosis/meshsecurity/v1beta1/genesis.proto](#osmosis/meshsecurity/v1beta1/genesis.proto) - - [GenesisState](#osmosis.meshsecurity.v1beta1.GenesisState) +- [osmosis/meshsecurityprovider/query.proto](#osmosis/meshsecurityprovider/query.proto) + - [ParamsRequest](#osmosis.meshsecurityprovider.ParamsRequest) + - [ParamsResponse](#osmosis.meshsecurityprovider.ParamsResponse) -- [osmosis/meshsecurity/v1beta1/query.proto](#osmosis/meshsecurity/v1beta1/query.proto) - - [QueryParamsRequest](#osmosis.meshsecurity.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#osmosis.meshsecurity.v1beta1.QueryParamsResponse) - - [QueryVirtualStakingMaxCapLimitRequest](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitRequest) - - [QueryVirtualStakingMaxCapLimitResponse](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitResponse) - - [QueryVirtualStakingMaxCapLimitsRequest](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitsRequest) - - [QueryVirtualStakingMaxCapLimitsResponse](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitsResponse) + - [Query](#osmosis.meshsecurityprovider.Query) - - [Query](#osmosis.meshsecurity.v1beta1.Query) +- [osmosis/meshsecurityprovider/tx.proto](#osmosis/meshsecurityprovider/tx.proto) + - [MsgTest](#osmosis.meshsecurityprovider.MsgTest) + - [MsgTestResponse](#osmosis.meshsecurityprovider.MsgTestResponse) + - [MsgUpdateParams](#osmosis.meshsecurityprovider.MsgUpdateParams) + - [MsgUpdateParamsResponse](#osmosis.meshsecurityprovider.MsgUpdateParamsResponse) -- [osmosis/meshsecurity/v1beta1/scheduler.proto](#osmosis/meshsecurity/v1beta1/scheduler.proto) - - [ScheduledWork](#osmosis.meshsecurity.v1beta1.ScheduledWork) - - [ValidatorAddress](#osmosis.meshsecurity.v1beta1.ValidatorAddress) - -- [osmosis/meshsecurity/v1beta1/tx.proto](#osmosis/meshsecurity/v1beta1/tx.proto) - - [MsgSetVirtualStakingMaxCap](#osmosis.meshsecurity.v1beta1.MsgSetVirtualStakingMaxCap) - - [MsgSetVirtualStakingMaxCapResponse](#osmosis.meshsecurity.v1beta1.MsgSetVirtualStakingMaxCapResponse) - - - [Msg](#osmosis.meshsecurity.v1beta1.Msg) + - [Msg](#osmosis.meshsecurityprovider.Msg) - [Scalar Value Types](#scalar-value-types) - +

Top

-## osmosis/meshsecurity/v1beta1/meshsecurity.proto - - - - - -### Params -Params defines the parameters for the x/meshsecurity module. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `total_contracts_max_cap` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | TotalContractsMaxCap is the maximum that the sum of all contract max caps must not exceed | -| `epoch_length` | [uint32](#uint32) | | Epoch length is the number of blocks that defines an epoch | -| `max_gas_end_blocker` | [uint32](#uint32) | | MaxGasEndBlocker defines the maximum gas that can be spent in a contract sudo callback | - +## osmosis/meshsecurityprovider/genesis.proto + - - - -### VirtualStakingMaxCapInfo -VirtualStakingMaxCapInfo stores info about -virtual staking max cap +### GenesisState +GenesisState defines the meshsecurityprovider module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contract` | [string](#string) | | Contract is the address of the contract | -| `delegated` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | Delegated is the total amount currently delegated | -| `cap` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | Cap is the current max cap limit | - - - +| `params` | [Params](#osmosis.meshsecurityprovider.Params) | | params is the container of meshsecurityprovider parameters. | - - - - - + - -

Top

- -## osmosis/meshsecurity/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines meshsecurity module's genesis state. - +### Params -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#osmosis.meshsecurity.v1beta1.Params) | | | @@ -117,94 +67,32 @@ GenesisState defines meshsecurity module's genesis state. - +

Top

-## osmosis/meshsecurity/v1beta1/query.proto - - - - - -### QueryParamsRequest -QueryParamsRequest is the request type for the -Query/Params RPC method - - - - - - - - -### QueryParamsResponse -QueryParamsResponse is the response type for the -Query/Params RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#osmosis.meshsecurity.v1beta1.Params) | | | - - - - +## osmosis/meshsecurityprovider/query.proto - -### QueryVirtualStakingMaxCapLimitRequest -QueryVirtualStakingMaxCapLimitRequest is the request type for the -Query/VirtualStakingMaxCapLimit RPC method + +### ParamsRequest +=============================== Params -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | Address is the address of the contract to query | + - +### ParamsResponse -### QueryVirtualStakingMaxCapLimitResponse -QueryVirtualStakingMaxCapLimitResponse is the response type for the -Query/VirtualStakingMaxCapLimit RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegated` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | -| `cap` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | - - - - - - - - -### QueryVirtualStakingMaxCapLimitsRequest -QueryVirtualStakingMaxCapLimitsRequest is the request type for the -Query/VirtualStakingMaxCapLimits RPC method - - - - - - - - -### QueryVirtualStakingMaxCapLimitsResponse -QueryVirtualStakingMaxCapLimitsResponse is the response type for the -Query/VirtualStakingMaxCapLimits RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `max_cap_infos` | [VirtualStakingMaxCapInfo](#osmosis.meshsecurity.v1beta1.VirtualStakingMaxCapInfo) | repeated | | +| `params` | [Params](#osmosis.meshsecurityprovider.Params) | | | @@ -217,96 +105,78 @@ Query/VirtualStakingMaxCapLimits RPC method - + ### Query -Query provides defines the gRPC querier service + | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `VirtualStakingMaxCapLimit` | [QueryVirtualStakingMaxCapLimitRequest](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitRequest) | [QueryVirtualStakingMaxCapLimitResponse](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitResponse) | VirtualStakingMaxCapLimit gets max cap limit for the given contract | GET|/osmosis/meshsecurity/v1beta1/max_cap_limit/{address}| -| `VirtualStakingMaxCapLimits` | [QueryVirtualStakingMaxCapLimitsRequest](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitsRequest) | [QueryVirtualStakingMaxCapLimitsResponse](#osmosis.meshsecurity.v1beta1.QueryVirtualStakingMaxCapLimitsResponse) | VirtualStakingMaxCapLimits gets max cap limits | GET|/osmosis/meshsecurity/v1beta1/max_cap_limits| -| `Params` | [QueryParamsRequest](#osmosis.meshsecurity.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#osmosis.meshsecurity.v1beta1.QueryParamsResponse) | Params queries the parameters of x/meshsecurity module. | GET|/osmosis/meshsecurity/v1beta1/params| +| `Params` | [ParamsRequest](#osmosis.meshsecurityprovider.ParamsRequest) | [ParamsResponse](#osmosis.meshsecurityprovider.ParamsResponse) | | GET|/osmosis/meshsecurityprovider/Params| - +

Top

-## osmosis/meshsecurity/v1beta1/scheduler.proto +## osmosis/meshsecurityprovider/tx.proto - - -### ScheduledWork + +### MsgTest +===================== MsgTest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `repeat` | [bool](#bool) | | | - - +| `sender` | [string](#string) | | | - -### ValidatorAddress -ValidatorAddress payload data to be used with the scheduler + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | Address is the ValAddress bech32 string | +### MsgTestResponse - - - + - +### MsgUpdateParams +MsgUpdateParams is the Msg/UpdateParams request type. - - - -

Top

- -## osmosis/meshsecurity/v1beta1/tx.proto - - - - - -### MsgSetVirtualStakingMaxCap -MsgSetVirtualStakingMaxCap creates or updates a maximum cap limit for virtual -staking coins to the given contract. +Since: cosmos-sdk 0.47 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address that controls the module (defaults to x/gov unless overwritten). | -| `contract` | [string](#string) | | Contract is the address of the smart contract that is given permission do virtual staking which includes minting and burning staking tokens. | -| `max_cap` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | MaxCap is the limit up this the virtual tokens can be minted. | +| `authority` | [string](#string) | | authority is the address that controls the module (defaults to x/gov unless overwritten). | +| `params` | [Params](#osmosis.meshsecurityprovider.Params) | | params defines the x/staking parameters to update. + +NOTE: All parameters must be supplied. | - + -### MsgSetVirtualStakingMaxCapResponse -MsgSetVirtualStakingMaxCap returns result data. +### MsgUpdateParamsResponse +MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 @@ -319,14 +189,15 @@ MsgSetVirtualStakingMaxCap returns result data. - + ### Msg -Msg defines the wasm Msg service. + | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SetVirtualStakingMaxCap` | [MsgSetVirtualStakingMaxCap](#osmosis.meshsecurity.v1beta1.MsgSetVirtualStakingMaxCap) | [MsgSetVirtualStakingMaxCapResponse](#osmosis.meshsecurity.v1beta1.MsgSetVirtualStakingMaxCapResponse) | SetVirtualStakingMaxCap creates or updates a maximum cap limit for virtual staking coins | | +| `Test` | [MsgTest](#osmosis.meshsecurityprovider.MsgTest) | [MsgTestResponse](#osmosis.meshsecurityprovider.MsgTestResponse) | | | +| `UpdateParams` | [MsgUpdateParams](#osmosis.meshsecurityprovider.MsgUpdateParams) | [MsgUpdateParamsResponse](#osmosis.meshsecurityprovider.MsgUpdateParamsResponse) | UpdateParams defines an operation for updating the x/staking module parameters. Since: cosmos-sdk 0.47 | | diff --git a/proto/osmosis/meshsecurity/v1beta1/scheduler.proto b/proto/osmosis/meshsecurity/v1beta1/scheduler.proto index 30f481fa..34671e82 100644 --- a/proto/osmosis/meshsecurity/v1beta1/scheduler.proto +++ b/proto/osmosis/meshsecurity/v1beta1/scheduler.proto @@ -11,13 +11,10 @@ option (gogoproto.goproto_getters_all) = false; option (gogoproto.equal_all) = false; // -message ScheduledWork { - bool repeat = 1; -} - +message ScheduledWork { bool repeat = 1; } // ValidatorAddress payload data to be used with the scheduler message ValidatorAddress { // Address is the ValAddress bech32 string - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } diff --git a/proto/osmosis/meshsecurityprovider/query.proto b/proto/osmosis/meshsecurityprovider/query.proto index f6e72bcf..85ff3fc4 100644 --- a/proto/osmosis/meshsecurityprovider/query.proto +++ b/proto/osmosis/meshsecurityprovider/query.proto @@ -4,7 +4,6 @@ package osmosis.meshsecurityprovider; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "osmosis/meshsecurityprovider/genesis.proto"; -import "osmosis/meshsecurityprovider/tx.proto"; option go_package = "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types"; diff --git a/proto/osmosis/meshsecurityprovider/tx.proto b/proto/osmosis/meshsecurityprovider/tx.proto index 4203de7a..de712246 100644 --- a/proto/osmosis/meshsecurityprovider/tx.proto +++ b/proto/osmosis/meshsecurityprovider/tx.proto @@ -2,17 +2,46 @@ syntax = "proto3"; package osmosis.meshsecurityprovider; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/meshsecurityprovider/genesis.proto"; option go_package = "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types"; service Msg { - rpc Test(MsgTest) returns (MsgTestResponse); + option (cosmos.msg.v1.service) = true; + + rpc Test(MsgTest) returns (MsgTestResponse); + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // ===================== MsgTest message MsgTest { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; } -message MsgTestResponse {} \ No newline at end of file +message MsgTestResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1; + // params defines the x/staking parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +}; + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {}; \ No newline at end of file diff --git a/x/meshsecurityprovider/keeper/keeper.go b/x/meshsecurityprovider/keeper/keeper.go index 42241593..52c82ef7 100644 --- a/x/meshsecurityprovider/keeper/keeper.go +++ b/x/meshsecurityprovider/keeper/keeper.go @@ -1,38 +1,65 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cometbft/cometbft/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types" ) - type Keeper struct { - storeKey storetypes.StoreKey + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + authority string +} + +func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, authority string) *Keeper { + return &Keeper{ + storeKey: storeKey, + cdc: cdc, + authority: authority, + } +} - paramSpace paramtypes.Subspace +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+types.ModuleName) } -func NewKeeper(storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace) *Keeper { - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) +// GetAuthority returns the x/staking module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// SetParams sets the x/staking module parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + if err := params.Validate(); err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err } + store.Set(types.ParamsKey, bz) - return &Keeper{storeKey: storeKey, paramSpace: paramSpace} + return nil } -// GetParams returns the total set of meshsecurity provider parameters. +// GetParams sets the x/staking module parameters. func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return params -} + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } -// SetParams sets the total set of meshsecurity provider parameters. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) + k.cdc.MustUnmarshal(bz, ¶ms) + return params } // InitGenesis initializes the meshsecurity provider module's state from a provided genesis diff --git a/x/meshsecurityprovider/keeper/msg_server.go b/x/meshsecurityprovider/keeper/msg_server.go new file mode 100644 index 00000000..388a67dc --- /dev/null +++ b/x/meshsecurityprovider/keeper/msg_server.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types" +) + +type msgServer struct { + *Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper *Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (ms msgServer) Test(goCtx context.Context, msg *types.MsgTest) (*types.MsgTestResponse, error) { + return &types.MsgTestResponse{}, nil +} + +func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if ms.authority != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, msg.Authority) + } + + // store params + if err := ms.SetParams(ctx, msg.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/meshsecurityprovider/types/keys.go b/x/meshsecurityprovider/types/keys.go index 69cb3a11..f45acf39 100644 --- a/x/meshsecurityprovider/types/keys.go +++ b/x/meshsecurityprovider/types/keys.go @@ -10,5 +10,6 @@ const ( var ( // Key defines the store key for test_module. - Key = []byte{0x01} + Key = []byte{0x01} + ParamsKey = []byte{0x02} ) diff --git a/x/meshsecurityprovider/types/query.pb.go b/x/meshsecurityprovider/types/query.pb.go index df1012ef..2131eb8a 100644 --- a/x/meshsecurityprovider/types/query.pb.go +++ b/x/meshsecurityprovider/types/query.pb.go @@ -120,26 +120,26 @@ func init() { } var fileDescriptor_a786d55f7d35ac36 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto + // 297 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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a, - 0x84, 0xb4, 0x89, 0x31, 0x08, 0xea, 0x2e, 0x29, 0x1d, 0xe2, 0x14, 0x43, 0xdc, 0xac, 0xa4, 0xd3, - 0x74, 0xf9, 0xc9, 0x64, 0x26, 0x35, 0x21, 0x15, 0x7d, 0xbc, 0xc1, 0x00, 0x75, 0x6b, 0xc2, 0x89, - 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xb9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xc2, 0x4c, 0xd2, 0xcd, 0x49, 0x4c, 0x82, 0x18, 0xa7, 0x0b, 0x33, 0x4f, - 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x47, 0x48, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x43, - 0xdb, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xff, 0xd4, 0x61, 0xf3, 0x3e, 0x02, 0x00, 0x00, + 0x86, 0xca, 0x6a, 0xe1, 0xb5, 0x3b, 0x3d, 0x35, 0x2f, 0x15, 0x64, 0x1d, 0x58, 0xad, 0x12, 0x3f, + 0x17, 0x6f, 0x40, 0x62, 0x51, 0x62, 0x6e, 0x71, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x52, + 0x08, 0x17, 0x1f, 0x4c, 0xa0, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0xc8, 0x89, 0x8b, 0xad, 0x00, + 0x2c, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xa2, 0x87, 0xcf, 0xc5, 0x7a, 0x10, 0xdd, + 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x75, 0x1a, 0xcd, 0x66, 0xe4, 0x62, 0x0d, 0x04, + 0x79, 0x5a, 0x68, 0x22, 0x23, 0x17, 0x1b, 0x44, 0x89, 0x90, 0x36, 0x31, 0x06, 0x41, 0xdd, 0x25, + 0xa5, 0x43, 0x9c, 0x62, 0x88, 0x9b, 0x95, 0x74, 0x9a, 0x2e, 0x3f, 0x99, 0xcc, 0xa4, 0x26, 0xa4, + 0xa2, 0x8f, 0x37, 0x2c, 0xa0, 0x6e, 0x4d, 0x38, 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, 0xb7, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x98, 0x49, 0xba, + 0x39, 0x89, 0x49, 0x10, 0xe3, 0x74, 0x61, 0xe6, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x60, 0xb7, + 0xa2, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xda, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe6, 0x2d, 0xbd, 0xe8, 0x17, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/meshsecurityprovider/types/tx.pb.go b/x/meshsecurityprovider/types/tx.pb.go index 0a39f0eb..ac6bb05c 100644 --- a/x/meshsecurityprovider/types/tx.pb.go +++ b/x/meshsecurityprovider/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -110,9 +111,111 @@ func (m *MsgTestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTestResponse proto.InternalMessageInfo +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/staking 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_2777f63b77ca86c2, []int{2} +} +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 structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +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_2777f63b77ca86c2, []int{3} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgTest)(nil), "osmosis.meshsecurityprovider.MsgTest") proto.RegisterType((*MsgTestResponse)(nil), "osmosis.meshsecurityprovider.MsgTestResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "osmosis.meshsecurityprovider.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "osmosis.meshsecurityprovider.MsgUpdateParamsResponse") } func init() { @@ -120,24 +223,32 @@ func init() { } var fileDescriptor_2777f63b77ca86c2 = []byte{ - // 264 bytes of a gzipped FileDescriptorProto + // 394 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0x2f, 0xce, 0xcd, 0x2f, 0xce, 0x2c, 0xd6, 0xcf, 0x4d, 0x2d, 0xce, 0x28, 0x4e, 0x4d, 0x2e, 0x2d, 0xca, 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x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, 0x23, 0x75, - 0x73, 0x12, 0x93, 0x20, 0x41, 0xaa, 0x0b, 0x33, 0x58, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x47, - 0x30, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xc5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x8d, 0x49, 0xff, 0x82, 0x93, 0x01, 0x00, 0x00, + 0x50, 0x1f, 0xc4, 0x82, 0xe8, 0x91, 0x12, 0x4f, 0x06, 0x6b, 0xd2, 0xcf, 0x2d, 0x4e, 0xd7, 0x2f, + 0x33, 0x04, 0x51, 0x50, 0x09, 0x39, 0xa8, 0x44, 0x52, 0x62, 0x71, 0xaa, 0x7e, 0x99, 0x61, 0x52, + 0x6a, 0x49, 0xa2, 0xa1, 0x7e, 0x72, 0x7e, 0x66, 0x1e, 0x54, 0x5e, 0x0b, 0xaf, 0x9b, 0xd2, 0x53, + 0xf3, 0x52, 0x41, 0x2e, 0x01, 0xab, 0x55, 0x32, 0xe1, 0x62, 0xf7, 0x2d, 0x4e, 0x0f, 0x49, 0x2d, + 0x2e, 0x11, 0xd2, 0xe4, 0x62, 0x2b, 0x4e, 0xcd, 0x4b, 0x49, 0x2d, 0x92, 0x60, 0x54, 0x60, 0xd4, + 0xe0, 0x74, 0x12, 0xfc, 0x74, 0x4f, 0x9e, 0xb7, 0x32, 0x31, 0x37, 0xc7, 0x4a, 0x09, 0x22, 0xae, + 0x14, 0x04, 0x55, 0xa0, 0x24, 0xc8, 0xc5, 0x0f, 0xd5, 0x15, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, + 0x9c, 0xaa, 0xd4, 0xcc, 0x08, 0x16, 0x0b, 0x2d, 0x48, 0x49, 0x2c, 0x49, 0x0d, 0x48, 0x2c, 0x4a, + 0xcc, 0x2d, 0x16, 0x92, 0xe1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0x8c, 0x01, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xbe, 0x97, 0x85, 0x04, 0xf7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -153,6 +264,10 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { Test(ctx context.Context, in *MsgTest, opts ...grpc.CallOption) (*MsgTestResponse, error) + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -172,9 +287,22 @@ func (c *msgClient) Test(ctx context.Context, in *MsgTest, opts ...grpc.CallOpti return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/osmosis.meshsecurityprovider.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { Test(context.Context, *MsgTest) (*MsgTestResponse, error) + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -184,6 +312,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) Test(ctx context.Context, req *MsgTest) (*MsgTestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Test not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -207,6 +338,24 @@ func _Msg_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } +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: "/osmosis.meshsecurityprovider.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.meshsecurityprovider.Msg", HandlerType: (*MsgServer)(nil), @@ -215,6 +364,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Test", Handler: _Msg_Test_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/meshsecurityprovider/tx.proto", @@ -273,6 +426,69 @@ func (m *MsgTestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -306,6 +522,30 @@ func (m *MsgTestResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -444,6 +684,171 @@ func (m *MsgTestResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0