diff --git a/app/app.go b/app/app.go index 1f5cd1f5b..43f70fbca 100644 --- a/app/app.go +++ b/app/app.go @@ -506,7 +506,8 @@ func New( // Subspace(baseapp.Paramspace). // WithKeyTable(paramskeeper.ConsensusParamsKeyTable()), // ) - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + govModAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], govModAddress) baseApp.SetParamStore(&app.ConsensusParamsKeeper) // add capability keeper and ScopeToModule for ibc module @@ -534,21 +535,21 @@ func New( authtypes.ProtoBaseAccount, app.ModuleAccountsPermissions(), AccountAddressPrefix, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.BankKeeper = bankkeeper.NewBaseKeeper( app.cdc, app.keys[banktypes.StoreKey], app.AccountKeeper, nil, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) stakingKeeper := stakingkeeper.NewKeeper( app.cdc, app.keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.MintKeeper = mintkeeper.NewKeeper( app.cdc, @@ -557,7 +558,7 @@ func New( app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.DistrKeeper = distrkeeper.NewKeeper( app.cdc, @@ -566,14 +567,14 @@ func New( app.BankKeeper, stakingKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.SlashingKeeper = slashingkeeper.NewKeeper( app.cdc, encoding.Amino, app.keys[slashingtypes.StoreKey], stakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.CrisisKeeper = crisiskeeper.NewKeeper( app.cdc, @@ -581,7 +582,7 @@ func New( invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.AuthzKeeper = authzkeeper.NewKeeper( @@ -597,7 +598,7 @@ func New( app.cdc, homePath, app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) // register the staking hooks // NOTE: StakingKeeper above is passed by reference, so that it will contain these hooks @@ -695,6 +696,7 @@ func New( &app.Rewardskeeper, &app.VaultKeeper, &app.BandoracleKeeper, + govModAddress, ) app.LendKeeper = lendkeeper.NewKeeper( @@ -722,6 +724,7 @@ func New( &app.MarketKeeper, &app.TokenmintKeeper, &app.CollectorKeeper, + govModAddress, ) app.VaultKeeper = vaultkeeper.NewKeeper( @@ -872,6 +875,7 @@ func New( &app.LendKeeper, &app.NewaucKeeper, &app.CollectorKeeper, + govModAddress, ) app.NewaucKeeper = auctionsV2keeper.NewKeeper( @@ -895,7 +899,7 @@ func New( app.keys[commontypes.MemStoreKey], app.GetSubspace(commontypes.ModuleName), &app.WasmKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) // ICQ Keeper @@ -943,7 +947,7 @@ func New( wasmDir, wasmConfig, supportedFeatures, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, wasmOpts..., ) @@ -971,7 +975,7 @@ func New( govKeeper := govkeeper.NewKeeper( app.cdc, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), govModAddress, ) govKeeper.SetLegacyRouter(govRouter) diff --git a/proto/comdex/asset/v1beta1/tx.proto b/proto/comdex/asset/v1beta1/tx.proto index 336f9ccc7..9ee22fc3b 100644 --- a/proto/comdex/asset/v1beta1/tx.proto +++ b/proto/comdex/asset/v1beta1/tx.proto @@ -3,6 +3,9 @@ package comdex.asset.v1beta1; import "gogoproto/gogo.proto"; import "comdex/asset/v1beta1/asset.proto"; +import "comdex/asset/v1beta1/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/asset/types"; option (gogoproto.goproto_getters_all) = false; @@ -11,6 +14,7 @@ option (gogoproto.goproto_getters_all) = false; service Msg { // AddAsset defines a method for adding new asset in asset module rpc AddAsset(MsgAddAsset) returns (MsgAddAssetResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgAddAsset defines an SDK message for adding new asset in asset module. @@ -19,4 +23,25 @@ message MsgAddAsset { Asset asset = 2 [(gogoproto.nullable) = false]; } -message MsgAddAssetResponse {} \ No newline at end of file +message MsgAddAssetResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/asset 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: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/comdex/common/v1beta1/tx.proto b/proto/comdex/common/v1beta1/tx.proto index c1eba07e0..381697b0e 100644 --- a/proto/comdex/common/v1beta1/tx.proto +++ b/proto/comdex/common/v1beta1/tx.proto @@ -41,7 +41,7 @@ message MsgUpdateParams { // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // params defines the x/auth parameters to update. + // params defines the x/common parameters to update. // // NOTE: All parameters must be supplied. Params params = 2 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/esm/v1beta1/tx.proto b/proto/comdex/esm/v1beta1/tx.proto index e2a4d14a7..ba61edd11 100644 --- a/proto/comdex/esm/v1beta1/tx.proto +++ b/proto/comdex/esm/v1beta1/tx.proto @@ -4,6 +4,10 @@ package comdex.esm.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "comdex/esm/v1beta1/esm.proto"; +import "comdex/esm/v1beta1/params.proto"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/esm/types"; @@ -12,6 +16,7 @@ service Msg { rpc ExecuteESM(MsgExecuteESM) returns (MsgExecuteESMResponse); rpc MsgKillSwitch(MsgKillRequest) returns (MsgKillResponse); rpc MsgCollateralRedemption(MsgCollateralRedemptionRequest) returns (MsgCollateralRedemptionResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message MsgDepositESM { @@ -40,4 +45,26 @@ message MsgCollateralRedemptionRequest { message MsgDepositESMResponse {} message MsgExecuteESMResponse {} message MsgKillResponse {} -message MsgCollateralRedemptionResponse{} \ No newline at end of file +message MsgCollateralRedemptionResponse{} + + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/esm 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: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 09b34c65a..140f460a9 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -3,6 +3,10 @@ package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "comdex/liquidationsV2/v1beta1/params.proto"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; option (gogoproto.equal_all) = false; @@ -12,6 +16,7 @@ service Msg { rpc MsgLiquidateInternalKeeper(MsgLiquidateInternalKeeperRequest) returns (MsgLiquidateInternalKeeperResponse); rpc MsgAppReserveFunds(MsgAppReserveFundsRequest) returns (MsgAppReserveFundsResponse); rpc MsgLiquidateExternalKeeper(MsgLiquidateExternalKeeperRequest) returns (MsgLiquidateExternalKeeperResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message MsgLiquidateInternalKeeperRequest { @@ -76,3 +81,24 @@ message MsgLiquidateExternalKeeperRequest { } message MsgLiquidateExternalKeeperResponse{} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/liquidationsV2 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: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/x/asset/keeper/keeper.go b/x/asset/keeper/keeper.go index 771035188..5f586b48b 100644 --- a/x/asset/keeper/keeper.go +++ b/x/asset/keeper/keeper.go @@ -21,6 +21,7 @@ type Keeper struct { rewards expected.RewardsKeeper vault expected.VaultKeeper bandoracle expected.Bandoraclekeeper + authority string } func NewKeeper( @@ -32,6 +33,7 @@ func NewKeeper( rewards expected.RewardsKeeper, vault expected.VaultKeeper, bandoracle expected.Bandoraclekeeper, + authority string, ) Keeper { if !params.HasKeyTable() { params = params.WithKeyTable(assettypes.ParamKeyTable()) @@ -46,6 +48,7 @@ func NewKeeper( rewards: rewards, vault: vault, bandoracle: bandoracle, + authority: authority, } } diff --git a/x/asset/keeper/msg_server.go b/x/asset/keeper/msg_server.go index baab081b2..800cb55ea 100644 --- a/x/asset/keeper/msg_server.go +++ b/x/asset/keeper/msg_server.go @@ -2,9 +2,11 @@ package keeper import ( "context" + "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/asset/types" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) type msgServer struct { @@ -29,3 +31,14 @@ func (m msgServer) AddAsset(goCtx context.Context, msg *types.MsgAddAsset) (*typ return &types.MsgAddAssetResponse{}, nil } + +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/asset/types/codec.go b/x/asset/types/codec.go index 229a17992..3c5a79c50 100644 --- a/x/asset/types/codec.go +++ b/x/asset/types/codec.go @@ -2,10 +2,12 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -21,6 +23,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&AddAssetInAppProposal{}, "comdex/asset/AddAssetInAppProposal", nil) cdc.RegisterConcrete(&UpdateGovTimeInAppProposal{}, "comdex/asset/UpdateGovTimeInAppProposal", nil) cdc.RegisterConcrete(&AddMultipleAssetsPairsProposal{}, "comdex/asset/AddMultipleAssetsPairsProposal", nil) + cdc.RegisterConcrete(&Params{}, "comdex/asset/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/asset/MsgUpdateParams") } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -36,6 +40,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &AddAssetInAppProposal{}, &UpdateGovTimeInAppProposal{}, &AddMultipleAssetsPairsProposal{}, + &MsgUpdateParams{}, ) registry.RegisterImplementations( @@ -54,6 +59,7 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) + RegisterLegacyAminoCodec(authzcodec.Amino) // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/asset/types/message_update_params.go b/x/asset/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/asset/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/asset/types/tx.pb.go b/x/asset/types/tx.pb.go index ed0fc05a6..f5d69585f 100644 --- a/x/asset/types/tx.pb.go +++ b/x/asset/types/tx.pb.go @@ -6,6 +6,8 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -103,32 +105,128 @@ func (m *MsgAddAssetResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddAssetResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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/asset 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_78d9fd76d8e93e29, []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 + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 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_78d9fd76d8e93e29, []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((*MsgAddAsset)(nil), "comdex.asset.v1beta1.MsgAddAsset") proto.RegisterType((*MsgAddAssetResponse)(nil), "comdex.asset.v1beta1.MsgAddAssetResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.asset.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.asset.v1beta1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("comdex/asset/v1beta1/tx.proto", fileDescriptor_78d9fd76d8e93e29) } var fileDescriptor_78d9fd76d8e93e29 = []byte{ - // 257 bytes of a gzipped FileDescriptorProto + // 409 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08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 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3f, - 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x09, 0x64, 0x9c, 0x3e, 0xc4, 0x48, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, - 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0x16, 0x6c, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, - 0xe0, 0xf0, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xda, 0x99, 0x98, 0xf3, 0x9e, 0x01, 0x00, - 0x00, + 0x94, 0x02, 0x56, 0xa3, 0x20, 0x3a, 0x21, 0x2a, 0x14, 0xb1, 0xaa, 0x28, 0x48, 0x2c, 0x4a, 0xcc, + 0x2d, 0x86, 0x2a, 0x11, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0xd7, 0x2f, + 0x33, 0x04, 0x51, 0x50, 0x09, 0x49, 0x88, 0x44, 0x3c, 0xc4, 0x5a, 0x08, 0x07, 0x22, 0xa5, 0x94, + 0xc0, 0xc5, 0xed, 0x5b, 0x9c, 0xee, 0x98, 0x92, 0xe2, 0x08, 0x32, 0x57, 0x48, 0x82, 0x8b, 0x3d, + 0xb9, 0x28, 0x35, 0xb1, 0x24, 0xbf, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc6, 0x15, + 0x32, 0xe7, 0x62, 0x05, 0x5b, 0x2d, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xad, 0x87, 0xcd, + 0x77, 0x7a, 0x60, 0x53, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0xa8, 0x57, 0x12, 0xe5, + 0x12, 0x46, 0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0x8c, 0xd2, 0x24, 0x90, 0x91, 0xfa, + 0x10, 0x63, 0x75, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x58, 0x2a, + 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xa7, 0x24, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xde, 0x4a, 0x82, 0x17, 0x0f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -145,6 +243,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // AddAsset defines a method for adding new asset in asset module AddAsset(ctx context.Context, in *MsgAddAsset, opts ...grpc.CallOption) (*MsgAddAssetResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -164,10 +263,20 @@ func (c *msgClient) AddAsset(ctx context.Context, in *MsgAddAsset, opts ...grpc. 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, "/comdex.asset.v1beta1.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 { // AddAsset defines a method for adding new asset in asset module AddAsset(context.Context, *MsgAddAsset) (*MsgAddAssetResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -177,6 +286,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AddAsset(ctx context.Context, req *MsgAddAsset) (*MsgAddAssetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddAsset 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) @@ -200,6 +312,24 @@ func _Msg_AddAsset_Handler(srv interface{}, ctx context.Context, dec func(interf 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: "/comdex.asset.v1beta1.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: "comdex.asset.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -208,6 +338,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddAsset", Handler: _Msg_AddAsset_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/asset/v1beta1/tx.proto", @@ -276,6 +410,69 @@ func (m *MsgAddAssetResponse) 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 @@ -311,6 +508,30 @@ func (m *MsgAddAssetResponse) 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 } @@ -482,6 +703,171 @@ func (m *MsgAddAssetResponse) 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 diff --git a/x/common/types/codec.go b/x/common/types/codec.go index e8979fa0a..30033969e 100644 --- a/x/common/types/codec.go +++ b/x/common/types/codec.go @@ -9,7 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" - govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { @@ -43,6 +42,5 @@ func init() { RegisterLegacyAminoCodec(Amino) cryptocodec.RegisterCrypto(Amino) RegisterLegacyAminoCodec(authzcodec.Amino) - RegisterLegacyAminoCodec(govcodec.Amino) Amino.Seal() } diff --git a/x/common/types/tx.pb.go b/x/common/types/tx.pb.go index 7882f0cf5..59fdb20ba 100644 --- a/x/common/types/tx.pb.go +++ b/x/common/types/tx.pb.go @@ -220,7 +220,7 @@ var xxx_messageInfo_MsgDeRegisterContractResponse proto.InternalMessageInfo 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/auth parameters to update. + // params defines the x/common parameters to update. // // NOTE: All parameters must be supplied. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` diff --git a/x/esm/keeper/keeper.go b/x/esm/keeper/keeper.go index 3191b00a2..c639f2959 100644 --- a/x/esm/keeper/keeper.go +++ b/x/esm/keeper/keeper.go @@ -30,6 +30,7 @@ type ( market expected.MarketKeeper tokenmint expected.Tokenmint collector expected.Collector + authority string } ) @@ -44,6 +45,7 @@ func NewKeeper( market expected.MarketKeeper, tokenmint expected.Tokenmint, collector expected.Collector, + authority string, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -61,6 +63,7 @@ func NewKeeper( market: market, tokenmint: tokenmint, collector: collector, + authority: authority, } } diff --git a/x/esm/keeper/msg_server.go b/x/esm/keeper/msg_server.go index e4a4f962e..5f60337b1 100644 --- a/x/esm/keeper/msg_server.go +++ b/x/esm/keeper/msg_server.go @@ -2,10 +2,12 @@ package keeper import ( "context" + "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/esm/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) // NewMsgServerImpl returns an implementation of the MsgServer interface @@ -81,3 +83,14 @@ func (m msgServer) MsgCollateralRedemption(c context.Context, req *types.MsgColl return nil, nil } + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if m.keeper.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.keeper.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + m.keeper.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} \ No newline at end of file diff --git a/x/esm/types/codec.go b/x/esm/types/codec.go index 8940e911a..f83fdb9fa 100644 --- a/x/esm/types/codec.go +++ b/x/esm/types/codec.go @@ -2,9 +2,11 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -15,6 +17,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgExecuteESM{}, "comdex/esm/execute-esm", nil) cdc.RegisterConcrete(&MsgKillRequest{}, "comdex/esm/stop-all-actions", nil) cdc.RegisterConcrete(&MsgCollateralRedemptionRequest{}, "comdex/esm/redeem-collateral", nil) + cdc.RegisterConcrete(&Params{}, "comdex/esm/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/esm/MsgUpdateParams") } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -27,6 +31,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgExecuteESM{}, &MsgKillRequest{}, &MsgCollateralRedemptionRequest{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } @@ -39,6 +44,7 @@ var ( func init() { RegisterCodec(Amino) cryptocodec.RegisterCrypto(Amino) + RegisterCodec(authzcodec.Amino) // sdk.RegisterLegacyAminoCodec(Amino) Amino.Seal() } diff --git a/x/esm/types/message_update_params.go b/x/esm/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/esm/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/esm/types/tx.pb.go b/x/esm/types/tx.pb.go index 78b26763e..b7c4aecf4 100644 --- a/x/esm/types/tx.pb.go +++ b/x/esm/types/tx.pb.go @@ -6,7 +6,9 @@ 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/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -397,6 +399,105 @@ func (m *MsgCollateralRedemptionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCollateralRedemptionResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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/esm 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_11f122646bf242d3, []int{8} +} +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: 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_11f122646bf242d3, []int{9} +} +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((*MsgDepositESM)(nil), "comdex.esm.v1beta1.MsgDepositESM") proto.RegisterType((*MsgExecuteESM)(nil), "comdex.esm.v1beta1.MsgExecuteESM") @@ -406,45 +507,55 @@ func init() { proto.RegisterType((*MsgExecuteESMResponse)(nil), "comdex.esm.v1beta1.MsgExecuteESMResponse") proto.RegisterType((*MsgKillResponse)(nil), "comdex.esm.v1beta1.MsgKillResponse") proto.RegisterType((*MsgCollateralRedemptionResponse)(nil), "comdex.esm.v1beta1.MsgCollateralRedemptionResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.esm.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.esm.v1beta1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("comdex/esm/v1beta1/tx.proto", fileDescriptor_11f122646bf242d3) } var fileDescriptor_11f122646bf242d3 = []byte{ - // 525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xb1, 0x6e, 0xd3, 0x40, - 0x1c, 0xc6, 0x73, 0x4d, 0x88, 0x94, 0x8b, 0xa0, 0x70, 0xa2, 0x4a, 0x70, 0x2b, 0x27, 0x75, 0x19, - 0xc2, 0x50, 0x5b, 0x4d, 0x07, 0x24, 0xc6, 0xb4, 0x15, 0x42, 0x95, 0x25, 0xe4, 0x2e, 0xa8, 0x0b, - 0xba, 0xd8, 0x17, 0xf7, 0x84, 0xcf, 0x67, 0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0xf4, 0x21, 0x2d, 0x6b, 0xde, 0x02, 0x64, 0x14, 0x3c, 0xbb, - 0x50, 0x44, 0x6d, 0x6f, 0xa5, 0x27, 0x23, 0x7f, 0x07, 0xb0, 0x51, 0x90, 0x1e, 0xea, 0x16, 0x00, - 0x56, 0xd4, 0x48, 0x3b, 0x5c, 0xeb, 0x19, 0xb5, 0x44, 0xef, 0xed, 0xd5, 0x44, 0x07, 0xd7, 0x13, - 0x1d, 0xfc, 0x9d, 0xe8, 0xe0, 0xc7, 0x54, 0x2f, 0x5d, 0x4f, 0xf5, 0xd2, 0x9f, 0xa9, 0x5e, 0x3a, - 0xdf, 0xf7, 0xa9, 0xbc, 0x18, 0xf6, 0x13, 0xa8, 0xa5, 0xc0, 0xfb, 0x7c, 0x30, 0xa0, 0x2e, 0xc5, - 0x41, 0xf6, 0xdf, 0x52, 0xdf, 0x17, 0x79, 0x19, 0x11, 0xd1, 0xaf, 0xa6, 0x9f, 0x96, 0xc3, 0x7f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0x1c, 0x46, 0x79, 0xe1, 0x04, 0x00, 0x00, + // 648 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x4e, 0x13, 0x41, + 0x18, 0xee, 0x52, 0x6c, 0xd2, 0x41, 0x41, 0x27, 0x90, 0x96, 0x85, 0x6c, 0x61, 0xf1, 0x80, 0x1a, + 0x76, 0x43, 0x49, 0xd4, 0x70, 0xb3, 0x40, 0x8c, 0x21, 0x4d, 0xcc, 0x12, 0x13, 0xc3, 0x05, 0xa7, + 0xbb, 0xc3, 0x32, 0x71, 0x77, 0x67, 0xdc, 0x99, 0x22, 0x1c, 0xbc, 0xf0, 0x04, 0x26, 0xc6, 0x37, + 0xf0, 0x01, 0x3c, 0xf8, 0x10, 0x1c, 0x89, 0x27, 0x4f, 0xc4, 0xc0, 0xc1, 0x3b, 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f, 0xb6, 0x7c, + 0xa9, 0xc5, 0x31, 0xc3, 0xbc, 0x55, 0x4a, 0x5f, 0xdb, 0xb5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xca, 0x72, 0xfc, 0x2e, 0x49, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,6 +574,7 @@ type MsgClient interface { ExecuteESM(ctx context.Context, in *MsgExecuteESM, opts ...grpc.CallOption) (*MsgExecuteESMResponse, error) MsgKillSwitch(ctx context.Context, in *MsgKillRequest, opts ...grpc.CallOption) (*MsgKillResponse, error) MsgCollateralRedemption(ctx context.Context, in *MsgCollateralRedemptionRequest, opts ...grpc.CallOption) (*MsgCollateralRedemptionResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -509,12 +621,22 @@ func (c *msgClient) MsgCollateralRedemption(ctx context.Context, in *MsgCollater 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, "/comdex.esm.v1beta1.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 { DepositESM(context.Context, *MsgDepositESM) (*MsgDepositESMResponse, error) ExecuteESM(context.Context, *MsgExecuteESM) (*MsgExecuteESMResponse, error) MsgKillSwitch(context.Context, *MsgKillRequest) (*MsgKillResponse, error) MsgCollateralRedemption(context.Context, *MsgCollateralRedemptionRequest) (*MsgCollateralRedemptionResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -533,6 +655,9 @@ func (*UnimplementedMsgServer) MsgKillSwitch(ctx context.Context, req *MsgKillRe func (*UnimplementedMsgServer) MsgCollateralRedemption(ctx context.Context, req *MsgCollateralRedemptionRequest) (*MsgCollateralRedemptionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgCollateralRedemption 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) @@ -610,6 +735,24 @@ func _Msg_MsgCollateralRedemption_Handler(srv interface{}, ctx context.Context, 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: "/comdex.esm.v1beta1.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: "comdex.esm.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -630,6 +773,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgCollateralRedemption", Handler: _Msg_MsgCollateralRedemption_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/esm/v1beta1/tx.proto", @@ -894,6 +1041,69 @@ func (m *MsgCollateralRedemptionResponse) MarshalToSizedBuffer(dAtA []byte) (int 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 @@ -1010,6 +1220,30 @@ func (m *MsgCollateralRedemptionResponse) 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 } @@ -1703,6 +1937,171 @@ func (m *MsgCollateralRedemptionResponse) 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 diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 59c4431e6..438d0ac06 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -29,6 +29,7 @@ type Keeper struct { lend expected.LendKeeper auctionsV2 expected.AuctionsV2Keeper collector expected.CollectorKeeper + authority string } func NewKeeper( @@ -46,6 +47,7 @@ func NewKeeper( lend expected.LendKeeper, auctionsV2Keeper expected.AuctionsV2Keeper, collector expected.CollectorKeeper, + authority string, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -67,6 +69,7 @@ func NewKeeper( lend: lend, auctionsV2: auctionsV2Keeper, collector: collector, + authority: authority, } } diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index 893a4fc44..a0c7f8008 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -2,8 +2,10 @@ package keeper import ( "context" + "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "strconv" ) @@ -50,3 +52,14 @@ func (m msgServer) MsgLiquidateExternalKeeper(c context.Context, req *types.MsgL } return &types.MsgLiquidateExternalKeeperResponse{}, nil } + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if m.keeper.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.keeper.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + m.keeper.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index b9480ac39..e184dd950 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -2,9 +2,11 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" // this line is used by starport scaffolding # 1 @@ -15,6 +17,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateInternalKeeperRequest", nil) cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidationsV2/MsgAppReserveFundsRequest", nil) cdc.RegisterConcrete(&MsgLiquidateExternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateExternalKeeperRequest", nil) + cdc.RegisterConcrete(&Params{}, "comdex/liquidationsV2/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/liquidationsV2/MsgUpdateParams") } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -27,6 +31,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgLiquidateInternalKeeperRequest{}, &MsgAppReserveFundsRequest{}, &MsgLiquidateExternalKeeperRequest{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } @@ -39,6 +44,7 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) + RegisterLegacyAminoCodec(authzcodec.Amino) // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/liquidationsV2/types/message_update_params.go b/x/liquidationsV2/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/liquidationsV2/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 61eb1d844..e9fd4e764 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -6,8 +6,10 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "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" @@ -261,6 +263,91 @@ func (m *MsgLiquidateExternalKeeperResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgLiquidateExternalKeeperResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 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/liquidationsV2 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_51c735c845851e88, []int{6} +} +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 + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 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_51c735c845851e88, []int{7} +} +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((*MsgLiquidateInternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperRequest") proto.RegisterType((*MsgLiquidateInternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperResponse") @@ -268,6 +355,8 @@ func init() { proto.RegisterType((*MsgAppReserveFundsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsResponse") proto.RegisterType((*MsgLiquidateExternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperRequest") proto.RegisterType((*MsgLiquidateExternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.liquidationsV2.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgUpdateParamsResponse") } func init() { @@ -275,54 +364,62 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x53, 0xd3, 0x4e, - 0x18, 0x6e, 0x4a, 0x4b, 0xe9, 0xf2, 0xe3, 0x87, 0x04, 0x66, 0x2c, 0x19, 0x4d, 0x30, 0x38, 0xca, - 0x85, 0x64, 0xc0, 0x0b, 0x38, 0x1e, 0x6c, 0x41, 0x66, 0x50, 0xd0, 0x31, 0xc3, 0x78, 0xe0, 0xd2, - 0x49, 0x9b, 0xa5, 0xee, 0x90, 0x66, 0xd3, 0xec, 0x16, 0xe9, 0xc5, 0xab, 0xe3, 0x8d, 0xaf, 0xe0, - 0x8d, 0x8f, 0xc2, 0x91, 0xa3, 0x5e, 0x32, 0x1a, 0xbe, 0x41, 0x0e, 0x1e, 0x3c, 0x39, 0xbb, 0x9b, - 0xfe, 0xa5, 0x16, 0x8b, 0xa7, 0x36, 0xbb, 0xef, 0xf3, 0xee, 0xf3, 0x3c, 0xef, 0xfb, 0xee, 0x82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93, 0x37, 0x6e, 0xce, 0x3c, 0xfc, 0x96, 0x52, 0x36, 0x6f, 0x81, 0x4c, 0xb8, 0x0c, 0xfa, - 0xd5, 0x6f, 0xef, 0x58, 0x7e, 0x0d, 0xbd, 0x22, 0xc6, 0xf2, 0x6b, 0x78, 0x6d, 0x4b, 0x87, 0x17, - 0x3f, 0xd4, 0xd4, 0x79, 0xa4, 0xa6, 0x2e, 0x22, 0x55, 0xba, 0x8c, 0x54, 0xe9, 0x7b, 0xa4, 0x4a, - 0x67, 0x57, 0x6a, 0xea, 0xf2, 0x4a, 0x4d, 0x7d, 0xbd, 0x52, 0x53, 0x87, 0x1b, 0x7d, 0xf3, 0xc1, - 0x8e, 0x5b, 0xc5, 0x47, 0x47, 0xa8, 0x8a, 0x6c, 0x37, 0xf9, 0x36, 0xaf, 0xbd, 0x97, 0x7c, 0x6a, - 0x2a, 0x93, 0xfc, 0x59, 0x7b, 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xde, 0x8d, 0x78, 0x55, - 0x07, 0x00, 0x00, + // 879 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0x16, 0x15, 0xc9, 0xb6, 0xce, 0x71, 0xdc, 0x5c, 0x0c, 0x58, 0x22, 0x5a, 0xd2, 0x65, 0xfa, + 0xc3, 0x08, 0x60, 0x12, 0x76, 0x81, 0xc0, 0x09, 0x3a, 0x54, 0x72, 0x1a, 0x20, 0x6d, 0xdc, 0x1f, + 0x6c, 0xda, 0x21, 0x8b, 0x70, 0x12, 0xcf, 0xcc, 0x21, 0x24, 0x8f, 0xe2, 0x9d, 0x5c, 0x7b, 0xe9, + 0xd0, 0xa5, 0xe8, 0x96, 0xbf, 0xa0, 0x40, 0xb7, 0x8c, 0x1d, 0xfa, 0x47, 0x78, 0x4c, 0x3b, 0x75, + 0x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9e, 0xfc, 0x61, 0x95, 0x5e, 0x0e, 0xac, 0xd2, + 0xc9, 0xc0, 0x32, 0x5e, 0x0d, 0x2c, 0xe3, 0xf7, 0x81, 0x65, 0xbc, 0x38, 0xb5, 0x4a, 0xaf, 0x4e, + 0xad, 0xd2, 0x6f, 0xa7, 0x56, 0xe9, 0xe9, 0xee, 0xc4, 0x4e, 0x11, 0x35, 0xb6, 0xe8, 0xc1, 0x01, + 0xe9, 0x12, 0x14, 0xe9, 0x6f, 0xef, 0xdc, 0xcf, 0x08, 0xb9, 0x69, 0x3a, 0x0b, 0xf2, 0xa7, 0xc0, + 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, 0x79, 0xb6, 0xe4, 0xe9, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -340,6 +437,7 @@ type MsgClient interface { MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFundsRequest, opts ...grpc.CallOption) (*MsgAppReserveFundsResponse, error) MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiquidateExternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateExternalKeeperResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -377,11 +475,21 @@ func (c *msgClient) MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiqui 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, "/comdex.liquidationsV2.v1beta1.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 { MsgLiquidateInternalKeeper(context.Context, *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(context.Context, *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) MsgLiquidateExternalKeeper(context.Context, *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -397,6 +505,9 @@ func (*UnimplementedMsgServer) MsgAppReserveFunds(ctx context.Context, req *MsgA func (*UnimplementedMsgServer) MsgLiquidateExternalKeeper(ctx context.Context, req *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgLiquidateExternalKeeper 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) @@ -456,6 +567,24 @@ func _Msg_MsgLiquidateExternalKeeper_Handler(srv interface{}, ctx context.Contex 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: "/comdex.liquidationsV2.v1beta1.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: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -472,6 +601,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgLiquidateExternalKeeper", Handler: _Msg_MsgLiquidateExternalKeeper_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", @@ -718,6 +851,69 @@ func (m *MsgLiquidateExternalKeeperResponse) MarshalToSizedBuffer(dAtA []byte) ( 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 @@ -829,6 +1025,30 @@ func (m *MsgLiquidateExternalKeeperResponse) 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 } @@ -1515,6 +1735,171 @@ func (m *MsgLiquidateExternalKeeperResponse) 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