diff --git a/app/app.go b/app/app.go index a668fd4..5554856 100644 --- a/app/app.go +++ b/app/app.go @@ -619,6 +619,7 @@ func NewRollapp( keys[callbackTypes.StoreKey], &app.WasmKeeper, app.BankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.CWErrorsKeeper = cwerrorsKeeper.NewKeeper( @@ -627,6 +628,7 @@ func NewRollapp( tkeys[cwerrorsTypes.TStoreKey], &app.WasmKeeper, app.BankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.TimeUpgradeKeeper = timeupgradekeeper.NewKeeper( diff --git a/proto/rollapp/callback/v1/tx.proto b/proto/rollapp/callback/v1/tx.proto index c80b82b..a02b4a4 100644 --- a/proto/rollapp/callback/v1/tx.proto +++ b/proto/rollapp/callback/v1/tx.proto @@ -6,6 +6,7 @@ option go_package = "github.com/dymensionxyz/rollapp-wasm/x/callback/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; import "rollapp/callback/v1/callback.proto"; // Msg defines the module messaging service. @@ -15,6 +16,9 @@ service Msg { // CancelCallback defines a message for cancelling an existing callback rpc CancelCallback(MsgCancelCallback) returns (MsgCancelCallbackResponse); + + // UpdateParams is used for updating module params. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgRequestCallback is the Msg/RequestCallback request type. @@ -54,4 +58,17 @@ message MsgCancelCallback{ message MsgCancelCallbackResponse { // refund is the amount of fees being refunded due to the cancellation of the callback cosmos.base.v1beta1.Coin refund = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +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"]; + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/rollapp/cwerrors/v1/tx.proto b/proto/rollapp/cwerrors/v1/tx.proto index 1df3036..a6f52ed 100644 --- a/proto/rollapp/cwerrors/v1/tx.proto +++ b/proto/rollapp/cwerrors/v1/tx.proto @@ -4,6 +4,8 @@ package rollapp.cwerrors.v1; import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "rollapp/cwerrors/v1/params.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/dymensionxyz/rollapp-wasm/x/cwerrors/types"; @@ -13,6 +15,10 @@ service Msg { // sudo callback on errors rpc SubscribeToError(MsgSubscribeToError) returns (MsgSubscribeToErrorResponse); + + // UpdateParams is used for updating module params. + rpc UpdateParams(MsgUpdateParams) + returns (MsgUpdateParamsResponse); } // MsgSubscribeToError is the Msg/SubscribeToError request type. @@ -35,3 +41,16 @@ message MsgSubscribeToErrorResponse { // valid int64 subscription_valid_till = 1; } + +// MsgUpdateParams is the Msg/UpdateParams request type. +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"]; + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/x/callback/keeper/keeper.go b/x/callback/keeper/keeper.go index 40b38fa..a266723 100644 --- a/x/callback/keeper/keeper.go +++ b/x/callback/keeper/keeper.go @@ -2,11 +2,11 @@ package keeper import ( "cosmossdk.io/collections" - "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/tendermint/tendermint/libs/log" "github.com/dymensionxyz/rollapp-wasm/internal/collcompat" "github.com/dymensionxyz/rollapp-wasm/x/callback/types" @@ -14,10 +14,11 @@ import ( // Keeper provides module state operations. type Keeper struct { - cdc codec.Codec - storeKey storetypes.StoreKey - wasmKeeper types.WasmKeeperExpected - bankKeeper types.BankKeeperExpected + authority string // authority is the x/gov module account + cdc codec.Codec + storeKey storetypes.StoreKey + wasmKeeper types.WasmKeeperExpected + bankKeeper types.BankKeeperExpected Schema collections.Schema @@ -28,13 +29,14 @@ type Keeper struct { } // NewKeeper creates a new Keeper instance. -func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, wk types.WasmKeeperExpected, bk types.BankKeeperExpected) Keeper { +func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, wk types.WasmKeeperExpected, bk types.BankKeeperExpected, authority string) Keeper { sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) k := Keeper{ - cdc: cdc, - storeKey: storeKey, - wasmKeeper: wk, - bankKeeper: bk, + cdc: cdc, + storeKey: storeKey, + wasmKeeper: wk, + bankKeeper: bk, + authority: authority, Params: collections.NewItem( sb, types.ParamsKeyPrefix, diff --git a/x/callback/keeper/msg_server.go b/x/callback/keeper/msg_server.go index f4de59d..6319b47 100644 --- a/x/callback/keeper/msg_server.go +++ b/x/callback/keeper/msg_server.go @@ -6,6 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -128,3 +129,22 @@ func (s MsgServer) RequestCallback(c context.Context, request *types.MsgRequestC return &types.MsgRequestCallbackResponse{}, nil } + +func (s MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if s.keeper.authority != msg.Authority { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", s.keeper.authority, msg.Authority) + } + + err := msg.ValidateBasic() + if err != nil { + return nil, err + } + + err = s.keeper.SetParams(ctx, msg.Params) + if err != nil { + return nil, err + } + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/callback/types/codec.go b/x/callback/types/codec.go index d6eb553..cd3c20e 100644 --- a/x/callback/types/codec.go +++ b/x/callback/types/codec.go @@ -13,6 +13,7 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRequestCallback{}, "callback/MsgRequestCallback", nil) cdc.RegisterConcrete(&MsgCancelCallback{}, "callback/MsgCancelCallback", nil) + cdc.RegisterConcrete(&MsgUpdateParams{}, "callback/MsgUpdateParams", nil) } // RegisterInterfaces registers interfaces types with the interface registry. @@ -20,6 +21,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRequestCallback{}, &MsgCancelCallback{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/callback/types/keys.go b/x/callback/types/keys.go index a082752..104f409 100644 --- a/x/callback/types/keys.go +++ b/x/callback/types/keys.go @@ -11,6 +11,8 @@ const ( StoreKey = ModuleName // QuerierRoute is the querier route for the module. QuerierRoute = ModuleName + + RouterKey = ModuleName ) var ( diff --git a/x/callback/types/msg.go b/x/callback/types/msg.go index de43656..ec69f9e 100644 --- a/x/callback/types/msg.go +++ b/x/callback/types/msg.go @@ -2,13 +2,19 @@ package types import ( errorsmod "cosmossdk.io/errors" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" ) +const ( + TypeMsgUpdateParams = "update_params" +) + var ( _ sdk.Msg = &MsgRequestCallback{} _ sdk.Msg = &MsgCancelCallback{} + _ sdk.Msg = &MsgUpdateParams{} ) // NewMsgRequestCallback creates a new MsgRequestCallback instance. @@ -80,3 +86,35 @@ func (m MsgCancelCallback) ValidateBasic() error { return nil } + +// GetSigners implements types.Msg. +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic implements types.Msg. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return fmt.Errorf("invalid authority address: %w", err) + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} + +func (m *MsgUpdateParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(m) + return sdk.MustSortJSON(bz) +} + +func (m *MsgUpdateParams) Route() string { + return RouterKey +} + +func (m *MsgUpdateParams) Type() string { + return TypeMsgUpdateParams +} diff --git a/x/callback/types/tx.pb.go b/x/callback/types/tx.pb.go index a2cd4fd..5b0718e 100644 --- a/x/callback/types/tx.pb.go +++ b/x/callback/types/tx.pb.go @@ -6,6 +6,7 @@ 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" @@ -268,46 +269,147 @@ func (m *MsgCancelCallbackResponse) GetRefund() types.Coin { return types.Coin{} } +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_2a0ba37147abd0c2, []int{4} +} +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. +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_2a0ba37147abd0c2, []int{5} +} +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((*MsgRequestCallback)(nil), "rollapp.callback.v1.MsgRequestCallback") proto.RegisterType((*MsgRequestCallbackResponse)(nil), "rollapp.callback.v1.MsgRequestCallbackResponse") proto.RegisterType((*MsgCancelCallback)(nil), "rollapp.callback.v1.MsgCancelCallback") proto.RegisterType((*MsgCancelCallbackResponse)(nil), "rollapp.callback.v1.MsgCancelCallbackResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "rollapp.callback.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "rollapp.callback.v1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("rollapp/callback/v1/tx.proto", fileDescriptor_2a0ba37147abd0c2) } var fileDescriptor_2a0ba37147abd0c2 = []byte{ - // 459 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x6b, 0xda, 0x55, 0xc2, 0x93, 0x56, 0x30, 0xff, 0xb2, 0x68, 0x0a, 0x55, 0x0f, 0xac, - 0x20, 0x61, 0xab, 0x9b, 0x10, 0x12, 0x37, 0xd6, 0x0b, 0x1c, 0x2a, 0xa4, 0x88, 0x13, 0x97, 0xca, - 0x71, 0x3c, 0x37, 0x5b, 0x62, 0x87, 0xbc, 0x6e, 0x69, 0x39, 0xf2, 0x09, 0xf8, 0x0e, 0x7c, 0x01, - 0x3e, 0xc6, 0x8e, 0x3b, 0x82, 0x84, 0x10, 0x6a, 0x0f, 0x7c, 0x0d, 0xd4, 0xd4, 0x19, 0xda, 0x3a, - 0xa4, 0x1e, 0xb9, 0x25, 0xef, 0xf3, 0x53, 0xde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 0x52, 0x75, 0xff, 0x2f, 0xd4, 0x03, 0x00, 0x00, + // 568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xcd, 0xb4, 0x69, 0xa4, 0x4e, 0x3f, 0x25, 0x1f, 0x43, 0xa1, 0x8e, 0xa9, 0x4c, 0x64, 0x21, + 0x1a, 0x10, 0xf5, 0x28, 0xa9, 0x00, 0xd1, 0x1d, 0xc9, 0x06, 0x16, 0x11, 0xc8, 0xc0, 0x86, 0x4d, + 0x34, 0xb6, 0xa7, 0x13, 0xb7, 0xb1, 0xc7, 0x78, 0x26, 0x21, 0x61, 0xc9, 0x13, 0xb0, 0xe0, 0x0d, + 0x78, 0x01, 0x16, 0x3c, 0x00, 0xcb, 0x2e, 0x2b, 0x56, 0xb0, 0x41, 0x28, 0x59, 0xf0, 0x1a, 0x28, + 0xf6, 0x38, 0x21, 0x3f, 0x95, 0xb2, 0x64, 0x67, 0xdf, 0x73, 0xe6, 0xdc, 0x73, 0xee, 0x5c, 0x0d, + 0xdc, 0x8f, 0x79, 0xb7, 0x4b, 0xa2, 0x08, 0xbb, 0xa4, 0xdb, 0x75, 0x88, 0x7b, 0x86, 0xfb, 0x35, + 0x2c, 0x07, 0x56, 0x14, 0x73, 0xc9, 0xd1, 0x55, 0x85, 0x5a, 0x19, 0x6a, 0xf5, 0x6b, 0xfa, 0x2e, + 0xe3, 0x8c, 0x27, 0x38, 0x9e, 0x7c, 0xa5, 0x54, 0xdd, 0x70, 0xb9, 0x08, 0xb8, 0xc0, 0x0e, 0x11, + 0x14, 0xf7, 0x6b, 0x0e, 0x95, 0xa4, 0x86, 0x5d, 0xee, 0x87, 0x0a, 0xdf, 0x53, 0x78, 0x20, 0xd8, + 0xa4, 0x45, 0x20, 0x98, 0x02, 0xca, 0x29, 0xd0, 0x4e, 0x15, 0xd3, 0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, 0x2b, 0xf9, 0xc3, 0xb7, 0x44, 0x04, 0x78, 0x30, 0x7b, + 0x47, 0xe4, 0x30, 0xa2, 0xc2, 0x29, 0x24, 0x4f, 0xc8, 0xd1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x1d, 0x36, 0x9c, 0xb3, 0x05, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -326,6 +428,8 @@ type MsgClient interface { RequestCallback(ctx context.Context, in *MsgRequestCallback, opts ...grpc.CallOption) (*MsgRequestCallbackResponse, error) // CancelCallback defines a message for cancelling an existing callback CancelCallback(ctx context.Context, in *MsgCancelCallback, opts ...grpc.CallOption) (*MsgCancelCallbackResponse, error) + // UpdateParams is used for updating module params. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -354,12 +458,23 @@ func (c *msgClient) CancelCallback(ctx context.Context, in *MsgCancelCallback, o 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, "/rollapp.callback.v1.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 { // RequestCallback defines a message for registering a callback at a specific height by a given contract RequestCallback(context.Context, *MsgRequestCallback) (*MsgRequestCallbackResponse, error) // CancelCallback defines a message for cancelling an existing callback CancelCallback(context.Context, *MsgCancelCallback) (*MsgCancelCallbackResponse, error) + // UpdateParams is used for updating module params. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -372,6 +487,9 @@ func (*UnimplementedMsgServer) RequestCallback(ctx context.Context, req *MsgRequ func (*UnimplementedMsgServer) CancelCallback(ctx context.Context, req *MsgCancelCallback) (*MsgCancelCallbackResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelCallback 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) @@ -413,6 +531,24 @@ func _Msg_CancelCallback_Handler(srv interface{}, ctx context.Context, dec func( 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: "/rollapp.callback.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "rollapp.callback.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -425,6 +561,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CancelCallback", Handler: _Msg_CancelCallback_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "rollapp/callback/v1/tx.proto", @@ -590,6 +730,69 @@ func (m *MsgCancelCallbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro 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 @@ -669,6 +872,30 @@ func (m *MsgCancelCallbackResponse) 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 } @@ -1145,6 +1372,171 @@ func (m *MsgCancelCallbackResponse) 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/cwerrors/keeper/keeper.go b/x/cwerrors/keeper/keeper.go index 9ffe50d..a5542f4 100644 --- a/x/cwerrors/keeper/keeper.go +++ b/x/cwerrors/keeper/keeper.go @@ -2,10 +2,10 @@ package keeper import ( "cosmossdk.io/collections" - "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/libs/log" "github.com/dymensionxyz/rollapp-wasm/internal/collcompat" "github.com/dymensionxyz/rollapp-wasm/x/cwerrors/types" @@ -13,11 +13,12 @@ import ( // Keeper provides module state operations. type Keeper struct { - cdc codec.Codec - storeKey storetypes.StoreKey - tStoreKey storetypes.StoreKey - wasmKeeper types.WasmKeeperExpected - bankKeeper types.BankKeeperExpected + authority string // authority is the x/gov module account + cdc codec.Codec + storeKey storetypes.StoreKey + tStoreKey storetypes.StoreKey + wasmKeeper types.WasmKeeperExpected + bankKeeper types.BankKeeperExpected Schema collections.Schema @@ -39,15 +40,16 @@ type Keeper struct { // NewKeeper creates a new Keeper instance. func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, tStoreKey storetypes.StoreKey, - wk types.WasmKeeperExpected, bk types.BankKeeperExpected, + wk types.WasmKeeperExpected, bk types.BankKeeperExpected, authority string, ) Keeper { sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) k := Keeper{ - cdc: cdc, - storeKey: storeKey, - tStoreKey: tStoreKey, - wasmKeeper: wk, - bankKeeper: bk, + cdc: cdc, + storeKey: storeKey, + tStoreKey: tStoreKey, + wasmKeeper: wk, + bankKeeper: bk, + authority: authority, Params: collections.NewItem( sb, types.ParamsKeyPrefix, @@ -108,7 +110,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } - // SetWasmKeeper sets the given wasm keeper. // Only for testing purposes func (k *Keeper) SetWasmKeeper(wk types.WasmKeeperExpected) { diff --git a/x/cwerrors/keeper/msg_server.go b/x/cwerrors/keeper/msg_server.go index 3950ff1..0fe11d2 100644 --- a/x/cwerrors/keeper/msg_server.go +++ b/x/cwerrors/keeper/msg_server.go @@ -2,9 +2,11 @@ package keeper import ( "context" - + sdk "github.com/cosmos/cosmos-sdk/types" + errorsmod "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -57,4 +59,23 @@ func (s *MsgServer) SubscribeToError(c context.Context, request *types.MsgSubscr return &types.MsgSubscribeToErrorResponse{ SubscriptionValidTill: subscriptionEndHeight, }, nil -} \ No newline at end of file +} + +func (s *MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if s.keeper.authority != msg.Authority { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", s.keeper.authority, msg.Authority) + } + + err := msg.ValidateBasic() + if err != nil { + return nil, err + } + + err = s.keeper.SetParams(ctx, msg.Params) + if err != nil { + return nil, err + } + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/cwerrors/types/codec.go b/x/cwerrors/types/codec.go index 21ac411..fc60687 100644 --- a/x/cwerrors/types/codec.go +++ b/x/cwerrors/types/codec.go @@ -12,12 +12,14 @@ import ( // These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgSubscribeToError{}, "cwerrors/MsgSubscribeToError", nil) + cdc.RegisterConcrete(&MsgUpdateParams{}, "cwerrors/MsgUpdateParams", nil) } // RegisterInterfaces registers interfaces types with the interface registry. func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubscribeToError{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/cwerrors/types/keys.go b/x/cwerrors/types/keys.go index 8e70411..8984a7b 100644 --- a/x/cwerrors/types/keys.go +++ b/x/cwerrors/types/keys.go @@ -14,6 +14,8 @@ const ( QuerierRoute = ModuleName // TStoreKey defines the transient store key TStoreKey = "t_" + ModuleName + + RouterKey = ModuleName ) // Collections diff --git a/x/cwerrors/types/msg.go b/x/cwerrors/types/msg.go index 52843fa..952ae89 100644 --- a/x/cwerrors/types/msg.go +++ b/x/cwerrors/types/msg.go @@ -1,13 +1,19 @@ package types import ( + "fmt" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" ) +const ( + TypeMsgUpdateParams = "update_params" +) + var ( _ sdk.Msg = &MsgSubscribeToError{} + _ sdk.Msg = &MsgUpdateParams{} ) // GetSigners implements the sdk.Msg interface. @@ -28,3 +34,35 @@ func (m MsgSubscribeToError) ValidateBasic() error { } return nil } + +// GetSigners implements types.Msg. +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic implements types.Msg. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return fmt.Errorf("invalid authority address: %w", err) + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} + +func (m *MsgUpdateParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(m) + return sdk.MustSortJSON(bz) +} + +func (m *MsgUpdateParams) Route() string { + return RouterKey +} + +func (m *MsgUpdateParams) Type() string { + return TypeMsgUpdateParams +} \ No newline at end of file diff --git a/x/cwerrors/types/tx.pb.go b/x/cwerrors/types/tx.pb.go index b0a7d4c..7c467d0 100644 --- a/x/cwerrors/types/tx.pb.go +++ b/x/cwerrors/types/tx.pb.go @@ -6,6 +6,7 @@ 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" @@ -144,39 +145,141 @@ func (m *MsgSubscribeToErrorResponse) GetSubscriptionValidTill() int64 { return 0 } +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_86f9be05f20db712, []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. +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_86f9be05f20db712, []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((*MsgSubscribeToError)(nil), "rollapp.cwerrors.v1.MsgSubscribeToError") proto.RegisterType((*MsgSubscribeToErrorResponse)(nil), "rollapp.cwerrors.v1.MsgSubscribeToErrorResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "rollapp.cwerrors.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "rollapp.cwerrors.v1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("rollapp/cwerrors/v1/tx.proto", fileDescriptor_86f9be05f20db712) } var fileDescriptor_86f9be05f20db712 = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xc7, 0x6d, 0x8c, 0x22, 0x71, 0x19, 0x88, 0x1c, 0x20, 0x21, 0x20, 0x13, 0x65, 0x0a, 0x48, - 0xdc, 0xe1, 0x20, 0x18, 0xd8, 0x08, 0x62, 0x8c, 0x90, 0x4c, 0x60, 0xe8, 0x12, 0xf9, 0xe5, 0xea, - 0x9e, 0x64, 0xdf, 0x63, 0xdd, 0x73, 0x71, 0x92, 0x8e, 0xfd, 0x04, 0x1d, 0xfb, 0x31, 0xfa, 0x31, - 0x32, 0x66, 0xec, 0x54, 0x55, 0xc9, 0xd0, 0xaf, 0x51, 0xf9, 0x25, 0x6a, 0xa5, 0x66, 0xe8, 0x66, -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15, 0xcb, 0xb4, 0x00, 0x39, 0xcb, 0xfd, 0x44, 0x44, 0x33, 0x2d, - 0x92, 0xa4, 0x54, 0xb6, 0xbc, 0xd7, 0x0f, 0xf1, 0xff, 0x82, 0x4e, 0x45, 0x92, 0x8c, 0xe6, 0xc4, - 0x9a, 0x60, 0x6c, 0x4b, 0xd2, 0x7a, 0xb4, 0xe9, 0x21, 0x3d, 0x70, 0xe2, 0xf4, 0x80, 0x44, 0xef, - 0xcb, 0x53, 0x93, 0x7b, 0xdd, 0xf1, 0x9f, 0xf5, 0xd6, 0x31, 0x37, 0x5b, 0xc7, 0xbc, 0xd9, 0x3a, - 0xe6, 0xf9, 0xce, 0x31, 0x36, 0x3b, 0xc7, 0xb8, 0xda, 0x39, 0xc6, 0xd1, 0xb7, 0x58, 0xe8, 0x93, - 0x79, 0x40, 0x43, 0x48, 0x59, 0xb4, 0x4a, 0xb9, 0x44, 0x01, 0x72, 0xb9, 0x3a, 0x65, 0x75, 0xc5, - 0xe7, 0x85, 0x8f, 0x29, 0x5b, 0xde, 0xbf, 0x11, 0xbd, 0xca, 0x38, 0x06, 0x8d, 0xf2, 0x02, 0xbf, - 0xde, 0x05, 0x00, 0x00, 0xff, 0xff, 0xed, 0x22, 0xdc, 0x7a, 0x44, 0x02, 0x00, 0x00, + // 497 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4f, 0x6f, 0xd3, 0x30, + 0x1c, 0x6d, 0x28, 0xaa, 0x34, 0x17, 0xb1, 0x29, 0x1b, 0xf4, 0xcf, 0x50, 0xa8, 0x2a, 0x0e, 0x05, + 0xb1, 0x98, 0x16, 0x31, 0x89, 0xdd, 0x28, 0xe2, 0x58, 0x81, 0xb2, 0x8d, 0x03, 0x97, 0xca, 0x49, + 0x8c, 0x67, 0x29, 0xb1, 0x23, 0xff, 0xdc, 0xae, 0xe5, 0xc8, 0x27, 0xe0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, 0x79, 0xb6, 0xf0, 0x9c, 0xf3, 0x85, 0xe7, 0xfc, + 0x5c, 0x78, 0xce, 0x87, 0xa5, 0x57, 0x39, 0x5f, 0x7a, 0x95, 0x6f, 0x4b, 0xaf, 0xf2, 0xe6, 0x09, + 0xe3, 0xfa, 0x64, 0x12, 0xfa, 0x91, 0x4c, 0x71, 0x3c, 0x4f, 0xa9, 0x00, 0x2e, 0xc5, 0x6c, 0xfe, + 0x0e, 0x5b, 0xf9, 0xbd, 0x53, 0x02, 0x29, 0x9e, 0xad, 0xb7, 0x5e, 0xcf, 0x33, 0x0a, 0x61, 0xad, + 0xd8, 0xeb, 0xc7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x74, 0xe7, 0x9d, 0xfc, 0x98, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -194,6 +297,8 @@ type MsgClient interface { // SubscribeToError defines an operation which will register a contract for a // sudo callback on errors SubscribeToError(ctx context.Context, in *MsgSubscribeToError, opts ...grpc.CallOption) (*MsgSubscribeToErrorResponse, error) + // UpdateParams is used for updating module params. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -213,11 +318,22 @@ func (c *msgClient) SubscribeToError(ctx context.Context, in *MsgSubscribeToErro 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, "/rollapp.cwerrors.v1.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 { // SubscribeToError defines an operation which will register a contract for a // sudo callback on errors SubscribeToError(context.Context, *MsgSubscribeToError) (*MsgSubscribeToErrorResponse, error) + // UpdateParams is used for updating module params. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -227,6 +343,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) SubscribeToError(ctx context.Context, req *MsgSubscribeToError) (*MsgSubscribeToErrorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubscribeToError 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) @@ -250,6 +369,24 @@ func _Msg_SubscribeToError_Handler(srv interface{}, ctx context.Context, dec fun 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: "/rollapp.cwerrors.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "rollapp.cwerrors.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -258,6 +395,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubscribeToError", Handler: _Msg_SubscribeToError_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "rollapp/cwerrors/v1/tx.proto", @@ -338,6 +479,69 @@ func (m *MsgSubscribeToErrorResponse) MarshalToSizedBuffer(dAtA []byte) (int, er 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 @@ -380,6 +584,30 @@ func (m *MsgSubscribeToErrorResponse) 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 } @@ -602,6 +830,171 @@ func (m *MsgSubscribeToErrorResponse) 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