Skip to content

Commit 1bdd412

Browse files
committed
Merge branch 'master' into publish
2 parents c77d585 + a8bfc28 commit 1bdd412

File tree

24 files changed

+258
-84
lines changed

24 files changed

+258
-84
lines changed

.config/zepter.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Configuration for the Zepter CLI to ensure correct feature configuration in the Rust workspace.
2+
# <https://crates.io/crates/zepter>
3+
4+
version:
5+
# File format for parsing it:
6+
format: 1
7+
# Minimum version of the binary that is expected to work. This is just for printing a nice error
8+
# message when someone tries to use an older version.
9+
binary: 0.13.2
10+
11+
# The examples in this file assume crate `A` to have a dependency on crate `B`.
12+
workflows:
13+
# Check that everything is good without modifying anything:
14+
check:
15+
- [
16+
'lint',
17+
# Check that `A` activates the features of `B`.
18+
'propagate-feature',
19+
# These are the features to check:
20+
'--features=try-runtime,runtime-benchmarks,std',
21+
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
22+
'--left-side-feature-missing=ignore',
23+
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
24+
'--left-side-outside-workspace=ignore',
25+
# Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used.
26+
'--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking',
27+
# Show the paths of failed crates to have them clickable in the terminal: 
28+
'--show-path',
29+
# Aux
30+
'--offline',
31+
'--locked',
32+
'--quiet',
33+
]
34+
# Format the features into canonical format:
35+
- ['format', 'features', '--offline', '--locked', '--quiet']
36+
# Same as `check`, but actually fix the issues instead of just reporting them:
37+
default:
38+
- [ $check.0, '--fix' ]
39+
- [ $check.1, '--fix' ]
40+
41+
# Will be displayed when any workflow fails:
42+
help:
43+
text: |
44+
ORML uses the Zepter CLI to detect abnormalities in the feature configuration.
45+
It looks like at least one check failed; please see the console output. You can try to automatically address them by running `zepter`.
46+
Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you.
47+
links:
48+
- "https://github.com/open-web3-stack/open-runtime-module-library/pull/964"
49+
- "https://github.com/ggwpez/zepter"

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,9 @@ jobs:
3939
run: cargo clippy -- -D warnings
4040
- name: Check for Wasm
4141
run: make dev-check
42+
- name: Install Zepter
43+
run: cargo install zepter --version 0.14.0 --locked -q -f --no-default-features && zepter --version
44+
- name: Check Rust features
45+
run: make dev-features-check
4246
- name: Run tests
4347
run: make dev-test

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ dev-check-tests: Cargo.toml
4848
dev-test: Cargo.toml
4949
cargo test --all --features=runtime-benchmarks
5050

51+
# Check feature formatting and propagation.
52+
dev-features-check:
53+
zepter run check
54+
55+
# Try to automatically fix all features.
56+
dev-features-fix:
57+
zepter run default
58+
59+
# Check whether all features are formatted.
60+
dev-features-format-check:
61+
zepter format features
62+
63+
# Formats all features in all manifest files of the workspace.
64+
dev-features-format:
65+
zepter format features --fix
66+
5167
# run benchmarks via Acala node
5268
benchmark-all:
5369
cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_auction --extrinsic="*" --wasm-execution=compiled --heap-pages=4096 --output=./auction/src/weights.rs --template ../templates/orml-weight-template.hbs

asset-registry/Cargo.toml

+40-6
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,68 @@ orml-xcm-support = { path = "../xcm-support", default-features = false }
5757
orml-xtokens = { path = "../xtokens" }
5858

