Skip to content

Commit 1a56765

Browse files
committed
rust: inherit deps from the workspace to keep versions in sync
Specify the dep and its version only once. https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
1 parent 27103c8 commit 1a56765

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

src/rust/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ members = [
2525

2626
resolver = "2"
2727

28+
[workspace.dependencies]
29+
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"] }
30+
hex = { version = "0.4", default-features = false, features = ["alloc"] }
31+
lazy_static = { version = "1.4.0" }
32+
num-bigint = { version = "0.4.3", default-features = false }
33+
sha2 = { version = "0.10.8", default-features = false }
34+
sha3 = { version = "0.10.8", default-features = false }
35+
zeroize = "1.6.0"
36+
2837
[profile.release]
2938
# This only affects the .elf output. Debug info is stripped from the final .bin.
3039
# Paths to source code can still appear in the final bin, as they are part of the panic!() output.

src/rust/bitbox02-rust-c/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ bitbox02-rust = { path = "../bitbox02-rust", optional = true }
2828
bitbox02 = { path = "../bitbox02", optional = true }
2929
bitbox02-noise = { path = "../bitbox02-noise", optional = true }
3030
util = { path = "../util" }
31-
hex = { version = "0.4", default-features = false }
32-
sha2 = { version = "0.10.8", default-features = false, optional = true }
33-
sha3 = { version = "0.10.8", default-features = false, optional = true }
34-
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"], optional = true }
31+
hex = { workspace = true }
32+
sha2 = { workspace = true, optional = true }
33+
sha3 = { workspace = true, optional = true }
34+
bitcoin = { workspace = true, optional = true }
3535

3636
[features]
3737
# Only one of the "target-" should be activated, which in turn defines/activates the dependent features.

src/rust/bitbox02-rust/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ bitbox02 = {path = "../bitbox02"}
3131
util = {path = "../util"}
3232
binascii = { version = "0.1.4", default-features = false, features = ["encode"] }
3333
bitbox02-noise = {path = "../bitbox02-noise"}
34-
hex = { version = "0.4", default-features = false, features = ["alloc"] }
35-
sha2 = { version = "0.10.8", default-features = false }
36-
sha3 = { version = "0.10.8", default-features = false, optional = true }
34+
hex = { workspace = true }
35+
sha2 = { workspace = true }
36+
sha3 = { workspace = true, optional = true }
3737
digest = "0.10.6"
38-
zeroize = "1.6.0"
39-
num-bigint = { version = "0.4.3", default-features = false, optional = true }
38+
zeroize = { workspace = true }
39+
num-bigint = { workspace = true, optional = true }
4040
num-traits = { version = "0.2", default-features = false, optional = true }
4141
# If you change this, also change src/rust/.cargo/config.toml.
4242
bip32-ed25519 = { git = "https://github.com/digitalbitbox/rust-bip32-ed25519", tag = "v0.1.2", optional = true }
@@ -45,11 +45,11 @@ blake2 = { version = "0.10.6", default-features = false, optional = true }
4545
minicbor = { version = "0.20.0", default-features = false, features = ["alloc"], optional = true }
4646
crc = { version = "3.0.1", optional = true }
4747
ed25519-dalek = { version = "2.0.0", default-features = false, features = ["hazmat"], optional = true }
48-
lazy_static = { version = "1.4.0", optional = true }
48+
lazy_static = { workspace = true, optional = true }
4949
hmac = { version = "0.12.1", default-features = false, features = ["reset"] }
5050

5151
miniscript = { version = "11.0.0", default-features = false, features = ["no-std"], optional = true }
52-
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"], optional = true }
52+
bitcoin = { workspace = true, optional = true }
5353
# We don't rely on this dep directly, the miniscript/bitcoin deps do. We list it here to enable the
5454
# small-hash feature to reduce the binary size, saving around 2784 bytes (as measured at time of
5555
# writing, this might fluctuate over time).

src/rust/bitbox02/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ license = "Apache-2.0"
2424
[dependencies]
2525
bitbox02-sys = {path="../bitbox02-sys"}
2626
util = {path = "../util"}
27-
zeroize = "1.6.0"
28-
lazy_static = { version = "1.4.0", optional = true }
27+
zeroize = { workspace = true }
28+
lazy_static = { workspace = true, optional = true }
2929

3030
[features]
3131
# Only to be enabled in unit tests.

src/rust/util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ edition = "2021"
2121
license = "Apache-2.0"
2222

2323
[dependencies]
24-
num-bigint = { version = "0.4.3", default-features = false }
24+
num-bigint = { workspace = true, default-features = false }

0 commit comments

Comments
 (0)