chore(proto): deprecated IntProto and DecProto (#16980)
This commit is contained in:
parent
77562a60dd
commit
914e4e5136
@ -49,6 +49,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (cli) [#16856](https://github.com/cosmos/cosmos-sdk/pull/16856) Improve `simd prune` UX by using the app default home directory and set pruning method as first variable argument (defaults to default).
|
||||
* (x/authz) [#16869](https://github.com/cosmos/cosmos-sdk/pull/16869) Improve error message when grant not found.
|
||||
|
||||
### Deprecated
|
||||
|
||||
* (types) [#16980](https://github.com/cosmos/cosmos-sdk/pull/16980) Deprecate `IntProto` and `DecProto`. Instead, `math.Int` and `math.LegacyDec` should be used respectively. Both types support `Marshal` and `Unmarshal` for binary serialization.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* (x/bank) [#16841](https://github.com/cosmos/cosmos-sdk/pull/16841) Correctly process legacy `DenomAddressIndex` values.
|
||||
@ -61,7 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (types/math) [#16040](https://github.com/cosmos/cosmos-sdk/pull/16798) Remove aliases in `types/math.go` (part 2).
|
||||
* (x/staking) [#16795](https://github.com/cosmos/cosmos-sdk/pull/16795) `DelegationToDelegationResponse`, `DelegationsToDelegationResponses`, `RedelegationsToRedelegationResponses` are no longer exported.
|
||||
|
||||
## CLI Breaking Changes
|
||||
### CLI Breaking Changes
|
||||
|
||||
* (x/bank) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) With the migration to AutoCLI some bank commands have been split in two:
|
||||
* Use `denoms-metadata` for querying all denom metadata and `denom-metadata` for querying a specific denom metadata.
|
||||
|
||||
@ -1931,6 +1931,7 @@ func (x *DecCoin) GetAmount() string {
|
||||
}
|
||||
|
||||
// IntProto defines a Protobuf wrapper around an Int object.
|
||||
// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
type IntProto struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -1967,6 +1968,7 @@ func (x *IntProto) GetInt() string {
|
||||
}
|
||||
|
||||
// DecProto defines a Protobuf wrapper around a Dec object.
|
||||
// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
type DecProto struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
||||
@ -33,16 +33,29 @@ message DecCoin {
|
||||
option (gogoproto.equal) = true;
|
||||
|
||||
string denom = 1;
|
||||
string amount = 2
|
||||
[(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false];
|
||||
string amount = 2 [
|
||||
(cosmos_proto.scalar) = "cosmos.Dec",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// IntProto defines a Protobuf wrapper around an Int object.
|
||||
// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
message IntProto {
|
||||
string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false];
|
||||
string int = 1 [
|
||||
(cosmos_proto.scalar) = "cosmos.Int",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.Int",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// DecProto defines a Protobuf wrapper around a Dec object.
|
||||
// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
message DecProto {
|
||||
string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false];
|
||||
string dec = 1 [
|
||||
(cosmos_proto.scalar) = "cosmos.Dec",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
@ -123,6 +123,7 @@ func (m *DecCoin) GetDenom() string {
|
||||
}
|
||||
|
||||
// IntProto defines a Protobuf wrapper around an Int object.
|
||||
// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
type IntProto struct {
|
||||
Int cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=cosmossdk.io/math.Int" json:"int"`
|
||||
}
|
||||
@ -160,6 +161,7 @@ func (m *IntProto) XXX_DiscardUnknown() {
|
||||
var xxx_messageInfo_IntProto proto.InternalMessageInfo
|
||||
|
||||
// DecProto defines a Protobuf wrapper around a Dec object.
|
||||
// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
type DecProto struct {
|
||||
Dec cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"dec"`
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@ deps:
|
||||
- remote: buf.build
|
||||
owner: cosmos
|
||||
repository: cosmos-sdk
|
||||
commit: af6851b183cb49b8aefe32b93d7f8a7f
|
||||
digest: shake256:3bec7abf765271dce9b6ec8a6750c399568f600e5d54b0ee6a0c3adc6c28a75cd9a9aab8c81fd28b20d1f8edb41ea0251e38e358bb3753aa33b76bb50d9dfa6d
|
||||
commit: a0f17dcd1d6b4a03ab50d377b36da149
|
||||
digest: shake256:fc36c3c09df4a908270170125aeb559af8424df3efa1179f09b51738b0e95df5c5f31f590e2a6ab8c31af497a0e15056efeddde7ba1e3297383d01badc68d3b3
|
||||
- remote: buf.build
|
||||
owner: cosmos
|
||||
repository: gogo-proto
|
||||
|
||||
Loading…
Reference in New Issue
Block a user