Skip to content

Commit

Permalink
Refactor: Use workspace dependencies (#1725)
Browse files Browse the repository at this point in the history
* fix: better workspace usage

* compiling with cargo check

* clean all Cargo.toml files

* taplo fmt and minor fix

* fix benchmarking issue

---------

Co-authored-by: William Freudenberger <[email protected]>
  • Loading branch information
lemunozm and wischli authored Feb 12, 2024
1 parent e8330d5 commit f4f4bcc
Show file tree
Hide file tree
Showing 40 changed files with 1,125 additions and 1,119 deletions.
30 changes: 5 additions & 25 deletions Cargo.lock

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

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ documentation = "https://reference.centrifuge.io/centrifuge_chain/index.html"

[workspace.dependencies]
hex-literal = { version = "0.3.4" }
hex = { version = "0.4.3", default_features = false }
hex = { version = "0.4.3", default-features = false }
smallvec = "1.6.1"
serde = { version = "1.0.119", features = ["derive"] }
parity-scale-codec = { version = "3.0", default-features = false, features = ["derive"] }
Expand All @@ -79,6 +79,11 @@ jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
url = "2.2.2"
tempfile = "3.1.0"
strum = { version = "0.24", default-features = false, features = ["derive"] }
bitflags = { version = "1.3" }
rand = { version = "0.8.5", default-features = false }
rev_slice = { version = "0.1.5", default-features = false }
impl-trait-for-tuples = "0.2.1"
num-traits = { version = "0.2", default-features = false }

# Cumulus
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" }
Expand Down Expand Up @@ -161,6 +166,8 @@ sp-blockchain = { git = "https://github.com/paritytech/substrate", default-featu
sp-consensus = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-keystore = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-keyring = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, features = [
Expand Down Expand Up @@ -236,6 +243,7 @@ fp-storage = { git = "https://github.com/moonbeam-foundation/frontier", default-
moonbeam-relay-encoder = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" }
xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" }
pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" }
precompile-utils = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" }

# Centrifuge organization
fudge = { git = "https://github.com/centrifuge/fudge", branch = "polkadot-v0.9.43" }
Expand Down Expand Up @@ -286,6 +294,8 @@ cfg-traits = { path = "libs/traits", default-features = false }
cfg-types = { path = "libs/types", default-features = false }
cfg-utils = { path = "libs/utils", default-features = false }
cfg-mocks = { path = "libs/mocks", default-features = false }
cfg-test-utils = { path = "libs/test-utils", default-features = false }
proofs = { path = "libs/proofs", default-features = false }

# Centrifuge runtimes
runtime-common = { path = "runtime/common", default-features = false }
Expand Down
37 changes: 20 additions & 17 deletions libs/mocks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
[package]
authors = ["Centrifuge <[email protected]>"]
description = "Generic mocks built with mock-builder for traits"
edition = "2021"
license = "LGPL-3.0"
name = "cfg-mocks"
repository = "https://github.com/centrifuge/centrifuge-chain"
description = "Generic mocks built with mock-builder for traits"
version = "0.0.1"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { default-features = false, version = "3.0.0", features = ["derive"] }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

cfg-primitives = { workspace = true }
cfg-traits = { workspace = true }
cfg-types = { workspace = true }

cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
cfg-types = { path = "../types", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" }
orml-traits = { workspace = true }
xcm = { workspace = true }

mock-builder = { workspace = true }
Expand Down
56 changes: 29 additions & 27 deletions libs/primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
[package]
authors = ["Centrifuge <[email protected]>"]
description = "Primitive types for Centrifuge"
edition = "2021"
license = "LGPL-3.0"
name = "cfg-primitives"
repository = "https://github.com/centrifuge/centrifuge-chain"
description = "Primitive types for Centrifuge"
version = "2.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.119" }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { workspace = true }

# substrate primitives dependencies
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-arithmetic = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# substrate frame dependencies
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-collective = { workspace = true }

# cumulus primitives dependencies
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" }
cumulus-primitives-core = { workspace = true }

# XCM primitives dependencies
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
xcm = { workspace = true }
xcm-executor = { workspace = true }

[features]
default = ["std"]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
std = [
"parity-scale-codec/std",
"cumulus-primitives-core/std",
Expand All @@ -61,6 +56,13 @@ std = [
"xcm-executor/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
Expand Down
20 changes: 11 additions & 9 deletions libs/proofs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[package]
authors = ["Centrifuge <[email protected]>"]
description = "Proofs"
edition = "2021"
license = "LGPL-3.0"
name = "proofs"
repository = "https://github.com/centrifuge/centrifuge-chain"
description = "Proofs"
version = "2.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" }
sp-core = { workspace = true, default-features = true }

[features]
default = ["std"]
Expand Down
34 changes: 18 additions & 16 deletions libs/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
[package]
name = "cfg-test-utils"
description = "Utilities for testing"
version = "0.1.0"
edition = "2021"
authors = ["Centrifuge"]
homepage = "https://centrifuge.io"
license = "LGPL-3.0"
repository = "https://github.com/centrifuge/centrifuge-chain"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
cfg-primitives = { path = "../primitives", default-features = false }
cfg-traits = { path = "../traits", default-features = false }
cfg-types = { path = "../types", default-features = false }
cfg-primitives = { workspace = true }
cfg-traits = { workspace = true }
cfg-types = { workspace = true }

parity-scale-codec = { version = "3.0.0", features = ["derive"], default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.119", default-features = false }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
serde = { workspace = true }

frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# Optional dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" }
frame-benchmarking = { workspace = true, optional = true }

[features]
default = ["std"]
Expand Down
Loading

0 comments on commit f4f4bcc

Please sign in to comment.