5959
[features]
60-
default = ["std"]
60+
default = [ "std" ]
6161
std = [
62-
"serde",
63-
64-
"parity-scale-codec/std",
62+
"cumulus-pallet-dmp-queue/std",
63+
"cumulus-pallet-parachain-system/std",
64+
"cumulus-pallet-xcm/std",
65+
"cumulus-pallet-xcmp-queue/std",
66+
"cumulus-primitives-core/std",
6567
"frame-support/std",
6668
"frame-system/std",
69+
"log/std",
6770
"orml-traits/std",
71+
"orml-xcm-support/std",
72+
"pallet-balances/std",
73+
"pallet-message-queue/std",
6874
"pallet-xcm/std",
75+
"parachain-info/std",
76+
"parity-scale-codec/std",
77+
"polkadot-parachain-primitives/std",
78+
"polkadot-runtime-common/std",
79+
"polkadot-runtime-parachains/std",
6980
"scale-info/std",
81+
"serde",
82+
"sp-core/std",
83+
"sp-io/std",
7084
"sp-runtime/std",
7185
"sp-std/std",
7286
"xcm-builder/std",
7387
"xcm-executor/std",
7488
"xcm/std",
7589
]
7690
runtime-benchmarks = [
91+
"cumulus-pallet-parachain-system/runtime-benchmarks",
92+
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
7793
"frame-support/runtime-benchmarks",
7894
"frame-system/runtime-benchmarks",
95+
"orml-tokens/runtime-benchmarks",
96+
"orml-xtokens/runtime-benchmarks",
97+
"pallet-balances/runtime-benchmarks",
98+
"pallet-message-queue/runtime-benchmarks",
7999
"pallet-xcm/runtime-benchmarks",
100+
"polkadot-parachain-primitives/runtime-benchmarks",
101+
"polkadot-runtime-common/runtime-benchmarks",
102+
"polkadot-runtime-parachains/runtime-benchmarks",
80103
"sp-runtime/runtime-benchmarks",
81104
"xcm-builder/runtime-benchmarks",
82105
"xcm-executor/runtime-benchmarks",
83-
"polkadot-runtime-parachains/runtime-benchmarks",
84-
"polkadot-runtime-common/runtime-benchmarks",
85106
]
86107
try-runtime = [
108+
"cumulus-pallet-dmp-queue/try-runtime",
109+
"cumulus-pallet-parachain-system/try-runtime",
110+
"cumulus-pallet-xcm/try-runtime",
111+
"cumulus-pallet-xcmp-queue/try-runtime",
87112
"frame-support/try-runtime",
88113
"frame-system/try-runtime",
114+
"orml-tokens/try-runtime",
115+
"orml-xcm/try-runtime",
116+
"orml-xtokens/try-runtime",
117+
"pallet-balances/try-runtime",
118+
"pallet-message-queue/try-runtime",
89119
"pallet-xcm/try-runtime",
120+
"parachain-info/try-runtime",
121+
"polkadot-runtime-common/try-runtime",
122+
"polkadot-runtime-parachains/try-runtime",
123+
"sp-runtime/try-runtime",
90124
]

auction/Cargo.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@ sp-core = { workspace = true, features = ["std"] }
2424
sp-io = { workspace = true, features = ["std"] }
2525

2626
[features]
27-
default = ["std"]
27+
default = [ "std" ]
2828
std = [
29-
"serde",
30-
31-
"parity-scale-codec/std",
3229
"frame-support/std",
3330
"frame-system/std",
3431
"orml-traits/std",
32+
"parity-scale-codec/std",
3533
"scale-info/std",
34+
"serde",
35+
"sp-core/std",
36+
"sp-io/std",
3637
"sp-runtime/std",
3738
"sp-std/std",
3839
]
3940
try-runtime = [
4041
"frame-support/try-runtime",
4142
"frame-system/try-runtime",
43+
"sp-runtime/try-runtime",
4244
]

authority/Cargo.toml

+12-4
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ pallet-root-testing = { workspace = true, features = ["std"] }
2626
sp-io = { workspace = true, features = ["std"] }
2727

