Skip to content

Commit 864b821

Browse files
feat: enable no_std support for pbjson (#158)
Closes: #156 Addresses the `no_std` compatibility issue with `serde` feature in `ibc-rs`. This is caused by the recent implementation of ProtoJSON serialization and deserialization [0] for the `ics23` Protobuf definitions using `pbjson`, and then re-exporting the ics23 type [1] in `ibc-proto-rs`. Some of our users by then (starting from IBC-rs v0.41.0) are experiencing compilation errors. [2] To meet this immediate need [3] and the lack of activity in the `pbjson` crate for months, we have taken the initiative to feature `no_std` support in the `informalsystems-pbjson` crate and have it published. [0] #146 [1] cosmos/ibc-proto-rs#92 [2] informalsystems/ibc-rs#741 [3] cosmos/ibc-proto-rs#98 (comment) --- * feat: enable no_std support for pbjson * fix: get serde feature work with no-std * deps: use informalsystems-pbjson v0.6.0 * deps: use informalsystems-pbjson v0.6.0
1 parent daa1760 commit 864b821

File tree

3 files changed

+128
-128
lines changed

3 files changed

+128
-128
lines changed

rust/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ripemd = {version = "0.1.1", optional = true, default-features = false}
2222
sha2 = {version = "0.10.2", optional = true, default-features = false}
2323
sha3 = {version = "0.10.2", optional = true, default-features = false}
2424
serde = {version = "1.0", optional = true, default-features = false}
25-
pbjson = {version = "0.5.1", optional = true}
25+
informalsystems-pbjson = { version = "0.6.0", optional = true, default-features = false }
2626

2727
[dev-dependencies]
2828
ripemd = {version = "0.1.1"}
@@ -32,10 +32,10 @@ sha2 = {version = "0.10.2"}
3232
sha3 = {version = "0.10.2"}
3333

3434
[features]
35-
default = ["std", "host-functions", "serde"]
35+
default = ["std", "host-functions"]
3636

37-
std = ["prost/std", "bytes/std", "hex/std", "anyhow/std"]
37+
std = ["prost/std", "bytes/std", "hex/std", "anyhow/std", "informalsystems-pbjson/std", "serde/std"]
3838

3939
host-functions = ["sha2", "sha3", "ripemd"]
4040

41-
serde = ["serde/std", "dep:pbjson"]
41+
serde = ["dep:serde", "informalsystems-pbjson"]

rust/codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ edition = "2018"
1010
bytes = "1.0.1"
1111
prost = "0.11"
1212
prost-build = "0.11"
13-
pbjson-build = "0.5.1"
13+
informalsystems-pbjson-build = "0.6.0"

0 commit comments

Comments
 (0)