Skip to content

Commit

Permalink
chore(proto): deprecated IntProto and DecProto (#16980)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba authored Jul 13, 2023
1 parent 77562a6 commit 914e4e5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions api/cosmos/base/v1beta1/coin.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions proto/cosmos/base/v1beta1/coin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
}
2 changes: 2 additions & 0 deletions types/coin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/tx/signing/aminojson/internal/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 914e4e5

Please sign in to comment.