2828
[features]
29-
default = ["std"]
29+
default = [ "std" ]
3030
std = [
31-
"serde",
32-
33-
"parity-scale-codec/std",
3431
"frame-support/std",
3532
"frame-system/std",
33+
"pallet-preimage/std",
34+
"pallet-root-testing/std",
35+
"pallet-scheduler/std",
36+
"parity-scale-codec/std",
3637
"scale-info/std",
38+
"serde",
3739
"sp-core/std",
3840
"sp-io/std",
3941
"sp-runtime/std",
@@ -42,9 +44,15 @@ std = [
4244
runtime-benchmarks = [
4345
"frame-support/runtime-benchmarks",
4446
"frame-system/runtime-benchmarks",
47+
"pallet-preimage/runtime-benchmarks",
48+
"pallet-scheduler/runtime-benchmarks",
4549
"sp-runtime/runtime-benchmarks",
4650
]
4751
try-runtime = [
4852
"frame-support/try-runtime",
4953
"frame-system/try-runtime",
54+
"pallet-preimage/try-runtime",
55+
"pallet-root-testing/try-runtime",
56+
"pallet-scheduler/try-runtime",
57+
"sp-runtime/try-runtime",
5058
]

benchmarking/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ frame-system = { workspace = true, features = ["std"] }
3131
[features]
3232
default = [ "std" ]
3333
std = [
34-
"serde",
35-
36-
"parity-scale-codec/std",
3734
"frame-benchmarking/std",
3835
"frame-support/std",
36+
"frame-system/std",
3937
"log/std",
38+
"parity-scale-codec/std",
4039
"scale-info/std",
40+
"serde",
4141
"sp-api/std",
4242
"sp-io/std",
4343
"sp-runtime-interface/std",

currencies/Cargo.toml

+8-4
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,25 @@ sp-core = { workspace = true, features = ["std"] }
2828
orml_tokens = { package = "orml-tokens", path = "../tokens" }
2929

3030
[features]
31-
default = ["std"]
31+
default = [ "std" ]
3232
std = [
33-
"serde",
34-
35-
"parity-scale-codec/std",
3633
"frame-support/std",
3734
"frame-system/std",
3835
"orml-traits/std",
3936
"orml-utilities/std",
37+
"pallet-balances/std",
38+
"parity-scale-codec/std",
4039
"scale-info/std",
40+
"serde",
41+
"sp-core/std",
4142
"sp-io/std",
4243
"sp-runtime/std",
4344
"sp-std/std",
4445
]
4546
try-runtime = [
4647
"frame-support/try-runtime",
4748
"frame-system/try-runtime",
49+
"orml_tokens/try-runtime",
50+
"pallet-balances/try-runtime",
51+
"sp-runtime/try-runtime",
4852
]

gradually-update/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ sp-runtime = { workspace = true }
2020
sp-std = { workspace = true }
2121

2222
[features]
23-
default = ["std"]
23+
default = [ "std" ]
2424
std = [
25-
"serde",
26-
27-
"parity-scale-codec/std",
2825
"frame-support/std",
2926
"frame-system/std",
27+
"parity-scale-codec/std",
3028
"scale-info/std",
29+
"serde",
3130
"sp-core/std",
3231
"sp-io/std",
3332
"sp-runtime/std",
@@ -36,4 +35,5 @@ std = [
3635
try-runtime = [
3736
"frame-support/try-runtime",
3837
"frame-system/try-runtime",
38+
"sp-runtime/try-runtime",
3939
]

nft/Cargo.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ sp-core = { workspace = true, features = ["std"] }
2222
sp-io = { workspace = true, features = ["std"] }
2323

2424
[features]
25-
default = ["std"]
25+
default = [ "std" ]
2626
std = [
27-
"serde",
28-
29-
"parity-scale-codec/std",
3027
"frame-support/std",
3128
"frame-system/std",
29+
"parity-scale-codec/std",
3230
"scale-info/std",
31+
"serde",
32+
"sp-core/std",
33+
"sp-io/std",
3334
"sp-runtime/std",
3435
"sp-std/std",
3536
]
3637
try-runtime = [
3738
"frame-support/try-runtime",
3839
"frame-system/try-runtime",
40+
"sp-runtime/try-runtime",
3941
]

oracle/Cargo.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,23 @@ orml-utilities = { path = "../utilities", version = "0.6.1", default-features =
2626
sp-core = { workspace = true }
2727

2828
[features]
29-
default = ["std"]
29+
default = [ "std" ]
3030
std = [
31-
"serde",
32-
33-
"parity-scale-codec/std",
3431
"frame-support/std",
3532
"frame-system/std",
3633
"orml-traits/std",
3734
"orml-utilities/std",
35+
"parity-scale-codec/std",
3836
"scale-info/std",
37+
"serde",
3938
"sp-application-crypto/std",
39+
"sp-core/std",
4040
"sp-io/std",
4141
"sp-runtime/std",
4242
"sp-std/std",
4343
]
4444
try-runtime = [
4545
"frame-support/try-runtime",
4646
"frame-system/try-runtime",
47+
"sp-runtime/try-runtime",
4748
]

oracle/runtime-api/Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ sp-api = { workspace = true }
1313
sp-std = { workspace = true }
1414

1515
[features]
16-
default = ["std"]
17-
std = [
18-
"parity-scale-codec/std",
19-
"sp-api/std",
20-
"sp-std/std"
21-
]
16+
default = [ "std" ]
17+
std = [ "parity-scale-codec/std", "sp-api/std", "sp-std/std" ]

parameters/Cargo.toml

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ sp-core = { workspace = true, features = ["std"] }
2525
sp-io = { workspace = true, features = ["std"] }
2626

2727
[features]
28-
default = ["std"]
28+
default = [ "std" ]
2929
std = [
30-
"serde",
31-
32-
"parity-scale-codec/std",
3330
"frame-support/std",
3431
"frame-system/std",
32+
"orml-traits/std",
33+
"parity-scale-codec/std",
3534
"scale-info/std",
35+
"serde",
36+
"sp-core/std",
37+
"sp-io/std",
3638
"sp-runtime/std",
3739
"sp-std/std",
38-
39-
"orml-traits/std",
4040
]
4141
runtime-benchmarks = [
4242
"frame-support/runtime-benchmarks",
@@ -46,4 +46,5 @@ runtime-benchmarks = [
4646
try-runtime = [
4747
"frame-support/try-runtime",
4848
"frame-system/try-runtime",
49+
"sp-runtime/try-runtime",
4950
]

0 commit comments

Comments
 (0)