From af003ec1ed112bf89bbb885f87d641589edd3341 Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Thu, 19 Oct 2023 17:39:53 +0700 Subject: [PATCH] fix proto --- proto/composable/ratelimit/v1beta1/tx.proto | 6 +- x/ratelimit/types/tx.pb.go | 137 ++++++++++---------- 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/proto/composable/ratelimit/v1beta1/tx.proto b/proto/composable/ratelimit/v1beta1/tx.proto index 0b5df036c..6f067b3c6 100644 --- a/proto/composable/ratelimit/v1beta1/tx.proto +++ b/proto/composable/ratelimit/v1beta1/tx.proto @@ -37,13 +37,13 @@ message MsgAddRateLimit { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + // Duration of rate limit. The rate limit will reset when reach the duration. + uint64 duration_hours = 6; // Min amount of rate limit (allow transfer max(min-amout, rate-limit)) - string min_rate_limit_amount = 6 [ + string min_rate_limit_amount = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - // Duration of rate limit. The rate limit will reset when reach the duration. - uint64 duration_hours = 7; } message MsgAddRateLimitResponse {} diff --git a/x/ratelimit/types/tx.pb.go b/x/ratelimit/types/tx.pb.go index 3f7c5540c..51439e8bd 100644 --- a/x/ratelimit/types/tx.pb.go +++ b/x/ratelimit/types/tx.pb.go @@ -42,10 +42,10 @@ type MsgAddRateLimit struct { MaxPercentSend github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=max_percent_send,json=maxPercentSend,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_send"` // Max rate limit receive MaxPercentRecv github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=max_percent_recv,json=maxPercentRecv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_recv"` - // Min amount of rate limit (allow transfer max(min-amout, rate-limit)) - MinRateLimitAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=min_rate_limit_amount,json=minRateLimitAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_rate_limit_amount"` // Duration of rate limit. The rate limit will reset when reach the duration. - DurationHours uint64 `protobuf:"varint,7,opt,name=duration_hours,json=durationHours,proto3" json:"duration_hours,omitempty"` + DurationHours uint64 `protobuf:"varint,6,opt,name=duration_hours,json=durationHours,proto3" json:"duration_hours,omitempty"` + // Min amount of rate limit (allow transfer max(min-amout, rate-limit)) + MinRateLimitAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=min_rate_limit_amount,json=minRateLimitAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_rate_limit_amount"` } func (m *MsgAddRateLimit) Reset() { *m = MsgAddRateLimit{} } @@ -466,44 +466,45 @@ func init() { } var fileDescriptor_7c4a582edd75a41c = []byte{ - // 577 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x96, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0xb3, 0x26, 0xad, 0x64, 0xa0, 0xb1, 0x1d, 0xa2, 0xd9, 0xae, 0x65, 0x53, 0x02, 0x95, - 0xa2, 0x76, 0xd7, 0x54, 0x44, 0xe9, 0x2d, 0xd5, 0x83, 0x01, 0x03, 0xb2, 0x2a, 0x88, 0x97, 0x65, - 0xb2, 0x33, 0x6e, 0x16, 0x33, 0x33, 0xcb, 0xce, 0x24, 0x24, 0xe0, 0xa9, 0xe0, 0xdd, 0xa3, 0xa0, - 0x1f, 0xc2, 0x8f, 0xd1, 0x63, 0x6f, 0x4a, 0x0f, 0x41, 0x92, 0x83, 0x77, 0x3f, 0x81, 0xec, 0x6c, - 0xfe, 0xd4, 0x2c, 0xd5, 0xa6, 0x1e, 0x14, 0xf1, 0x34, 0xc9, 0xbc, 0xcf, 0xfb, 0xf0, 0x0c, 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, 0xfa, 0xd9, 0xad, - 0x6e, 0xcd, 0x3d, 0xc9, 0xc6, 0x9d, 0x85, 0xe4, 0x93, 0x14, 0xf0, 0x8d, 0x06, 0x4a, 0xc9, 0x64, - 0xa4, 0x13, 0xdc, 0xfa, 0xa5, 0xe5, 0xdc, 0x4c, 0x19, 0xf7, 0x16, 0xed, 0xf8, 0x21, 0x47, 0x02, - 0xf9, 0x3c, 0x39, 0xe6, 0xc6, 0xe3, 0x0c, 0x39, 0x4e, 0x19, 0x28, 0x78, 0xa0, 0x81, 0x2b, 0x0a, - 0x58, 0x3a, 0x86, 0x7d, 0x06, 0xd3, 0x93, 0xa4, 0x8d, 0xbb, 0x0b, 0x36, 0x4c, 0x42, 0xec, 0xdf, - 0x38, 0x1c, 0x9a, 0xda, 0xd1, 0xd0, 0xd4, 0xbe, 0x0c, 0x4d, 0xed, 0xed, 0xc8, 0xcc, 0x1c, 0x8d, - 0xcc, 0xcc, 0xe7, 0x91, 0x99, 0x79, 0xb1, 0xd6, 0x3b, 0xf1, 0x1d, 0xa0, 0x2e, 0x8b, 0xe6, 0xb2, - 0x7a, 0x6d, 0xdf, 0xfe, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xde, 0x0e, 0x8e, 0x2c, 0x08, 0x00, - 0x00, + // 594 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x96, 0x4f, 0x6b, 0x13, 0x4f, + 0x18, 0xc7, 0xb3, 0xbf, 0xa4, 0x29, 0x19, 0x68, 0x7e, 0xed, 0x10, 0xcd, 0x76, 0x2d, 0x9b, 0x12, + 0xa8, 0x14, 0xb5, 0xbb, 0xa6, 0x22, 0x4a, 0x6f, 0xa9, 0x1e, 0x0c, 0x18, 0x90, 0x55, 0x41, 0xbc, + 0x2c, 0x93, 0x9d, 0x71, 0xb3, 0x98, 0x99, 0x59, 0x76, 0x26, 0x21, 0x01, 0x4f, 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xd0, 0x5b, 0x84, 0xf2, 0xce, 0x9f, 0x47, + 0x3f, 0x27, 0xfc, 0x4c, 0xba, 0x49, 0xf8, 0x77, 0x0a, 0xd8, 0x88, 0xca, 0x82, 0xc8, 0xbf, 0x2f, + 0xfb, 0x15, 0xb0, 0x99, 0x08, 0x37, 0x8e, 0xbe, 0xff, 0x36, 0x03, 0xd2, 0x75, 0xe1, 0xc2, 0x57, + 0xa0, 0x50, 0xc5, 0xf8, 0x49, 0x80, 0x98, 0x78, 0x41, 0x82, 0xe9, 0x21, 0xf6, 0x8c, 0x1f, 0xdd, + 0xea, 0xc6, 0xcc, 0x93, 0xac, 0xdd, 0x5e, 0x48, 0x3e, 0x4e, 0x01, 0x5f, 0x2b, 0xa0, 0x18, 0x4f, + 0x46, 0x32, 0xc1, 0xcd, 0x9f, 0x5a, 0xce, 0xcc, 0x94, 0x76, 0x77, 0xd1, 0x8e, 0xef, 0x72, 0xc4, + 0x90, 0x97, 0xc9, 0x31, 0x33, 0x1e, 0x17, 0xc8, 0x31, 0x67, 0xa0, 0xe0, 0x91, 0x02, 0x2e, 0x47, + 0xc0, 0x92, 0x31, 0xcc, 0x0b, 0x98, 0x9e, 0x25, 0xad, 0xdd, 0x59, 0xb0, 0x61, 0x1c, 0xe2, 0xf0, + 0xfa, 0xf1, 0x40, 0x57, 0x4e, 0x06, 0xba, 0xf2, 0x79, 0xa0, 0x2b, 0x6f, 0x86, 0x7a, 0xea, 0x64, + 0xa8, 0xa7, 0x3e, 0x0d, 0xf5, 0xd4, 0xf3, 0x8d, 0xee, 0x99, 0xef, 0x80, 0xe8, 0xb2, 0x68, 0x64, + 0xa3, 0xd7, 0xf6, 0xad, 0x6f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x79, 0x45, 0x81, 0x07, 0x2c, 0x08, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -714,11 +715,6 @@ func (m *MsgAddRateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.DurationHours != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.DurationHours)) - i-- - dAtA[i] = 0x38 - } { size := m.MinRateLimitAmount.Size() i -= size @@ -728,7 +724,12 @@ func (m *MsgAddRateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a + if m.DurationHours != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DurationHours)) + i-- + dAtA[i] = 0x30 + } { size := m.MaxPercentRecv.Size() i -= size @@ -1065,11 +1066,11 @@ func (m *MsgAddRateLimit) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.MaxPercentRecv.Size() n += 1 + l + sovTx(uint64(l)) - l = m.MinRateLimitAmount.Size() - n += 1 + l + sovTx(uint64(l)) if m.DurationHours != 0 { n += 1 + sovTx(uint64(m.DurationHours)) } + l = m.MinRateLimitAmount.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1381,6 +1382,25 @@ func (m *MsgAddRateLimit) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationHours", wireType) + } + m.DurationHours = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationHours |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinRateLimitAmount", wireType) } @@ -1414,25 +1434,6 @@ func (m *MsgAddRateLimit) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationHours", wireType) - } - m.DurationHours = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationHours |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])