Skip to content

Commit

Permalink
imp: enhance dependency management with workspace inheritance (cosmos…
Browse files Browse the repository at this point in the history
…#957)

* imp: use workspace dependencies

* chore: add unclog

* fix: clippy catches

* fix: cleanups b/c of merging main branch

* fix: add ibc-testkit as dev-dep to ibc

* nit: reorder ibc deps

* fix: apply suggestions from code review

Co-authored-by: Rano | Ranadeep <[email protected]>
Signed-off-by: Farhad Shabani <[email protected]>

* fix: use worksapce for dev-deps under ibc-testkit

---------

Signed-off-by: Farhad Shabani <[email protected]>
Co-authored-by: Rano | Ranadeep <[email protected]>
  • Loading branch information
Farhad-Shabani and rnbguy authored Nov 10, 2023
1 parent 046901f commit 318c284
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Bump minimum supported Rust version to 1.64
([\#956](https://github.com/cosmos/ibc-rs/issues/956))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Enhance dependency management with workspace inheritance
([\#955](https://github.com/cosmos/ibc-rs/issues/955))
53 changes: 50 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,62 @@
[workspace]

resolver = "2"

members = [
"crates/ibc",
"crates/ibc-derive",
"crates/ibc-testkit",
"crates/ibc-query",
]

exclude = [
"ci/cw-check",
"ci/no-std-check",
]

[workspace.package]
version = "0.47.0"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.64"
readme = "README.md"
repository = "https://github.com/cosmos/ibc-rs"
authors = ["Informal Systems <[email protected]>"]

[workspace.dependencies]
# external dependencies
borsh = {version = "0.10", default-features = false }
bytes = { version = "1.5.0", default-features = false }
displaydoc = { version = "0.2", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
env_logger = "0.10.0"
num-traits = { version = "0.2.17", default-features = false }
parking_lot = { version = "0.12.1", default-features = false }
primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] }
prost = { version = "0.12", default-features = false }
rstest = "0.18.2"
schemars = { version = "0.8.15"}
sha2 = { version = "0.10.8", default-features = false }
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", default-features = false }
serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
test-log = { version = "0.2.13", features = ["trace"] }
time = { version = ">=0.3.0, <0.3.31", default-features = false }
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] }
typed-builder = { version = "0.18.0"}

# ibc dependencies
ibc-derive = { version = "0.3.0", path = "../ibc-derive" }
ibc-proto = { version = "0.38.0", default-features = false }
ics23 = { version = "0.11", default-features = false }

# cosmos dependencies
tendermint = { version = "0.34.0", default-features = false }
tendermint-light-client = { version = "0.34.0", default-features = false }
tendermint-light-client-verifier = { version = "0.34.0", default-features = false }
tendermint-proto = { version = "0.34.0", default-features = false }
tendermint-rpc = { version = "0.34.0", default-features = false }
tendermint-testgen = { version = "0.34.0", default-features = false }

# parity dependencies
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"] }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[![Code Coverage][codecov-image]][codecov-link]
[![Apache 2.0 Licensed][license-image]][license-link]
![Rust Stable][rustc-image]
![Rust 1.60+][rustc-version]
![Rust 1.64+][rustc-version]
![Lines of Code][loc-image]

</div>
Expand Down
1 change: 1 addition & 0 deletions ci/no-std-check/Cargo.lock

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

27 changes: 15 additions & 12 deletions crates/ibc-query/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[package]
name = "ibc-query"
version = "0.47.0"
edition = "2021"
license = "Apache-2.0"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
readme = "README.md"
keywords = ["blockchain", "cosmos", "ibc", "rpc", "grpc"]
repository = "https://github.com/cosmos/ibc-rs"
authors = ["Informal Systems <[email protected]>"]
rust-version = "1.60"
description = """
'ibc-query' contains essential IBC query methods and
gRPC query service implementations for the IBC core.
"""

[features]
default = ["std"]
std = ["ibc-proto/std", "ibc/std"]

[dependencies]
ibc = { version = "0.47.0", path = "../ibc", default-features = false }
ibc-proto = { version = "0.38.0", default-features = false, features = ["server"] }
# external dependencies
displaydoc = { version = "0.2", default-features = false }
tonic = "0.10"

# ibc dependencies
ibc = { version = "0.47.0", path = "../ibc", default-features = false }
ibc-proto = { workspace = true, features = ["server"] }

[features]
default = ["std"]
std = ["ibc-proto/std", "ibc/std"]
61 changes: 33 additions & 28 deletions crates/ibc-testkit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
[package]
name = "ibc-testkit"
version = "0.47.0"
edition = "2021"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
readme = "README.md"
keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"]
repository = "https://github.com/cosmos/ibc-rs"
authors = ["Informal Systems <[email protected]>"]
rust-version = "1.60"
description = """
`ibc-testkit` is a versatile library that provides essential abstractions and implementations,
fulfilling a dual role of enabling rigorous integration testing for the `ibc-rs` implementation
while also aiding host chains in addressing a broad spectrum of testing scenarios during
their integration with `ibc-rs`.
"""

[dependencies]
# external dependencies
bytes = { workspace = true }
derive_more = { workspace = true }
displaydoc = { workspace = true }
parking_lot = { workspace = true }
primitive-types = { workspace = true }
prost = { workspace = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
subtle-encoding = { workspace = true }
tracing = { workspace = true }
typed-builder = { workspace = true }

# ibc dependencies
ibc = { version = "0.47.0" , path = "../ibc" } # NOTE: since `ibc-testkit` does not well support `no_std` yet, we keep `ibc` default features enabled

# cosmos dependencies
tendermint = { workspace = true }
tendermint-testgen = { workspace = true }

[dev-dependencies]
env_logger = { workspace = true }
rstest = { workspace = true }
tracing-subscriber = { workspace = true }
test-log = { workspace = true }

[features]
default = ["std"]
std = [
Expand All @@ -26,26 +54,3 @@ std = [

# This feature is required for token transfer (ICS-20)
serde = ["dep:serde", "ibc/serde", "serde_json"]

[dependencies]
bytes = { version = "1.2.1", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
displaydoc = { version = "0.2", default-features = false }
ibc = { version = "0.47.0" , path = "../ibc" } # NOTE: since `ibc-testkit` does not well support `no_std` yet, we keep `ibc` default features enabled
parking_lot = { version = "0.12.1", default-features = false }
prost = { version = "0.12", default-features = false }
serde = { version = "1.0", default-features = false, optional = true }
serde_json = { version = "1", default-features = false, optional = true }
subtle-encoding = { version = "0.5", default-features = false }
tendermint = { version = "0.34", default-features = false }
tendermint-testgen = { version = "0.34", default-features = false }
tracing = { version = "0.1.36", default-features = false }
typed-builder = "0.18.0"
primitive-types = { version = "0.12.0", default-features = false, features = ["serde_no_std"] }


[dev-dependencies]
env_logger = "0.10.0"
rstest = "0.18.1"
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
test-log = { version = "0.2.10", features = ["trace"] }
107 changes: 51 additions & 56 deletions crates/ibc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "ibc"
version = "0.47.0"
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"]
repository = "https://github.com/cosmos/ibc-rs"
authors = ["Informal Systems <[email protected]>"]
rust-version = "1.60"
readme = "README.md"
description = """
Implementation of the Inter-Blockchain Communication Protocol (IBC).
This crate comprises the main data structures and on-chain logic.
Expand All @@ -16,8 +16,50 @@ description = """
[package.metadata.docs.rs]
all-features = true

[dependencies]
# external dependencies
borsh = { workspace = true, optional = true }
bytes = { workspace = true }
derive_more = { workspace = true }
displaydoc = { workspace = true }
primitive-types = { workspace = true }
prost = { workspace = true }
serde_derive = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true}
subtle-encoding = { workspace = true, default-features = false }
sha2 = { workspace = true, default-features = false }
time = { workspace = true, default-features = false }
schemars = { workspace = true, optional = true }
typed-builder = { workspace = true, optional = true }
uint = { version = "0.9", default-features = false }

# ibc dependencies
ibc-derive = { version = "0.3.0", path = "../ibc-derive" }
ibc-proto = { workspace = true }
ics23 = { workspace = true, features = ["host-functions"] }

# cosmos dependencies
tendermint = { workspace = true }
tendermint-proto = { workspace = true }
tendermint-light-client-verifier = { workspace = true, features = ["rust-crypto"] }

## parity dependencies
parity-scale-codec = { workspace = true , optional = true }
scale-info = { workspace = true , optional = true }


[dev-dependencies]
ibc-testkit = { version = "0.47.0", path = "../ibc-testkit", default-features = false, features = ["serde"] }
env_logger = { workspace = true }
rstest = { workspace = true }
tracing-subscriber = { workspace = true }
test-log = { workspace = true }
tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] }

[features]
default = ["std"]

std = [
"ibc-proto/std",
"ics23/std",
Expand All @@ -33,60 +75,13 @@ std = [
"tendermint/clock",
"tendermint/std",
]

parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info", "ibc-proto/parity-scale-codec"]

borsh = ["dep:borsh", "ibc-proto/borsh"]

# This feature is required for token transfer (ICS-20)
serde = ["dep:serde", "dep:serde_derive", "serde_json", "ibc-proto/serde", "ics23/serde"]

# CosmWasm message API generator compatible, should not be inside on chain code
schema = ["dep:schemars", "ibc-proto/json-schema", "serde", "std"]

[dependencies]
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.38.0", default-features = false }
ics23 = { version = "0.11", default-features = false, features = ["host-functions"] }
time = { version = ">=0.3.0, <0.3.31", default-features = false }
serde_derive = { version = "1.0", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false, optional = true}
prost = { version = "0.12", default-features = false }
bytes = { version = "1.5.0", default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
sha2 = { version = "0.10.8", default-features = false }
displaydoc = { version = "0.2", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
uint = { version = "0.9", default-features = false }
primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] }

## for codec encode or decode
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"], optional = true }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"], optional = true }
## for borsh encode or decode
borsh = {version = "0.10", default-features = false, optional = true }
typed-builder = { version = "0.18.0", optional = true }

ibc-derive = { version = "0.3.0", path = "../ibc-derive" }

schemars = { version = "0.8.15", optional = true }

[dependencies.tendermint]
version = "0.34"
default-features = false

[dependencies.tendermint-proto]
version = "0.34"
default-features = false

[dependencies.tendermint-light-client-verifier]
version = "0.34"
default-features = false
features = ["rust-crypto"]

[dev-dependencies]
ibc-testkit = { version = "0.47.0", path = "../ibc-testkit", default-features = false, features = ["serde"] }
env_logger = "0.10.0"
rstest = "0.18.2"
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"]}
test-log = { version = "0.2.13", features = ["trace"] }
tendermint-rpc = { version = "0.34", features = ["http-client", "websocket-client"] }
9 changes: 2 additions & 7 deletions crates/ibc/src/core/ics04_channel/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,14 @@ impl From<Counterparty> for RawCounterparty {
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum Order {
None = 0isize,
#[default]
Unordered = 1isize,
Ordered = 2isize,
}

impl Default for Order {
fn default() -> Self {
Order::Unordered
}
}

impl Display for Order {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
write!(f, "{}", self.as_str())
Expand Down

0 comments on commit 318c284

Please sign in to comment.