From f2dc268fbbb30692738a1253c603027d5046db52 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 18:50:56 +0100 Subject: [PATCH 1/7] feat(uibc): ICS20 hooks gov switch --- proto/umee/uibc/v1/tx.proto | 23 ++ x/uibc/quota/msg_server.go | 24 ++ x/uibc/tx.pb.go | 498 +++++++++++++++++++++++++++++++++--- 3 files changed, 503 insertions(+), 42 deletions(-) diff --git a/proto/umee/uibc/v1/tx.proto b/proto/umee/uibc/v1/tx.proto index 11413f18ec..1c578afc23 100644 --- a/proto/umee/uibc/v1/tx.proto +++ b/proto/umee/uibc/v1/tx.proto @@ -20,6 +20,9 @@ service Msg { // GovSetIBCStatus sets IBC ICS20 status. Must be called by x/gov. rpc GovSetIBCStatus(MsgGovSetIBCStatus) returns (MsgGovSetIBCStatusResponse); + + // GovToggleICS20Hooks enables / disables ICS20 hooks support. Must be called by x/gov. + rpc GovToggleICS20Hooks(MsgGovToggleICS20Hooks) returns (MsgGovToggleICS20HooksResponse); } // MsgGovUpdateQuota defines the Msg/GovUpdateQuota request type. @@ -102,3 +105,23 @@ message MsgGovSetIBCStatus { // MsgGovSetIBCStatusResponse define the response type for Msg/MsgGovSetIBCStatus with x/gov proposals. message MsgGovSetIBCStatusResponse {} + +// MsgGovToggleICS20Hooks is a request type for GovToggleICS20Hooks handler. +message MsgGovToggleICS20Hooks { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account or the Emergency Group. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // description motivating the change. Should be used only when executing by the + // Emergency Group. Otherwise the x/gov Proposal metadata should be used. + string description = 2; + + // status defines if the IBC transfer hooks should be enabled or disabled. + bool status = 3; +} + + +message MsgGovToggleICS20HooksResponse{} diff --git a/x/uibc/quota/msg_server.go b/x/uibc/quota/msg_server.go index 4fddd35a18..f1f2349926 100644 --- a/x/uibc/quota/msg_server.go +++ b/x/uibc/quota/msg_server.go @@ -64,3 +64,27 @@ func (m msgServer) GovSetIBCStatus( return &uibc.MsgGovSetIBCStatusResponse{}, nil } + +// GovToggleICS20Hooks implements types.MsgServer +func (m msgServer) GovToggleICS20Hooks(ctx context.Context, msg *uibc.MsgGovToggleICS20Hooks, +) (*uibc.MsgGovToggleICS20HooksResponse, error) { + sdkCtx, err := sdkutil.StartMsg(ctx, msg) + if err != nil { + return nil, err + } + + k := m.kb.Keeper(&sdkCtx) + // emergency group can change status to any valid value + if _, err = checkers.EmergencyGroupAuthority(msg.Authority, k.ugov); err != nil { + return nil, err + } + + // if err := k.SetIBCStatus(msg.IbcStatus); err != nil { + // return &uibc.MsgGovSetIBCStatusResponse{}, err + // } + // sdkutil.Emit(&sdkCtx, &uibc.EventIBCTransferStatus{ + // Status: msg.IbcStatus, + // }) + + return &uibc.MsgGovToggleICS20HooksResponse{}, nil +} diff --git a/x/uibc/tx.pb.go b/x/uibc/tx.pb.go index 1a56b8ead4..4e969ba903 100644 --- a/x/uibc/tx.pb.go +++ b/x/uibc/tx.pb.go @@ -220,58 +220,151 @@ var xxx_messageInfo_MsgGovSetIBCStatusResponse proto.InternalMessageInfo func (*MsgGovSetIBCStatusResponse) XXX_MessageName() string { return "umee.uibc.v1.MsgGovSetIBCStatusResponse" } + +// MsgGovToggleICS20Hooks is a request type for GovToggleICS20Hooks handler. +type MsgGovToggleICS20Hooks struct { + // authority is the address of the governance account or the Emergency Group. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // description motivating the change. Should be used only when executing by the + // Emergency Group. Otherwise the x/gov Proposal metadata should be used. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // status defines if the IBC transfer hooks should be enabled or disabled. + Status bool `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` +} + +func (m *MsgGovToggleICS20Hooks) Reset() { *m = MsgGovToggleICS20Hooks{} } +func (*MsgGovToggleICS20Hooks) ProtoMessage() {} +func (*MsgGovToggleICS20Hooks) Descriptor() ([]byte, []int) { + return fileDescriptor_1982abc7d531f4dc, []int{4} +} +func (m *MsgGovToggleICS20Hooks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovToggleICS20Hooks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovToggleICS20Hooks.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 *MsgGovToggleICS20Hooks) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovToggleICS20Hooks.Merge(m, src) +} +func (m *MsgGovToggleICS20Hooks) XXX_Size() int { + return m.Size() +} +func (m *MsgGovToggleICS20Hooks) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovToggleICS20Hooks.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovToggleICS20Hooks proto.InternalMessageInfo + +func (*MsgGovToggleICS20Hooks) XXX_MessageName() string { + return "umee.uibc.v1.MsgGovToggleICS20Hooks" +} + +type MsgGovToggleICS20HooksResponse struct { +} + +func (m *MsgGovToggleICS20HooksResponse) Reset() { *m = MsgGovToggleICS20HooksResponse{} } +func (m *MsgGovToggleICS20HooksResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovToggleICS20HooksResponse) ProtoMessage() {} +func (*MsgGovToggleICS20HooksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1982abc7d531f4dc, []int{5} +} +func (m *MsgGovToggleICS20HooksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovToggleICS20HooksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovToggleICS20HooksResponse.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 *MsgGovToggleICS20HooksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovToggleICS20HooksResponse.Merge(m, src) +} +func (m *MsgGovToggleICS20HooksResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovToggleICS20HooksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovToggleICS20HooksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovToggleICS20HooksResponse proto.InternalMessageInfo + +func (*MsgGovToggleICS20HooksResponse) XXX_MessageName() string { + return "umee.uibc.v1.MsgGovToggleICS20HooksResponse" +} func init() { proto.RegisterType((*MsgGovUpdateQuota)(nil), "umee.uibc.v1.MsgGovUpdateQuota") proto.RegisterType((*MsgGovUpdateQuotaResponse)(nil), "umee.uibc.v1.MsgGovUpdateQuotaResponse") proto.RegisterType((*MsgGovSetIBCStatus)(nil), "umee.uibc.v1.MsgGovSetIBCStatus") proto.RegisterType((*MsgGovSetIBCStatusResponse)(nil), "umee.uibc.v1.MsgGovSetIBCStatusResponse") + proto.RegisterType((*MsgGovToggleICS20Hooks)(nil), "umee.uibc.v1.MsgGovToggleICS20Hooks") + proto.RegisterType((*MsgGovToggleICS20HooksResponse)(nil), "umee.uibc.v1.MsgGovToggleICS20HooksResponse") } func init() { proto.RegisterFile("umee/uibc/v1/tx.proto", fileDescriptor_1982abc7d531f4dc) } var fileDescriptor_1982abc7d531f4dc = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4f, 0x4f, 0xd4, 0x40, - 0x14, 0x6f, 0xe5, 0x8f, 0xec, 0xa0, 0xa8, 0x0d, 0x60, 0x77, 0x31, 0xed, 0x66, 0x0f, 0x4a, 0x8c, - 0xdb, 0x06, 0x4c, 0x38, 0x10, 0x35, 0xb1, 0x6c, 0xa2, 0x98, 0x10, 0x63, 0xc1, 0x83, 0x24, 0x66, -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, 0x8f, 0x35, 0xf9, 0xfb, 0xb1, 0x26, 0xbf, 0xef, 0x6a, 0x52, 0xbb, 0xab, 0xc9, - 0x87, 0x5d, 0x4d, 0xfa, 0xd2, 0xd5, 0xa4, 0xf5, 0xde, 0xf7, 0x95, 0xb2, 0x56, 0x23, 0xc4, 0xb6, - 0x31, 0xd9, 0xe2, 0x07, 0xb3, 0xb9, 0x60, 0xee, 0xf0, 0xd1, 0xea, 0x8c, 0xf2, 0x61, 0x70, 0xff, - 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x13, 0xb7, 0x35, 0x8d, 0xfd, 0x05, 0x00, 0x00, + // 717 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbf, 0x6f, 0xd3, 0x4e, + 0x1c, 0xb5, 0xfb, 0x23, 0xdf, 0xe4, 0xfa, 0xa5, 0x80, 0x69, 0x83, 0x93, 0x22, 0x3b, 0x8a, 0x10, + 0x54, 0xa8, 0xb1, 0x69, 0x90, 0x3a, 0x54, 0x80, 0x44, 0x1a, 0x89, 0x16, 0xa9, 0x42, 0x38, 0x65, + 0xa0, 0x12, 0x8a, 0xfc, 0xe3, 0xea, 0x5a, 0x89, 0x7d, 0xc6, 0x77, 0x4e, 0x9b, 0x09, 0xa9, 0x13, + 0x23, 0x63, 0xc7, 0x8a, 0x95, 0x05, 0xa1, 0xfe, 0x11, 0x19, 0x18, 0xaa, 0x4e, 0x88, 0x21, 0x40, + 0x33, 0x20, 0x31, 0xf2, 0x17, 0x20, 0xfb, 0xec, 0x36, 0xbf, 0xaa, 0x32, 0xa4, 0x93, 0x7d, 0xf7, + 0xde, 0xbd, 0xf7, 0x79, 0xf7, 0xf1, 0x9d, 0xc1, 0xac, 0x6f, 0x43, 0x28, 0xfb, 0x96, 0xa6, 0xcb, + 0x8d, 0x45, 0x99, 0xec, 0x4a, 0xae, 0x87, 0x08, 0xe2, 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x75, 0x04, 0xf6, 0xa8, + 0x23, 0x30, 0x5f, 0x3b, 0x02, 0xb3, 0xd9, 0x7d, 0x22, 0x03, 0xe5, 0x82, 0x03, 0xc9, 0x0e, 0xf2, + 0x6a, 0xe1, 0x40, 0x6e, 0x2c, 0xc9, 0xbb, 0xe1, 0xcf, 0x48, 0x4b, 0x84, 0xd7, 0xe7, 0x83, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xe3, 0x09, 0x06, 0x2f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -291,6 +384,8 @@ type MsgClient interface { GovUpdateQuota(ctx context.Context, in *MsgGovUpdateQuota, opts ...grpc.CallOption) (*MsgGovUpdateQuotaResponse, error) // GovSetIBCStatus sets IBC ICS20 status. Must be called by x/gov. GovSetIBCStatus(ctx context.Context, in *MsgGovSetIBCStatus, opts ...grpc.CallOption) (*MsgGovSetIBCStatusResponse, error) + // GovToggleICS20Hooks enables / disables ICS20 hooks support. Must be called by x/gov. + GovToggleICS20Hooks(ctx context.Context, in *MsgGovToggleICS20Hooks, opts ...grpc.CallOption) (*MsgGovToggleICS20HooksResponse, error) } type msgClient struct { @@ -319,6 +414,15 @@ func (c *msgClient) GovSetIBCStatus(ctx context.Context, in *MsgGovSetIBCStatus, return out, nil } +func (c *msgClient) GovToggleICS20Hooks(ctx context.Context, in *MsgGovToggleICS20Hooks, opts ...grpc.CallOption) (*MsgGovToggleICS20HooksResponse, error) { + out := new(MsgGovToggleICS20HooksResponse) + err := c.cc.Invoke(ctx, "/umee.uibc.v1.Msg/GovToggleICS20Hooks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // GovUpdateQuota adds new quota for ibc denoms or @@ -326,6 +430,8 @@ type MsgServer interface { GovUpdateQuota(context.Context, *MsgGovUpdateQuota) (*MsgGovUpdateQuotaResponse, error) // GovSetIBCStatus sets IBC ICS20 status. Must be called by x/gov. GovSetIBCStatus(context.Context, *MsgGovSetIBCStatus) (*MsgGovSetIBCStatusResponse, error) + // GovToggleICS20Hooks enables / disables ICS20 hooks support. Must be called by x/gov. + GovToggleICS20Hooks(context.Context, *MsgGovToggleICS20Hooks) (*MsgGovToggleICS20HooksResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -338,6 +444,9 @@ func (*UnimplementedMsgServer) GovUpdateQuota(ctx context.Context, req *MsgGovUp func (*UnimplementedMsgServer) GovSetIBCStatus(ctx context.Context, req *MsgGovSetIBCStatus) (*MsgGovSetIBCStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GovSetIBCStatus not implemented") } +func (*UnimplementedMsgServer) GovToggleICS20Hooks(ctx context.Context, req *MsgGovToggleICS20Hooks) (*MsgGovToggleICS20HooksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovToggleICS20Hooks not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -379,6 +488,24 @@ func _Msg_GovSetIBCStatus_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_GovToggleICS20Hooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovToggleICS20Hooks) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovToggleICS20Hooks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.uibc.v1.Msg/GovToggleICS20Hooks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovToggleICS20Hooks(ctx, req.(*MsgGovToggleICS20Hooks)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.uibc.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -391,6 +518,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "GovSetIBCStatus", Handler: _Msg_GovSetIBCStatus_Handler, }, + { + MethodName: "GovToggleICS20Hooks", + Handler: _Msg_GovToggleICS20Hooks_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/uibc/v1/tx.proto", @@ -579,6 +710,76 @@ func (m *MsgGovSetIBCStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgGovToggleICS20Hooks) 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 *MsgGovToggleICS20Hooks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovToggleICS20Hooks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status { + i-- + if m.Status { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + 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 *MsgGovToggleICS20HooksResponse) 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 *MsgGovToggleICS20HooksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovToggleICS20HooksResponse) 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 @@ -657,6 +858,35 @@ func (m *MsgGovSetIBCStatusResponse) Size() (n int) { return n } +func (m *MsgGovToggleICS20Hooks) 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 = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Status { + n += 2 + } + return n +} + +func (m *MsgGovToggleICS20HooksResponse) 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 } @@ -1213,6 +1443,190 @@ func (m *MsgGovSetIBCStatusResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgGovToggleICS20Hooks) 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: MsgGovToggleICS20Hooks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovToggleICS20Hooks: 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 Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovToggleICS20HooksResponse) 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: MsgGovToggleICS20HooksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovToggleICS20HooksResponse: 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 From 1a7fb44779a556ebdb11efbc2b1158c6b3f6b706 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 18:52:25 +0100 Subject: [PATCH 2/7] MsgGovToggleICS20Hooks sdk.Msg implementation --- x/uibc/msg.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/x/uibc/msg.go b/x/uibc/msg.go index 60bd17f29e..9bf16419f1 100644 --- a/x/uibc/msg.go +++ b/x/uibc/msg.go @@ -11,6 +11,7 @@ import ( var ( _ sdk.Msg = &MsgGovUpdateQuota{} _ sdk.Msg = &MsgGovSetIBCStatus{} + _ sdk.Msg = &MsgGovToggleICS20Hooks{} ) // @@ -87,3 +88,31 @@ func (msg *MsgGovSetIBCStatus) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } + +// +// MsgGovToggleICS20Hooks +// + +// String implements the Stringer interface. +func (msg *MsgGovToggleICS20Hooks) String() string { + out, _ := json.Marshal(msg) + return string(out) +} + +// ValidateBasic implements Msg +func (msg *MsgGovToggleICS20Hooks) ValidateBasic() error { + return checkers.Proposal(msg.Authority, msg.Description) +} + +// GetSigners implements Msg +func (msg *MsgGovToggleICS20Hooks) GetSigners() []sdk.AccAddress { + return checkers.Signers(msg.Authority) +} + +// LegacyMsg.Type implementations +func (msg MsgGovToggleICS20Hooks) Route() string { return "" } +func (msg MsgGovToggleICS20Hooks) Type() string { return sdk.MsgTypeURL(&msg) } +func (msg *MsgGovToggleICS20Hooks) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} From 080f761a3be3f900567b79a96fa52cf369246a6d Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 19:07:15 +0100 Subject: [PATCH 3/7] tests --- x/uibc/msg_test.go | 69 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/x/uibc/msg_test.go b/x/uibc/msg_test.go index a1f18fe54e..2454adf60c 100644 --- a/x/uibc/msg_test.go +++ b/x/uibc/msg_test.go @@ -4,9 +4,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/umee-network/umee/v6/tests/accs" + "github.com/umee-network/umee/v6/tests/tcheckers" "github.com/umee-network/umee/v6/util/checkers" - "gotest.tools/v3/assert" ) func TestMsgGovUpdateQuota(t *testing.T) { @@ -72,14 +73,7 @@ func TestMsgGovUpdateQuota(t *testing.T) { } for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if tc.errMsg == "" { - assert.NilError(t, err) - } else { - assert.ErrorContains(t, err, tc.errMsg) - } - }) + tcheckers.ErrorContains(t, tc.msg.ValidateBasic(), tc.errMsg, tc.name) } } @@ -126,13 +120,54 @@ func TestMsgGovSetIBCStatus(t *testing.T) { } for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if tc.errMsg == "" { - assert.NilError(t, err) - } else { - assert.ErrorContains(t, err, tc.errMsg) - } - }) + tcheckers.ErrorContains(t, tc.msg.ValidateBasic(), tc.errMsg, tc.name) + } +} + +func TestMsgGovTMsgGovToggleICS20Hooks(t *testing.T) { + t.Parallel() + validMsg := MsgGovToggleICS20Hooks{ + Authority: checkers.GovModuleAddr, + Description: "", + Status: true, + } + + validMsg2 := validMsg + validMsg2.Status = false + + validEmergencyGroup := validMsg + validEmergencyGroup.Authority = accs.Alice.String() + validEmergencyGroup.Description = "not empty" + + invalidAuthority := validMsg + invalidAuthority.Authority = "ABC" + + tests := []struct { + name string + msg MsgGovToggleICS20Hooks + errMsg string + }{ + { + name: "valid msg", + msg: validMsg, + errMsg: "", + }, { + name: "valid msg2", + msg: validMsg2, + errMsg: "", + }, { + name: "valid msg with other authority", + msg: validEmergencyGroup, + errMsg: "", + }, { + name: "invalid authority address in msg", + msg: invalidAuthority, + errMsg: "invalid bech32", + }, + } + + for _, tc := range tests { + tcheckers.ErrorContains(t, tc.msg.ValidateBasic(), tc.errMsg, tc.name) } + } From 8759cfae5d4b3f543529662440a790bc91cbf086 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 19:13:27 +0100 Subject: [PATCH 4/7] add tcheckers --- tests/tcheckers/error.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/tcheckers/error.go diff --git a/tests/tcheckers/error.go b/tests/tcheckers/error.go new file mode 100644 index 0000000000..92c1d60d00 --- /dev/null +++ b/tests/tcheckers/error.go @@ -0,0 +1,15 @@ +package tcheckers + +import ( + "testing" + + "gotest.tools/v3/assert" +) + +func ErrorContains(t *testing.T, err error, expectedErr, testName string) { + if expectedErr == "" { + assert.NilError(t, err, testName) + } else { + assert.ErrorContains(t, err, expectedErr, testName) + } +} From d7809d5d211bbcbe70d52d0890b39fcec260d99e Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 19:18:16 +0100 Subject: [PATCH 5/7] add Params.Ics20Hooks --- proto/umee/uibc/v1/events.proto | 5 + proto/umee/uibc/v1/quota.proto | 2 + proto/umee/uibc/v1/tx.proto | 4 +- x/uibc/events.pb.go | 192 +++++++++++++++++++++++++++++--- x/uibc/msg_test.go | 4 +- x/uibc/quota.pb.go | 118 ++++++++++++++------ x/uibc/quota/msg_server.go | 6 +- x/uibc/quota/params.go | 5 + x/uibc/tx.pb.go | 106 +++++++++--------- 9 files changed, 327 insertions(+), 115 deletions(-) diff --git a/proto/umee/uibc/v1/events.proto b/proto/umee/uibc/v1/events.proto index d574c17ee5..41487fb886 100644 --- a/proto/umee/uibc/v1/events.proto +++ b/proto/umee/uibc/v1/events.proto @@ -19,3 +19,8 @@ message EventBadRevert { message EventIBCTransferStatus { IBCTransferStatus status = 1; } + +// EventICS20Hooks is emitted on MsgGovToggleICS20Hooks. +message EventICS20Hooks { + bool enabled = 1; +} diff --git a/proto/umee/uibc/v1/quota.proto b/proto/umee/uibc/v1/quota.proto index 4c476dacf7..2ed091b0d9 100644 --- a/proto/umee/uibc/v1/quota.proto +++ b/proto/umee/uibc/v1/quota.proto @@ -48,6 +48,8 @@ message Params { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + // ics20_hooks enables or disables the ICS20 transfer hooks. + bool ics20_hooks = 8; } // IBCTransferStatus status of ibc-transfer quota check for inflow and outflow diff --git a/proto/umee/uibc/v1/tx.proto b/proto/umee/uibc/v1/tx.proto index 1c578afc23..569c9831bc 100644 --- a/proto/umee/uibc/v1/tx.proto +++ b/proto/umee/uibc/v1/tx.proto @@ -119,8 +119,8 @@ message MsgGovToggleICS20Hooks { // Emergency Group. Otherwise the x/gov Proposal metadata should be used. string description = 2; - // status defines if the IBC transfer hooks should be enabled or disabled. - bool status = 3; + // enabled defines if the IBC transfer hooks should be enabled or disabled. + bool enabled = 3; } diff --git a/x/uibc/events.pb.go b/x/uibc/events.pb.go index 80f737d350..624ee0a59e 100644 --- a/x/uibc/events.pb.go +++ b/x/uibc/events.pb.go @@ -102,32 +102,73 @@ func (m *EventIBCTransferStatus) XXX_DiscardUnknown() { var xxx_messageInfo_EventIBCTransferStatus proto.InternalMessageInfo +// EventICS20Hooks is emitted on MsgGovToggleICS20Hooks. +type EventICS20Hooks struct { + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (m *EventICS20Hooks) Reset() { *m = EventICS20Hooks{} } +func (m *EventICS20Hooks) String() string { return proto.CompactTextString(m) } +func (*EventICS20Hooks) ProtoMessage() {} +func (*EventICS20Hooks) Descriptor() ([]byte, []int) { + return fileDescriptor_c64e60b79cebf048, []int{2} +} +func (m *EventICS20Hooks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventICS20Hooks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventICS20Hooks.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 *EventICS20Hooks) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventICS20Hooks.Merge(m, src) +} +func (m *EventICS20Hooks) XXX_Size() int { + return m.Size() +} +func (m *EventICS20Hooks) XXX_DiscardUnknown() { + xxx_messageInfo_EventICS20Hooks.DiscardUnknown(m) +} + +var xxx_messageInfo_EventICS20Hooks proto.InternalMessageInfo + func init() { proto.RegisterType((*EventBadRevert)(nil), "umee.uibc.v1.EventBadRevert") proto.RegisterType((*EventIBCTransferStatus)(nil), "umee.uibc.v1.EventIBCTransferStatus") + proto.RegisterType((*EventICS20Hooks)(nil), "umee.uibc.v1.EventICS20Hooks") } func init() { proto.RegisterFile("umee/uibc/v1/events.proto", fileDescriptor_c64e60b79cebf048) } var fileDescriptor_c64e60b79cebf048 = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0xcd, 0x4d, 0x4d, - 0xd5, 0x2f, 0xcd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, 0x63, 0xb8, 0xf1, 0x58, 0x8e, - 0x21, 0x4a, 0x2d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x64, 0xa0, - 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0x36, 0x98, 0xa3, 0x5f, 0x66, 0xa6, 0x5f, 0x01, 0xf6, - 0x74, 0x12, 0x1b, 0xd8, 0xb3, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe5, 0x20, 0x31, - 0x47, 0x01, 0x00, 0x00, + // 291 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x13, 0x86, 0x00, 0xa6, 0x2a, 0x52, 0x84, 0xaa, 0xd0, 0xc1, 0x40, 0x06, 0x84, 0x84, + 0xb0, 0x69, 0x91, 0x60, 0x4f, 0x41, 0x02, 0x31, 0x91, 0x76, 0x62, 0x41, 0x4e, 0x7a, 0x0d, 0x51, + 0xda, 0x38, 0x38, 0x76, 0xa0, 0x6f, 0xc1, 0x63, 0x75, 0xec, 0xc8, 0x08, 0xc9, 0x8b, 0xa0, 0x38, + 0x41, 0x02, 0xb1, 0xdd, 0xef, 0xef, 0xee, 0xf3, 0xe9, 0xd0, 0xbe, 0x5a, 0x00, 0x50, 0x15, 0x07, + 0x21, 0x2d, 0x06, 0x14, 0x0a, 0x48, 0x65, 0x4e, 0x32, 0xc1, 0x25, 0xb7, 0x3b, 0x35, 0x22, 0x35, + 0x22, 0xc5, 0xa0, 0xbf, 0x17, 0xf1, 0x88, 0x6b, 0x40, 0xeb, 0xaa, 0xe9, 0xe9, 0x3b, 0x7f, 0xc6, + 0x5f, 0x14, 0x97, 0xac, 0x21, 0xee, 0x3d, 0xea, 0xde, 0xd4, 0x36, 0x8f, 0x4d, 0x7d, 0x28, 0x40, + 0x48, 0xfb, 0x08, 0x75, 0x66, 0x2c, 0x9e, 0x2b, 0x01, 0x4f, 0x72, 0x99, 0x81, 0x63, 0x1e, 0x9a, + 0x27, 0xdb, 0xfe, 0x4e, 0xfb, 0x36, 0x59, 0x66, 0x60, 0xf7, 0x90, 0x95, 0xb1, 0x30, 0x01, 0xe9, + 0x6c, 0x68, 0xd8, 0x26, 0xf7, 0x01, 0xf5, 0xb4, 0xec, 0xce, 0x1b, 0x4d, 0x04, 0x4b, 0xf3, 0x19, + 0x88, 0xb1, 0x64, 0x52, 0xe5, 0xf6, 0x15, 0xb2, 0x72, 0x5d, 0x69, 0x5d, 0x77, 0x78, 0x40, 0x7e, + 0x6f, 0x4d, 0xfe, 0x0d, 0xf8, 0x6d, 0xbb, 0x7b, 0x8a, 0x76, 0x1b, 0xe5, 0x68, 0x3c, 0x3c, 0xbf, + 0xe5, 0x3c, 0xc9, 0x6d, 0x07, 0x6d, 0x42, 0xca, 0x82, 0x39, 0x4c, 0xb5, 0x6c, 0xcb, 0xff, 0x89, + 0xde, 0xf5, 0xea, 0x0b, 0x1b, 0xab, 0x12, 0x9b, 0xeb, 0x12, 0x9b, 0x9f, 0x25, 0x36, 0xdf, 0x2b, + 0x6c, 0xac, 0x2b, 0x6c, 0x7c, 0x54, 0xd8, 0x78, 0x3c, 0x8e, 0x62, 0xf9, 0xac, 0x02, 0x12, 0xf2, + 0x05, 0xad, 0x7f, 0x3f, 0x4b, 0x41, 0xbe, 0x72, 0x91, 0xe8, 0x40, 0x8b, 0x4b, 0xfa, 0xa6, 0x2f, + 0x14, 0x58, 0xfa, 0x32, 0x17, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x19, 0x10, 0xc6, 0x74, + 0x01, 0x00, 0x00, } func (m *EventBadRevert) Marshal() (dAtA []byte, err error) { @@ -195,6 +236,39 @@ func (m *EventIBCTransferStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *EventICS20Hooks) 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 *EventICS20Hooks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventICS20Hooks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -235,6 +309,18 @@ func (m *EventIBCTransferStatus) Size() (n int) { return n } +func (m *EventICS20Hooks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -424,6 +510,76 @@ func (m *EventIBCTransferStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventICS20Hooks) 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 ErrIntOverflowEvents + } + 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: EventICS20Hooks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventICS20Hooks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/uibc/msg_test.go b/x/uibc/msg_test.go index 2454adf60c..491c7b3d78 100644 --- a/x/uibc/msg_test.go +++ b/x/uibc/msg_test.go @@ -129,11 +129,11 @@ func TestMsgGovTMsgGovToggleICS20Hooks(t *testing.T) { validMsg := MsgGovToggleICS20Hooks{ Authority: checkers.GovModuleAddr, Description: "", - Status: true, + Enabled: true, } validMsg2 := validMsg - validMsg2.Status = false + validMsg2.Enabled = false validEmergencyGroup := validMsg validEmergencyGroup.Authority = accs.Alice.String() diff --git a/x/uibc/quota.pb.go b/x/uibc/quota.pb.go index 8393ba51a8..38a8cd941d 100644 --- a/x/uibc/quota.pb.go +++ b/x/uibc/quota.pb.go @@ -89,6 +89,8 @@ type Params struct { InflowOutflowQuotaRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=inflow_outflow_quota_rate,json=inflowOutflowQuotaRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_outflow_quota_rate"` // inflow_outflow_token_quota_base defines the inflow outflow quota base for token InflowOutflowTokenQuotaBase github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=inflow_outflow_token_quota_base,json=inflowOutflowTokenQuotaBase,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_outflow_token_quota_base"` + // ics20_hooks enables or disables the ICS20 transfer hooks. + Ics20Hooks bool `protobuf:"varint,8,opt,name=ics20_hooks,json=ics20Hooks,proto3" json:"ics20_hooks,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -138,6 +140,13 @@ func (m *Params) GetQuotaDuration() time.Duration { return 0 } +func (m *Params) GetIcs20Hooks() bool { + if m != nil { + return m.Ics20Hooks + } + return false +} + func init() { proto.RegisterEnum("umee.uibc.v1.IBCTransferStatus", IBCTransferStatus_name, IBCTransferStatus_value) proto.RegisterType((*Params)(nil), "umee.uibc.v1.Params") @@ -146,43 +155,45 @@ func init() { func init() { proto.RegisterFile("umee/uibc/v1/quota.proto", fileDescriptor_651be1a0280abcb6) } var fileDescriptor_651be1a0280abcb6 = []byte{ - // 574 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x4f, 0x6f, 0xd3, 0x4c, - 0x10, 0xc6, 0xe3, 0xfe, 0x7b, 0xd5, 0xed, 0x4b, 0x55, 0x2c, 0x40, 0x6e, 0x91, 0xec, 0x10, 0x68, - 0x14, 0x2a, 0x62, 0xab, 0x45, 0xe2, 0x80, 0x00, 0x11, 0xc7, 0xae, 0x64, 0x09, 0x25, 0xa9, 0xed, - 0x5c, 0x90, 0x90, 0xb5, 0x76, 0x37, 0xc1, 0x4a, 0xec, 0x0d, 0xf6, 0x3a, 0x21, 0x27, 0x24, 0x4e, - 0x1c, 0x39, 0xf2, 0x41, 0xf8, 0x10, 0x3d, 0x56, 0x9c, 0x10, 0x87, 0x80, 0x92, 0x1b, 0x47, 0x3e, - 0x00, 0x42, 0xde, 0x75, 0x68, 0x02, 0xcd, 0x2d, 0x9c, 0x76, 0x27, 0xf3, 0xec, 0xef, 0x99, 0x99, - 0x8d, 0x17, 0x08, 0x49, 0x80, 0x90, 0x92, 0xf8, 0xae, 0xa7, 0xf4, 0x0f, 0x95, 0x57, 0x09, 0x26, - 0x50, 0xee, 0x45, 0x98, 0x60, 0xfe, 0xff, 0x34, 0x23, 0xa7, 0x19, 0xb9, 0x7f, 0xb8, 0x77, 0xad, - 0x8d, 0xdb, 0x98, 0x26, 0x94, 0x74, 0xc7, 0x34, 0x7b, 0x62, 0x1b, 0xe3, 0x76, 0x17, 0x29, 0x34, - 0x72, 0x93, 0x96, 0x72, 0x9a, 0x44, 0x90, 0xf8, 0x38, 0xcc, 0xf2, 0xbb, 0x1e, 0x8e, 0x03, 0x1c, - 0x3b, 0xec, 0x20, 0x0b, 0x58, 0xaa, 0xf0, 0x73, 0x1d, 0x6c, 0x34, 0x60, 0x04, 0x83, 0x98, 0x7f, - 0x02, 0x80, 0xef, 0x7a, 0x4e, 0x4c, 0x20, 0x49, 0x62, 0x81, 0xcb, 0x73, 0xa5, 0xed, 0x23, 0x49, - 0x9e, 0xb5, 0x97, 0x0d, 0xb5, 0x6a, 0x47, 0x30, 0x8c, 0x5b, 0x28, 0xb2, 0xa8, 0xcc, 0xdc, 0xf4, - 0x5d, 0x8f, 0x6d, 0xf9, 0x17, 0x60, 0x8b, 0x60, 0x02, 0xbb, 0x0e, 0x2d, 0x5f, 0x58, 0xc9, 0x73, - 0xa5, 0x4d, 0xf5, 0xd1, 0xd9, 0x48, 0xca, 0x7d, 0x19, 0x49, 0xc5, 0xb6, 0x4f, 0x5e, 0x26, 0xae, - 0xec, 0xe1, 0x20, 0x2b, 0x20, 0x5b, 0xca, 0xf1, 0x69, 0x47, 0x21, 0xc3, 0x1e, 0x8a, 0x65, 0x0d, - 0x79, 0x9f, 0x3e, 0x96, 0x41, 0x56, 0x9f, 0x86, 0x3c, 0x13, 0x50, 0xe0, 0x49, 0xca, 0x63, 0xf8, - 0x0e, 0x0a, 0x33, 0xfc, 0xea, 0x72, 0xf0, 0x1d, 0x14, 0x32, 0xfc, 0x1b, 0xb0, 0x4d, 0xc1, 0xce, - 0x74, 0x76, 0xc2, 0x5a, 0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5b, 0xe1, 0x0f, 0x40, 0x71, 0xb1, - 0xac, 0xde, 0xb4, 0x2f, 0x90, 0xab, 0xfc, 0x5d, 0xb0, 0xbf, 0x58, 0x6b, 0xd4, 0x2e, 0xa4, 0x6b, - 0x7c, 0x09, 0xdc, 0xb9, 0x4c, 0x3a, 0x8d, 0x2d, 0xa7, 0x51, 0x69, 0x5a, 0xba, 0xb6, 0xb3, 0xae, - 0x3e, 0x3d, 0x1b, 0x8b, 0xdc, 0xf9, 0x58, 0xe4, 0xbe, 0x8d, 0x45, 0xee, 0xfd, 0x44, 0xcc, 0x9d, - 0x4f, 0xc4, 0xdc, 0xe7, 0x89, 0x98, 0x7b, 0x3e, 0x3b, 0xf7, 0xf4, 0x41, 0x28, 0x87, 0x88, 0x0c, - 0x70, 0xd4, 0xa1, 0x81, 0xd2, 0x7f, 0xa0, 0xbc, 0xa6, 0x6f, 0x97, 0xbb, 0x41, 0x3f, 0x92, 0xfb, - 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x33, 0x81, 0x46, 0x7f, 0xcf, 0x04, 0x00, 0x00, + // 595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0x8f, 0xfb, 0x27, 0xb4, 0x57, 0xa8, 0x8a, 0x05, 0xc8, 0x2d, 0x92, 0x1d, 0x02, 0xad, 0x42, + 0x45, 0x6d, 0x5a, 0x24, 0x06, 0x04, 0x88, 0xb8, 0x76, 0x85, 0x25, 0x94, 0xb6, 0xb6, 0xb3, 0x20, + 0x21, 0xeb, 0xec, 0x5e, 0x53, 0x2b, 0xb1, 0xaf, 0xf8, 0xce, 0x0d, 0x99, 0x90, 0x98, 0x18, 0x19, + 0xd9, 0xf8, 0x12, 0x7c, 0x88, 0x8e, 0x15, 0x13, 0x62, 0x08, 0x28, 0xd9, 0x18, 0xf9, 0x04, 0x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 0xed, 0x6a, 0xcd, 0xd9, + 0x31, 0x6d, 0xcf, 0x71, 0xab, 0x6e, 0xdd, 0xf1, 0xea, 0x35, 0x67, 0xcf, 0xdc, 0xb6, 0x76, 0x2c, + 0xd3, 0x58, 0x2a, 0x88, 0x6b, 0xa0, 0x7c, 0x11, 0x68, 0xbf, 0xbe, 0xeb, 0x56, 0x3d, 0xc3, 0x72, + 0xaa, 0xfa, 0x0b, 0xd3, 0x58, 0x12, 0xc4, 0x55, 0x70, 0x6b, 0x3c, 0xce, 0xac, 0x71, 0xd8, 0x94, + 0xb8, 0x0e, 0xd6, 0xc6, 0xc3, 0x76, 0xeb, 0xee, 0x39, 0xe5, 0xb4, 0x78, 0x17, 0xac, 0x8e, 0xc7, + 0x5a, 0xb5, 0x73, 0xe8, 0x8c, 0x58, 0x01, 0x77, 0x2e, 0x82, 0x0e, 0x6c, 0xc7, 0xdb, 0xab, 0xd6, + 0x1d, 0xd3, 0x58, 0x9a, 0xd5, 0x9f, 0x9d, 0xf6, 0x64, 0xe1, 0xac, 0x27, 0x0b, 0x3f, 0x7a, 0xb2, + 0xf0, 0xa1, 0x2f, 0x17, 0xce, 0xfa, 0x72, 0xe1, 0x6b, 0x5f, 0x2e, 0xbc, 0x1c, 0x5e, 0x4c, 0xf6, + 0x62, 0x6c, 0xc4, 0x88, 0xb6, 0x71, 0xd2, 0x64, 0x86, 0x76, 0xf2, 0x50, 0x7b, 0xc3, 0x1e, 0x37, + 0xbf, 0xc8, 0xfe, 0xa2, 0x07, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xb2, 0xc0, 0xfd, 0xf0, + 0x04, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -205,6 +216,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Ics20Hooks { + i-- + if m.Ics20Hooks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } { size := m.InflowOutflowTokenQuotaBase.Size() i -= size @@ -303,6 +324,9 @@ func (m *Params) Size() (n int) { n += 1 + l + sovQuota(uint64(l)) l = m.InflowOutflowTokenQuotaBase.Size() n += 1 + l + sovQuota(uint64(l)) + if m.Ics20Hooks { + n += 2 + } return n } @@ -563,6 +587,26 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ics20Hooks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuota + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ics20Hooks = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuota(dAtA[iNdEx:]) diff --git a/x/uibc/quota/msg_server.go b/x/uibc/quota/msg_server.go index f1f2349926..839165b9dc 100644 --- a/x/uibc/quota/msg_server.go +++ b/x/uibc/quota/msg_server.go @@ -79,9 +79,9 @@ func (m msgServer) GovToggleICS20Hooks(ctx context.Context, msg *uibc.MsgGovTogg return nil, err } - // if err := k.SetIBCStatus(msg.IbcStatus); err != nil { - // return &uibc.MsgGovSetIBCStatusResponse{}, err - // } + if err := k.SetICS20HooksStatus(msg.Enabled); err != nil { + return &uibc.MsgGovToggleICS20HooksResponse{}, err + } // sdkutil.Emit(&sdkCtx, &uibc.EventIBCTransferStatus{ // Status: msg.IbcStatus, // }) diff --git a/x/uibc/quota/params.go b/x/uibc/quota/params.go index b60a1c3d50..2973b4c79f 100644 --- a/x/uibc/quota/params.go +++ b/x/uibc/quota/params.go @@ -68,6 +68,11 @@ func validateEmergencyQuotaParamsUpdate(pOld, pNew uibc.Params) error { func (k Keeper) SetIBCStatus(ibcStatus uibc.IBCTransferStatus) error { params := k.GetParams() params.IbcStatus = ibcStatus + return k.SetParams(params) +} +func (k Keeper) SetICS20HooksStatus(enabled bool) error { + params := k.GetParams() + params.Ics20Hooks = enabled return k.SetParams(params) } diff --git a/x/uibc/tx.pb.go b/x/uibc/tx.pb.go index 4e969ba903..fd751d3434 100644 --- a/x/uibc/tx.pb.go +++ b/x/uibc/tx.pb.go @@ -228,8 +228,8 @@ type MsgGovToggleICS20Hooks struct { // description motivating the change. Should be used only when executing by the // Emergency Group. Otherwise the x/gov Proposal metadata should be used. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // status defines if the IBC transfer hooks should be enabled or disabled. - Status bool `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` + // enabled defines if the IBC transfer hooks should be enabled or disabled. + Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` } func (m *MsgGovToggleICS20Hooks) Reset() { *m = MsgGovToggleICS20Hooks{} } @@ -319,52 +319,52 @@ func init() { func init() { proto.RegisterFile("umee/uibc/v1/tx.proto", fileDescriptor_1982abc7d531f4dc) } var fileDescriptor_1982abc7d531f4dc = []byte{ - // 717 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbf, 0x6f, 0xd3, 0x4e, - 0x1c, 0xb5, 0xfb, 0x23, 0xdf, 0xe4, 0xfa, 0xa5, 0x80, 0x69, 0x83, 0x93, 0x22, 0x3b, 0x8a, 0x10, - 0x54, 0xa8, 0xb1, 0x69, 0x90, 0x3a, 0x54, 0x80, 0x44, 0x1a, 0x89, 0x16, 0xa9, 0x42, 0x38, 0x65, - 0xa0, 0x12, 0x8a, 0xfc, 0xe3, 0xea, 0x5a, 0x89, 0x7d, 0xc6, 0x77, 0x4e, 0x9b, 0x09, 0xa9, 0x13, - 0x23, 0x63, 0xc7, 0x8a, 0x95, 0x05, 0xa1, 0xfe, 0x11, 0x19, 0x18, 0xaa, 0x4e, 0x88, 0x21, 0x40, - 0x33, 0x20, 0x31, 0xf2, 0x17, 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0b, 0xdc, 0x18, 0xd6, 0x85, 0xdb, 0xc3, 0x04, - 0xfa, 0x59, 0xd9, 0x85, 0x7f, 0x61, 0xc5, 0x56, 0xa5, 0xd5, 0xd6, 0x4f, 0x81, 0x69, 0x9d, 0x08, - 0xec, 0xd1, 0x89, 0xc0, 0xfe, 0x38, 0x11, 0xd8, 0xf7, 0x1d, 0x81, 0x69, 0x75, 0x04, 0xf6, 0xa8, - 0x23, 0x30, 0x5f, 0x3b, 0x02, 0xb3, 0xd9, 0x7d, 0x22, 0x03, 0xe5, 0x82, 0x03, 0xc9, 0x0e, 0xf2, - 0x6a, 0xe1, 0x40, 0x6e, 0x2c, 0xc9, 0xbb, 0xe1, 0xcf, 0x48, 0x4b, 0x84, 0xd7, 0xe7, 0x83, 0xbf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xe3, 0x09, 0x06, 0x2f, 0x07, 0x00, 0x00, + // 718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbd, 0x6f, 0xd3, 0x40, + 0x1c, 0xb5, 0xfb, 0x99, 0x5c, 0xa1, 0x80, 0x69, 0x8b, 0x93, 0x22, 0x3b, 0x8a, 0x10, 0x54, 0xa8, + 0xb1, 0x69, 0x90, 0x3a, 0x54, 0x80, 0x44, 0x1a, 0x89, 0x16, 0xa9, 0x42, 0x38, 0x65, 0xa0, 0x12, + 0x8a, 0xfc, 0x71, 0x75, 0xad, 0xc4, 0x3e, 0xe3, 0x3b, 0xa7, 0xcd, 0x84, 0xd4, 0x89, 0x91, 0xb1, + 0x63, 0x07, 0x36, 0x16, 0x84, 0xfa, 0x47, 0x64, 0x60, 0xa8, 0x3a, 0x21, 0x86, 0x00, 0xcd, 0x80, + 0xc4, 0xc8, 0x5f, 0x80, 0xec, 0xb3, 0xdb, 0x7c, 0x55, 0x61, 0x48, 0x27, 0xfb, 0xee, 0xbd, 0x7b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, 0x87, 0x15, 0x5b, 0x15, 0xd6, 0x1a, 0xbf, 0x04, 0xa6, 0x71, + 0x2a, 0xb0, 0xc7, 0xa7, 0x02, 0xfb, 0xf3, 0x54, 0x60, 0x3f, 0xb4, 0x04, 0xa6, 0xd1, 0x12, 0xd8, + 0xe3, 0x96, 0xc0, 0x7c, 0x6b, 0x09, 0xcc, 0x56, 0xfb, 0x99, 0x0c, 0x94, 0x73, 0x0e, 0x24, 0xbb, + 0xc8, 0xab, 0x84, 0x03, 0xb9, 0xb6, 0x2c, 0xef, 0x85, 0xbf, 0x23, 0x6d, 0x22, 0xbc, 0x40, 0x1f, + 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x4d, 0x74, 0x41, 0x31, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -730,9 +730,9 @@ func (m *MsgGovToggleICS20Hooks) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.Status { + if m.Enabled { i-- - if m.Status { + if m.Enabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -872,7 +872,7 @@ func (m *MsgGovToggleICS20Hooks) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Status { + if m.Enabled { n += 2 } return n @@ -1538,7 +1538,7 @@ func (m *MsgGovToggleICS20Hooks) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1555,7 +1555,7 @@ func (m *MsgGovToggleICS20Hooks) Unmarshal(dAtA []byte) error { break } } - m.Status = bool(v != 0) + m.Enabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From d60785cf274ccd5adbce42da1677415c3244e374 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 19:22:35 +0100 Subject: [PATCH 6/7] emit event --- x/uibc/quota/msg_server.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x/uibc/quota/msg_server.go b/x/uibc/quota/msg_server.go index 839165b9dc..e0daa37372 100644 --- a/x/uibc/quota/msg_server.go +++ b/x/uibc/quota/msg_server.go @@ -58,9 +58,7 @@ func (m msgServer) GovSetIBCStatus( if err := k.SetIBCStatus(msg.IbcStatus); err != nil { return &uibc.MsgGovSetIBCStatusResponse{}, err } - sdkutil.Emit(&sdkCtx, &uibc.EventIBCTransferStatus{ - Status: msg.IbcStatus, - }) + sdkutil.Emit(&sdkCtx, &uibc.EventIBCTransferStatus{Status: msg.IbcStatus}) return &uibc.MsgGovSetIBCStatusResponse{}, nil } @@ -82,9 +80,7 @@ func (m msgServer) GovToggleICS20Hooks(ctx context.Context, msg *uibc.MsgGovTogg if err := k.SetICS20HooksStatus(msg.Enabled); err != nil { return &uibc.MsgGovToggleICS20HooksResponse{}, err } - // sdkutil.Emit(&sdkCtx, &uibc.EventIBCTransferStatus{ - // Status: msg.IbcStatus, - // }) + sdkutil.Emit(&sdkCtx, &uibc.EventICS20Hooks{Enabled: msg.Enabled}) return &uibc.MsgGovToggleICS20HooksResponse{}, nil } From e1e9f913de4ec65ac95890e97f4c193ca9b8a309 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Mar 2024 19:27:19 +0100 Subject: [PATCH 7/7] lint --- proto/umee/uibc/v1/tx.proto | 6 +++--- swagger/swagger.yaml | 9 +++++++++ x/uibc/tx.pb.go | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/proto/umee/uibc/v1/tx.proto b/proto/umee/uibc/v1/tx.proto index 569c9831bc..4db3ea5a5e 100644 --- a/proto/umee/uibc/v1/tx.proto +++ b/proto/umee/uibc/v1/tx.proto @@ -103,7 +103,7 @@ message MsgGovSetIBCStatus { IBCTransferStatus ibc_status = 4; } -// MsgGovSetIBCStatusResponse define the response type for Msg/MsgGovSetIBCStatus with x/gov proposals. +// MsgGovSetIBCStatusResponse is a response type for Msg/GovSetIBCStatus. message MsgGovSetIBCStatusResponse {} // MsgGovToggleICS20Hooks is a request type for GovToggleICS20Hooks handler. @@ -123,5 +123,5 @@ message MsgGovToggleICS20Hooks { bool enabled = 3; } - -message MsgGovToggleICS20HooksResponse{} +// MsgGovToggleICS20HooksResponse is a response type for Msg/GovToggleICS20Hooks. +message MsgGovToggleICS20HooksResponse {} diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index da05f46036..7ae7291042 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -3661,6 +3661,9 @@ paths: title: >- inflow_outflow_token_quota_base defines the inflow outflow quota base for token + ics20_hooks: + type: boolean + description: ics20_hooks enables or disables the ICS20 transfer hooks. title: Params of x/uibc module description: >- QueryParamsResponse defines the response structure for the Params @@ -9212,6 +9215,9 @@ definitions: title: >- inflow_outflow_token_quota_base defines the inflow outflow quota base for token + ics20_hooks: + type: boolean + description: ics20_hooks enables or disables the ICS20 transfer hooks. title: Params of x/uibc module umee.uibc.v1.QueryAllOutflowsResponse: type: object @@ -9305,6 +9311,9 @@ definitions: title: >- inflow_outflow_token_quota_base defines the inflow outflow quota base for token + ics20_hooks: + type: boolean + description: ics20_hooks enables or disables the ICS20 transfer hooks. title: Params of x/uibc module description: |- QueryParamsResponse defines the response structure for the Params gRPC diff --git a/x/uibc/tx.pb.go b/x/uibc/tx.pb.go index fd751d3434..13764d994d 100644 --- a/x/uibc/tx.pb.go +++ b/x/uibc/tx.pb.go @@ -180,7 +180,7 @@ func (*MsgGovSetIBCStatus) XXX_MessageName() string { return "umee.uibc.v1.MsgGovSetIBCStatus" } -// MsgGovSetIBCStatusResponse define the response type for Msg/MsgGovSetIBCStatus with x/gov proposals. +// MsgGovSetIBCStatusResponse is a response type for Msg/GovSetIBCStatus. type MsgGovSetIBCStatusResponse struct { } @@ -268,6 +268,7 @@ func (*MsgGovToggleICS20Hooks) XXX_MessageName() string { return "umee.uibc.v1.MsgGovToggleICS20Hooks" } +// MsgGovToggleICS20HooksResponse is a response type for Msg/GovToggleICS20Hooks. type MsgGovToggleICS20HooksResponse struct { }