From e796f0c4e2b6e3217ee182205c43a05c25bc1e25 Mon Sep 17 00:00:00 2001 From: drklee3 Date: Tue, 16 Nov 2021 09:41:01 -0800 Subject: [PATCH] Use string for sdk.Dec proto types --- docs/core/proto-docs.md | 2 +- proto/kava/cdp/v1beta1/query.proto | 19 +- x/cdp/types/cdp.go | 4 +- x/cdp/types/query.pb.go | 276 +++++++++++++++-------------- 4 files changed, 150 insertions(+), 151 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 2c0aba8a3f..f55e163416 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -517,7 +517,7 @@ QueryCdpsRequest is the params for a filtered CDP query, the request type for th | `collateral_type` | [string](#string) | | | | `owner` | [string](#string) | | | | `id` | [uint64](#uint64) | | | -| `ratio` | [string](#string) | | | +| `ratio` | [string](#string) | | sdk.Dec as a string | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | | diff --git a/proto/kava/cdp/v1beta1/query.proto b/proto/kava/cdp/v1beta1/query.proto index 15e5f289aa..0ef785244e 100644 --- a/proto/kava/cdp/v1beta1/query.proto +++ b/proto/kava/cdp/v1beta1/query.proto @@ -86,11 +86,8 @@ message QueryCdpsRequest { string collateral_type = 1; string owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; uint64 id = 3 [(gogoproto.customname) = "ID"]; - string ratio = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + // sdk.Dec as a string + string ratio = 4; cosmos.base.query.v1beta1.PageRequest pagination = 5; } @@ -144,15 +141,7 @@ message CDPResponse { cosmos.base.v1beta1.Coin principal = 5 [(gogoproto.nullable) = false]; cosmos.base.v1beta1.Coin accumulated_fees = 6 [(gogoproto.nullable) = false]; google.protobuf.Timestamp fees_updated = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - string interest_factor = 8 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string interest_factor = 8; cosmos.base.v1beta1.Coin collateral_value = 9 [(gogoproto.nullable) = false]; - string collateralization_ratio = 10 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string collateralization_ratio = 10; } diff --git a/x/cdp/types/cdp.go b/x/cdp/types/cdp.go index e74d9fb3d6..15ad920c45 100644 --- a/x/cdp/types/cdp.go +++ b/x/cdp/types/cdp.go @@ -172,9 +172,9 @@ func NewCDPResponse(cdp CDP, collateralValue sdk.Coin, collateralizationRatio sd Principal: cdp.Principal, AccumulatedFees: cdp.AccumulatedFees, FeesUpdated: cdp.FeesUpdated, - InterestFactor: cdp.InterestFactor, + InterestFactor: cdp.InterestFactor.String(), CollateralValue: collateralValue, - CollateralizationRatio: collateralizationRatio, + CollateralizationRatio: collateralizationRatio.String(), } } diff --git a/x/cdp/types/query.pb.go b/x/cdp/types/query.pb.go index 81b6dab9fc..629653f372 100644 --- a/x/cdp/types/query.pb.go +++ b/x/cdp/types/query.pb.go @@ -7,7 +7,6 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" types "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -295,11 +294,12 @@ func (m *QueryCdpResponse) GetCdp() CDPResponse { // QueryCdpsRequest is the params for a filtered CDP query, the request type for the Query/Cdps RPC method. type QueryCdpsRequest struct { - CollateralType string `protobuf:"bytes,1,opt,name=collateral_type,json=collateralType,proto3" json:"collateral_type,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - ID uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` - Ratio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=ratio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ratio"` - Pagination *query.PageRequest `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty"` + CollateralType string `protobuf:"bytes,1,opt,name=collateral_type,json=collateralType,proto3" json:"collateral_type,omitempty"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + ID uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + // sdk.Dec as a string + Ratio string `protobuf:"bytes,4,opt,name=ratio,proto3" json:"ratio,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryCdpsRequest) Reset() { *m = QueryCdpsRequest{} } @@ -356,6 +356,13 @@ func (m *QueryCdpsRequest) GetID() uint64 { return 0 } +func (m *QueryCdpsRequest) GetRatio() string { + if m != nil { + return m.Ratio + } + return "" +} + func (m *QueryCdpsRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination @@ -696,16 +703,16 @@ func (m *QueryTotalCollateralResponse) GetTotalCollateral() TotalCollaterals { // CDPResponse defines the state of a single collateralized debt position. type CDPResponse struct { - ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Collateral types1.Coin `protobuf:"bytes,4,opt,name=collateral,proto3" json:"collateral"` - Principal types1.Coin `protobuf:"bytes,5,opt,name=principal,proto3" json:"principal"` - AccumulatedFees types1.Coin `protobuf:"bytes,6,opt,name=accumulated_fees,json=accumulatedFees,proto3" json:"accumulated_fees"` - FeesUpdated time.Time `protobuf:"bytes,7,opt,name=fees_updated,json=feesUpdated,proto3,stdtime" json:"fees_updated"` - InterestFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=interest_factor,json=interestFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_factor"` - CollateralValue types1.Coin `protobuf:"bytes,9,opt,name=collateral_value,json=collateralValue,proto3" json:"collateral_value"` - CollateralizationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=collateralization_ratio,json=collateralizationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateralization_ratio"` + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Collateral types1.Coin `protobuf:"bytes,4,opt,name=collateral,proto3" json:"collateral"` + Principal types1.Coin `protobuf:"bytes,5,opt,name=principal,proto3" json:"principal"` + AccumulatedFees types1.Coin `protobuf:"bytes,6,opt,name=accumulated_fees,json=accumulatedFees,proto3" json:"accumulated_fees"` + FeesUpdated time.Time `protobuf:"bytes,7,opt,name=fees_updated,json=feesUpdated,proto3,stdtime" json:"fees_updated"` + InterestFactor string `protobuf:"bytes,8,opt,name=interest_factor,json=interestFactor,proto3" json:"interest_factor,omitempty"` + CollateralValue types1.Coin `protobuf:"bytes,9,opt,name=collateral_value,json=collateralValue,proto3" json:"collateral_value"` + CollateralizationRatio string `protobuf:"bytes,10,opt,name=collateralization_ratio,json=collateralizationRatio,proto3" json:"collateralization_ratio,omitempty"` } func (m *CDPResponse) Reset() { *m = CDPResponse{} } @@ -790,6 +797,13 @@ func (m *CDPResponse) GetFeesUpdated() time.Time { return time.Time{} } +func (m *CDPResponse) GetInterestFactor() string { + if m != nil { + return m.InterestFactor + } + return "" +} + func (m *CDPResponse) GetCollateralValue() types1.Coin { if m != nil { return m.CollateralValue @@ -797,6 +811,13 @@ func (m *CDPResponse) GetCollateralValue() types1.Coin { return types1.Coin{} } +func (m *CDPResponse) GetCollateralizationRatio() string { + if m != nil { + return m.CollateralizationRatio + } + return "" +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "kava.cdp.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "kava.cdp.v1beta1.QueryParamsResponse") @@ -818,81 +839,79 @@ func init() { func init() { proto.RegisterFile("kava/cdp/v1beta1/query.proto", fileDescriptor_fd68799328aaf74a) } var fileDescriptor_fd68799328aaf74a = []byte{ - // 1183 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6f, 0x1b, 0xc5, - 0x1b, 0xf6, 0x3a, 0x76, 0xea, 0x4e, 0xaa, 0xd8, 0xbf, 0xf9, 0x99, 0x74, 0xbb, 0x04, 0xdb, 0xd9, - 0xd2, 0x24, 0x20, 0xb2, 0x4b, 0x83, 0x40, 0x7c, 0xaa, 0x8a, 0x63, 0x52, 0x15, 0x09, 0x29, 0x2c, - 0x01, 0x24, 0x24, 0x64, 0xc6, 0xbb, 0x13, 0x77, 0xa9, 0xbd, 0xb3, 0xdd, 0xd9, 0x4d, 0x09, 0x55, - 0x85, 0xe0, 0x50, 0x71, 0x42, 0x95, 0x38, 0x70, 0x40, 0x82, 0x5e, 0xb8, 0x70, 0xee, 0x1f, 0xd1, - 0x63, 0x55, 0x38, 0x20, 0x0e, 0x29, 0x4a, 0x38, 0xf0, 0x67, 0xa0, 0xf9, 0xd8, 0x0f, 0x7b, 0xe3, - 0x24, 0x95, 0xda, 0x4b, 0x62, 0xbf, 0x1f, 0xcf, 0xf3, 0xbc, 0xaf, 0xdf, 0x79, 0x67, 0xc0, 0xfc, - 0x35, 0xb4, 0x83, 0x4c, 0xdb, 0xf1, 0xcd, 0x9d, 0x8b, 0x3d, 0x1c, 0xa2, 0x8b, 0xe6, 0xf5, 0x08, - 0x07, 0xbb, 0x86, 0x1f, 0x90, 0x90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0x23, 0x63, 0x24, 0x77, 0x83, 0x73, 0xab, 0x70, 0xce, 0x3c, 0xec, 0xd1, 0x4f, 0xe1, - 0x6d, 0x05, 0x4c, 0xad, 0x3b, 0x3e, 0x5c, 0x98, 0x0c, 0x16, 0xf3, 0xe9, 0x47, 0x85, 0x48, 0xba, - 0xd7, 0x39, 0xdd, 0x2a, 0x7c, 0xf9, 0x70, 0x3a, 0xf3, 0x26, 0xdf, 0xba, 0xb7, 0xcc, 0x9b, 0x63, - 0x97, 0xcc, 0x2d, 0xf8, 0xb3, 0x02, 0x92, 0x9b, 0x77, 0xe2, 0xcc, 0x8e, 0x3d, 0x29, 0x26, 0xce, - 0xec, 0xf8, 0x4b, 0x40, 0x5f, 0xe3, 0xba, 0xde, 0x82, 0x6f, 0x4c, 0xd0, 0x15, 0xdf, 0xf4, 0x93, - 0x05, 0xb6, 0x2f, 0xdd, 0xdf, 0x6f, 0x28, 0x0f, 0xf6, 0x1b, 0xca, 0xdf, 0xfb, 0x0d, 0xe5, 0xce, - 0x41, 0xa3, 0xf0, 0xe0, 0xa0, 0x51, 0xf8, 0xf3, 0xa0, 0x51, 0xf8, 0xf4, 0x42, 0x66, 0x7d, 0x30, - 0xf8, 0x95, 0x01, 0xea, 0x51, 0x41, 0xf4, 0x25, 0xa7, 0xe2, 0x1b, 0xa4, 0x37, 0xcd, 0x97, 0xed, - 0x2b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x18, 0xd8, 0x30, 0xa9, 0xcf, 0x0d, 0x00, 0x00, + // 1138 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6f, 0xdb, 0x64, + 0x18, 0x8f, 0xd3, 0xb4, 0x4b, 0xdf, 0x4e, 0x4d, 0x78, 0x09, 0x9d, 0x6b, 0x4a, 0x92, 0x7a, 0x6c, + 0x2d, 0x88, 0xda, 0xac, 0x88, 0x6f,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xff, 0xe6, 0xbf, 0xb1, 0x04, 0x15, 0x0d, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1423,16 +1442,13 @@ func (m *QueryCdpsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - { - size := m.Ratio.Size() - i -= size - if _, err := m.Ratio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Ratio) > 0 { + i -= len(m.Ratio) + copy(dAtA[i:], m.Ratio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Ratio))) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 if m.ID != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ID)) i-- @@ -1732,16 +1748,13 @@ func (m *CDPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.CollateralizationRatio.Size() - i -= size - if _, err := m.CollateralizationRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.CollateralizationRatio) > 0 { + i -= len(m.CollateralizationRatio) + copy(dAtA[i:], m.CollateralizationRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CollateralizationRatio))) + i-- + dAtA[i] = 0x52 } - i-- - dAtA[i] = 0x52 { size, err := m.CollateralValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1752,16 +1765,13 @@ func (m *CDPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x4a - { - size := m.InterestFactor.Size() - i -= size - if _, err := m.InterestFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.InterestFactor) > 0 { + i -= len(m.InterestFactor) + copy(dAtA[i:], m.InterestFactor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.InterestFactor))) + i-- + dAtA[i] = 0x42 } - i-- - dAtA[i] = 0x42 n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FeesUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated):]) if err6 != nil { return 0, err6 @@ -1922,8 +1932,10 @@ func (m *QueryCdpsRequest) Size() (n int) { if m.ID != 0 { n += 1 + sovQuery(uint64(m.ID)) } - l = m.Ratio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Ratio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -2063,12 +2075,16 @@ func (m *CDPResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated) n += 1 + l + sovQuery(uint64(l)) - l = m.InterestFactor.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.InterestFactor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.CollateralValue.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.CollateralizationRatio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.CollateralizationRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2684,9 +2700,7 @@ func (m *QueryCdpsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Ratio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Ratio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -3669,9 +3683,7 @@ func (m *CDPResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InterestFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.InterestFactor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { @@ -3736,9 +3748,7 @@ func (m *CDPResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.CollateralizationRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.CollateralizationRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex