Skip to content
Snippets Groups Projects
Commit 2614f1b4 authored by Éloïs's avatar Éloïs
Browse files

feat(xtask): setup xtask and create calls doc generator

parent 8d6d1f7f
No related branches found
No related tags found
No related merge requests found
[alias] [alias]
cucumber = "test -p duniter-end2end-tests --test cucumber_tests --" cucumber = "test -p duniter-end2end-tests --test cucumber_tests --"
tu = "test --workspace --exclude duniter-end2end-tests" tu = "test --workspace --exclude duniter-end2end-tests"
xtask = "run --package xtask --"
...@@ -353,9 +353,9 @@ dependencies = [ ...@@ -353,9 +353,9 @@ dependencies = [
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.0.1" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]] [[package]]
name = "backtrace" name = "backtrace"
...@@ -1500,7 +1500,7 @@ dependencies = [ ...@@ -1500,7 +1500,7 @@ dependencies = [
"log", "log",
"num-traits", "num-traits",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"scale-info", "scale-info",
] ]
...@@ -1784,6 +1784,10 @@ name = "fsio" ...@@ -1784,6 +1784,10 @@ name = "fsio"
version = "0.1.3" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3" checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3"
dependencies = [
"rand 0.7.3",
"users",
]
[[package]] [[package]]
name = "fuchsia-zircon" name = "fuchsia-zircon"
...@@ -2811,7 +2815,7 @@ dependencies = [ ...@@ -2811,7 +2815,7 @@ dependencies = [
"jsonrpc-server-utils", "jsonrpc-server-utils",
"log", "log",
"net2", "net2",
"parking_lot", "parking_lot 0.11.2",
"unicase", "unicase",
] ]
...@@ -2826,7 +2830,7 @@ dependencies = [ ...@@ -2826,7 +2830,7 @@ dependencies = [
"jsonrpc-server-utils", "jsonrpc-server-utils",
"log", "log",
"parity-tokio-ipc", "parity-tokio-ipc",
"parking_lot", "parking_lot 0.11.2",
"tower-service", "tower-service",
] ]
...@@ -2840,7 +2844,7 @@ dependencies = [ ...@@ -2840,7 +2844,7 @@ dependencies = [
"jsonrpc-core", "jsonrpc-core",
"lazy_static", "lazy_static",
"log", "log",
"parking_lot", "parking_lot 0.11.2",
"rand 0.7.3", "rand 0.7.3",
"serde", "serde",
] ]
...@@ -2874,7 +2878,7 @@ dependencies = [ ...@@ -2874,7 +2878,7 @@ dependencies = [
"jsonrpc-server-utils", "jsonrpc-server-utils",
"log", "log",
"parity-ws", "parity-ws",
"parking_lot", "parking_lot 0.11.2",
"slab", "slab",
] ]
...@@ -3028,7 +3032,7 @@ checksum = "c3b6b85fc643f5acd0bffb2cc8a6d150209379267af0d41db72170021841f9f5" ...@@ -3028,7 +3032,7 @@ checksum = "c3b6b85fc643f5acd0bffb2cc8a6d150209379267af0d41db72170021841f9f5"
dependencies = [ dependencies = [
"kvdb", "kvdb",
"parity-util-mem", "parity-util-mem",
"parking_lot", "parking_lot 0.11.2",
] ]
[[package]] [[package]]
...@@ -3043,7 +3047,7 @@ dependencies = [ ...@@ -3043,7 +3047,7 @@ dependencies = [
"num_cpus", "num_cpus",
"owning_ref", "owning_ref",
"parity-util-mem", "parity-util-mem",
"parking_lot", "parking_lot 0.11.2",
"regex", "regex",
"rocksdb", "rocksdb",
"smallvec", "smallvec",
...@@ -3128,7 +3132,7 @@ dependencies = [ ...@@ -3128,7 +3132,7 @@ dependencies = [
"libp2p-websocket", "libp2p-websocket",
"libp2p-yamux", "libp2p-yamux",
"multiaddr", "multiaddr",
"parking_lot", "parking_lot 0.11.2",
"pin-project", "pin-project",
"smallvec", "smallvec",
"wasm-timer", "wasm-timer",
...@@ -3153,7 +3157,7 @@ dependencies = [ ...@@ -3153,7 +3157,7 @@ dependencies = [
"multiaddr", "multiaddr",
"multihash 0.14.0", "multihash 0.14.0",
"multistream-select", "multistream-select",
"parking_lot", "parking_lot 0.11.2",
"pin-project", "pin-project",
"prost", "prost",
"prost-build", "prost-build",
...@@ -3327,7 +3331,7 @@ dependencies = [ ...@@ -3327,7 +3331,7 @@ dependencies = [
"libp2p-core", "libp2p-core",
"log", "log",
"nohash-hasher", "nohash-hasher",
"parking_lot", "parking_lot 0.11.2",
"rand 0.7.3", "rand 0.7.3",
"smallvec", "smallvec",
"unsigned-varint 0.7.0", "unsigned-varint 0.7.0",
...@@ -3560,7 +3564,7 @@ checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" ...@@ -3560,7 +3564,7 @@ checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af"
dependencies = [ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"libp2p-core", "libp2p-core",
"parking_lot", "parking_lot 0.11.2",
"thiserror", "thiserror",
"yamux", "yamux",
] ]
...@@ -3663,10 +3667,11 @@ dependencies = [ ...@@ -3663,10 +3667,11 @@ dependencies = [
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.5" version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53"
dependencies = [ dependencies = [
"autocfg",
"scopeguard", "scopeguard",
] ]
...@@ -4222,11 +4227,11 @@ dependencies = [ ...@@ -4222,11 +4227,11 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.8.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
dependencies = [ dependencies = [
"parking_lot", "parking_lot 0.12.0",
] ]
[[package]] [[package]]
...@@ -4820,7 +4825,7 @@ dependencies = [ ...@@ -4820,7 +4825,7 @@ dependencies = [
"log", "log",
"lz4", "lz4",
"memmap2 0.2.3", "memmap2 0.2.3",
"parking_lot", "parking_lot 0.11.2",
"rand 0.8.4", "rand 0.8.4",
"snap", "snap",
] ]
...@@ -4881,7 +4886,7 @@ dependencies = [ ...@@ -4881,7 +4886,7 @@ dependencies = [
"hashbrown", "hashbrown",
"impl-trait-for-tuples", "impl-trait-for-tuples",
"parity-util-mem-derive", "parity-util-mem-derive",
"parking_lot", "parking_lot 0.11.2",
"primitive-types", "primitive-types",
"smallvec", "smallvec",
"winapi 0.3.9", "winapi 0.3.9",
...@@ -4945,7 +4950,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" ...@@ -4945,7 +4950,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [ dependencies = [
"instant", "instant",
"lock_api", "lock_api",
"parking_lot_core", "parking_lot_core 0.8.5",
]
[[package]]
name = "parking_lot"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
dependencies = [
"lock_api",
"parking_lot_core 0.9.3",
] ]
[[package]] [[package]]
...@@ -4962,6 +4977,19 @@ dependencies = [ ...@@ -4962,6 +4977,19 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "parking_lot_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [
"cfg-if 1.0.0",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
]
[[package]] [[package]]
name = "paste" name = "paste"
version = "1.0.5" version = "1.0.5"
...@@ -5260,7 +5288,7 @@ dependencies = [ ...@@ -5260,7 +5288,7 @@ dependencies = [
"fnv", "fnv",
"lazy_static", "lazy_static",
"memchr", "memchr",
"parking_lot", "parking_lot 0.11.2",
"thiserror", "thiserror",
] ]
...@@ -5593,6 +5621,15 @@ dependencies = [ ...@@ -5593,6 +5621,15 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "run_script"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70f5efb6762d8cafcab5b2a5545dad239d896989b15304e7d1a03cc6cf1aa626"
dependencies = [
"fsio",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.20" version = "0.1.20"
...@@ -5865,7 +5902,7 @@ dependencies = [ ...@@ -5865,7 +5902,7 @@ dependencies = [
"hash-db", "hash-db",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sc-executor", "sc-executor",
"sc-transaction-pool-api", "sc-transaction-pool-api",
"sc-utils", "sc-utils",
...@@ -5896,7 +5933,7 @@ dependencies = [ ...@@ -5896,7 +5933,7 @@ dependencies = [
"log", "log",
"parity-db", "parity-db",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sc-client-api", "sc-client-api",
"sc-state-db", "sc-state-db",
"sp-arithmetic", "sp-arithmetic",
...@@ -5918,7 +5955,7 @@ dependencies = [ ...@@ -5918,7 +5955,7 @@ dependencies = [
"futures-timer", "futures-timer",
"libp2p", "libp2p",
"log", "log",
"parking_lot", "parking_lot 0.11.2",
"sc-client-api", "sc-client-api",
"sc-utils", "sc-utils",
"serde", "serde",
...@@ -5975,7 +6012,7 @@ dependencies = [ ...@@ -5975,7 +6012,7 @@ dependencies = [
"num-rational 0.2.4", "num-rational 0.2.4",
"num-traits", "num-traits",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"rand 0.7.3", "rand 0.7.3",
"retain_mut", "retain_mut",
"sc-client-api", "sc-client-api",
...@@ -6099,7 +6136,7 @@ dependencies = [ ...@@ -6099,7 +6136,7 @@ dependencies = [
"log", "log",
"lru 0.6.6", "lru 0.6.6",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sc-executor-common", "sc-executor-common",
"sc-executor-wasmi", "sc-executor-wasmi",
"sp-api", "sp-api",
...@@ -6162,7 +6199,7 @@ dependencies = [ ...@@ -6162,7 +6199,7 @@ dependencies = [
"futures-timer", "futures-timer",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"rand 0.8.4", "rand 0.8.4",
"sc-block-builder", "sc-block-builder",
"sc-chain-spec", "sc-chain-spec",
...@@ -6211,7 +6248,7 @@ source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly- ...@@ -6211,7 +6248,7 @@ source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-
dependencies = [ dependencies = [
"async-trait", "async-trait",
"hex", "hex",
"parking_lot", "parking_lot 0.11.2",
"serde_json", "serde_json",
"sp-application-crypto", "sp-application-crypto",
"sp-core", "sp-core",
...@@ -6243,7 +6280,7 @@ dependencies = [ ...@@ -6243,7 +6280,7 @@ dependencies = [
"log", "log",
"lru 0.7.2", "lru 0.7.2",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"pin-project", "pin-project",
"prost", "prost",
"prost-build", "prost-build",
...@@ -6300,7 +6337,7 @@ dependencies = [ ...@@ -6300,7 +6337,7 @@ dependencies = [
"num_cpus", "num_cpus",
"once_cell", "once_cell",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"rand 0.7.3", "rand 0.7.3",
"sc-client-api", "sc-client-api",
"sc-network", "sc-network",
...@@ -6346,7 +6383,7 @@ dependencies = [ ...@@ -6346,7 +6383,7 @@ dependencies = [
"jsonrpc-pubsub", "jsonrpc-pubsub",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sc-block-builder", "sc-block-builder",
"sc-chain-spec", "sc-chain-spec",
"sc-client-api", "sc-client-api",
...@@ -6378,7 +6415,7 @@ dependencies = [ ...@@ -6378,7 +6415,7 @@ dependencies = [
"jsonrpc-pubsub", "jsonrpc-pubsub",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sc-chain-spec", "sc-chain-spec",
"sc-transaction-pool-api", "sc-transaction-pool-api",
"serde", "serde",
...@@ -6424,7 +6461,7 @@ dependencies = [ ...@@ -6424,7 +6461,7 @@ dependencies = [
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parity-util-mem", "parity-util-mem",
"parking_lot", "parking_lot 0.11.2",
"pin-project", "pin-project",
"rand 0.7.3", "rand 0.7.3",
"sc-block-builder", "sc-block-builder",
...@@ -6481,7 +6518,7 @@ dependencies = [ ...@@ -6481,7 +6518,7 @@ dependencies = [
"parity-scale-codec", "parity-scale-codec",
"parity-util-mem", "parity-util-mem",
"parity-util-mem-derive", "parity-util-mem-derive",
"parking_lot", "parking_lot 0.11.2",
"sc-client-api", "sc-client-api",
"sp-core", "sp-core",
] ]
...@@ -6495,7 +6532,7 @@ dependencies = [ ...@@ -6495,7 +6532,7 @@ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"libp2p", "libp2p",
"log", "log",
"parking_lot", "parking_lot 0.11.2",
"pin-project", "pin-project",
"rand 0.7.3", "rand 0.7.3",
"serde", "serde",
...@@ -6516,7 +6553,7 @@ dependencies = [ ...@@ -6516,7 +6553,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"once_cell", "once_cell",
"parking_lot", "parking_lot 0.11.2",
"regex", "regex",
"rustc-hash", "rustc-hash",
"sc-client-api", "sc-client-api",
...@@ -6557,7 +6594,7 @@ dependencies = [ ...@@ -6557,7 +6594,7 @@ dependencies = [
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parity-util-mem", "parity-util-mem",
"parking_lot", "parking_lot 0.11.2",
"retain_mut", "retain_mut",
"sc-client-api", "sc-client-api",
"sc-transaction-pool-api", "sc-transaction-pool-api",
...@@ -6594,7 +6631,7 @@ dependencies = [ ...@@ -6594,7 +6631,7 @@ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"futures-timer", "futures-timer",
"lazy_static", "lazy_static",
"parking_lot", "parking_lot 0.11.2",
"prometheus", "prometheus",
] ]
...@@ -7102,7 +7139,7 @@ dependencies = [ ...@@ -7102,7 +7139,7 @@ dependencies = [
"log", "log",
"lru 0.7.2", "lru 0.7.2",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sp-api", "sp-api",
"sp-consensus", "sp-consensus",
"sp-database", "sp-database",
...@@ -7218,7 +7255,7 @@ dependencies = [ ...@@ -7218,7 +7255,7 @@ dependencies = [
"num-traits", "num-traits",
"parity-scale-codec", "parity-scale-codec",
"parity-util-mem", "parity-util-mem",
"parking_lot", "parking_lot 0.11.2",
"primitive-types", "primitive-types",
"rand 0.7.3", "rand 0.7.3",
"regex", "regex",
...@@ -7273,7 +7310,7 @@ version = "4.0.0-dev" ...@@ -7273,7 +7310,7 @@ version = "4.0.0-dev"
source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-2022-02#8fbc011c06ee051577022c8fd84f2a018123efd3" source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-2022-02#8fbc011c06ee051577022c8fd84f2a018123efd3"
dependencies = [ dependencies = [
"kvdb", "kvdb",
"parking_lot", "parking_lot 0.11.2",
] ]
[[package]] [[package]]
...@@ -7339,7 +7376,7 @@ dependencies = [ ...@@ -7339,7 +7376,7 @@ dependencies = [
"libsecp256k1", "libsecp256k1",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"sp-core", "sp-core",
"sp-externalities", "sp-externalities",
"sp-keystore", "sp-keystore",
...@@ -7373,7 +7410,7 @@ dependencies = [ ...@@ -7373,7 +7410,7 @@ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"merlin", "merlin",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"schnorrkel", "schnorrkel",
"serde", "serde",
"sp-core", "sp-core",
...@@ -7525,7 +7562,7 @@ dependencies = [ ...@@ -7525,7 +7562,7 @@ dependencies = [
"log", "log",
"num-traits", "num-traits",
"parity-scale-codec", "parity-scale-codec",
"parking_lot", "parking_lot 0.11.2",
"rand 0.7.3", "rand 0.7.3",
"smallvec", "smallvec",
"sp-core", "sp-core",
...@@ -8259,7 +8296,7 @@ dependencies = [ ...@@ -8259,7 +8296,7 @@ dependencies = [
"chrono", "chrono",
"lazy_static", "lazy_static",
"matchers", "matchers",
"parking_lot", "parking_lot 0.11.2",
"regex", "regex",
"serde", "serde",
"serde_json", "serde_json",
...@@ -8330,7 +8367,7 @@ dependencies = [ ...@@ -8330,7 +8367,7 @@ dependencies = [
"lazy_static", "lazy_static",
"log", "log",
"lru-cache", "lru-cache",
"parking_lot", "parking_lot 0.11.2",
"resolv-conf", "resolv-conf",
"smallvec", "smallvec",
"thiserror", "thiserror",
...@@ -8506,6 +8543,16 @@ dependencies = [ ...@@ -8506,6 +8543,16 @@ dependencies = [
"percent-encoding 2.1.0", "percent-encoding 2.1.0",
] ]
[[package]]
name = "users"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4227e95324a443c9fcb06e03d4d85e91aabe9a5a02aa818688b6918b6af486"
dependencies = [
"libc",
"log",
]
[[package]] [[package]]
name = "value-bag" name = "value-bag"
version = "1.0.0-alpha.7" version = "1.0.0-alpha.7"
...@@ -8522,6 +8569,12 @@ version = "0.2.15" ...@@ -8522,6 +8569,12 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "version-compare"
version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.3" version = "0.9.3"
...@@ -8667,7 +8720,7 @@ checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" ...@@ -8667,7 +8720,7 @@ checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
dependencies = [ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"js-sys", "js-sys",
"parking_lot", "parking_lot 0.11.2",
"pin-utils", "pin-utils",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
...@@ -8815,6 +8868,49 @@ version = "0.4.0" ...@@ -8815,6 +8868,49 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_i686_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_x86_64_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]] [[package]]
name = "winreg" name = "winreg"
version = "0.6.2" version = "0.6.2"
...@@ -8851,6 +8947,20 @@ dependencies = [ ...@@ -8851,6 +8947,20 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "xtask"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"frame-metadata",
"parity-scale-codec",
"run_script",
"scale-info",
"version-compare",
"version_check",
]
[[package]] [[package]]
name = "yamux" name = "yamux"
version = "0.9.0" version = "0.9.0"
...@@ -8860,7 +8970,7 @@ dependencies = [ ...@@ -8860,7 +8970,7 @@ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"log", "log",
"nohash-hasher", "nohash-hasher",
"parking_lot", "parking_lot 0.11.2",
"rand 0.8.4", "rand 0.8.4",
"static_assertions", "static_assertions",
] ]
......
...@@ -122,6 +122,7 @@ members = [ ...@@ -122,6 +122,7 @@ members = [
'primitives/membership', 'primitives/membership',
'runtime/common', 'runtime/common',
'runtime/gdev', 'runtime/gdev',
'xtask',
] ]
# The list of dependencies below (which can be both direct and indirect dependencies) are crates # The list of dependencies below (which can be both direct and indirect dependencies) are crates
......
...@@ -36,7 +36,7 @@ Other docker-compose files are suggested in the `docker/compose-examples` folder ...@@ -36,7 +36,7 @@ Other docker-compose files are suggested in the `docker/compose-examples` folder
## Setup ## Setup
First, complete the [basic setup instructions](./docs/setup.md). First, complete the [basic setup instructions](./docs/dev/setup.md).
## Build ## Build
......
This diff is collapsed.
File moved
[package]
authors = ["elois <elois@duniter.org>"]
description = "Duniter-v2s xtask"
edition = "2018"
license = "AGPL-3.0"
name = "xtask"
repository = "https://git.duniter.org/nodes/typescript/duniter"
version = "0.1.0"
[[bin]]
bench = false
path = "src/main.rs"
name = "xtask"
[dependencies]
anyhow = "1.0.32"
clap = { version = "3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] }
frame-metadata = "14.0.0"
run_script = "0.6.3"
scale-info = { version = "1.0.0", features = ["bit-vec"] }
version_check = "0.9.2"
version-compare = "0.0.11"
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
use anyhow::{anyhow, bail, Context, Result};
use codec::Decode;
use scale_info::form::PortableForm;
use std::{
fs::File,
io::{Read, Write},
};
const CALLS_DOC_FILEPATH: &str = "docs/api/runtime-calls.md";
type RuntimeCalls = Vec<Pallet>;
enum CallCategory {
Disabled,
Inherent,
OtherOrigin,
Root,
Sudo,
User,
}
impl CallCategory {
fn is(pallet_name: &str, call_name: &str) -> Self {
match (pallet_name, call_name) {
("System", "remark" | "remark_with_event") => Self::Disabled,
("System", _) => Self::Root,
("Babe", "report_equivocation_unsigned") => Self::Inherent,
("Babe", "plan_config_change") => Self::Root,
("Timestamp", _) => Self::Inherent,
("Balances", "set_balance" | "force_transfer" | "force_unreserve") => Self::Root,
("AuthorityMembers", "prune_account_id_of" | "remove_member") => Self::Root,
("Authorship", _) => Self::Inherent,
("Session", _) => Self::Disabled,
("Grandpa", "report_equivocation_unsigned") => Self::Inherent,
("Grandpa", "note_stalled") => Self::Root,
("UpgradeOrigin", "dispatch_as_root") => Self::OtherOrigin,
("ImOnline", _) => Self::Inherent,
("Sudo", _) => Self::Sudo,
(
"Identity",
"remove_identity" | "prune_item_identities_names" | "prune_item_identity_index_of",
) => Self::Root,
("Membership", "force_request_membership") => Self::Root,
("Membership", "claim_membership" | "revoke_membership") => Self::Disabled,
("Cert", "force_add_cert" | "del_cert" | "remove_all_certs_received_by") => Self::Root,
("SmithsMembership", "force_request_membership") => Self::Root,
("SmithsMembership", "claim_membership") => Self::Disabled,
("SmithsCert", "force_add_cert" | "del_cert" | "remove_all_certs_received_by") => {
Self::Root
}
("SmithsCollective", "set_members" | "disapprove_proposal") => Self::Root,
("Utility", "dispatch_as") => Self::Root,
_ => Self::User,
}
}
fn is_root(pallet_name: &str, call_name: &str) -> bool {
if let Self::Root = Self::is(pallet_name, call_name) {
true
} else {
false
}
}
fn is_user(pallet_name: &str, call_name: &str) -> bool {
if let Self::User = Self::is(pallet_name, call_name) {
true
} else {
false
}
}
}
#[derive(Clone)]
struct Pallet {
index: u8,
name: String,
calls: Vec<Call>,
}
impl Pallet {
fn new(
index: u8,
name: String,
scale_type_def: &scale_info::TypeDef<PortableForm>,
) -> Result<Self> {
if let scale_info::TypeDef::Variant(calls_enum) = scale_type_def {
Ok(Self {
index,
name,
calls: calls_enum.variants().iter().map(Into::into).collect(),
})
} else {
bail!("Invalid metadata")
}
}
}
#[derive(Clone)]
struct Call {
docs: Vec<String>,
index: u8,
name: String,
params: Vec<CallParam>,
}
impl From<&scale_info::Variant<PortableForm>> for Call {
fn from(variant: &scale_info::Variant<PortableForm>) -> Self {
Self {
docs: variant.docs().to_vec(),
index: variant.index(),
name: variant.name().to_owned(),
params: variant.fields().iter().map(Into::into).collect(),
}
}
}
#[derive(Clone)]
struct CallParam {
docs: Vec<String>,
name: String,
type_name: String,
}
impl From<&scale_info::Field<PortableForm>> for CallParam {
fn from(field: &scale_info::Field<PortableForm>) -> Self {
Self {
docs: field.docs().to_vec(),
name: field.name().cloned().unwrap_or_default(),
type_name: field.type_name().cloned().unwrap_or_default(),
}
}
}
pub(super) fn gen_calls_doc() -> Result<()> {
// Read metadata
let mut file = std::fs::File::open("resources/metadata.scale")
.with_context(|| "Failed to open metadata file")?;
let mut bytes = Vec::new();
file.read_to_end(&mut bytes)
.with_context(|| "Failed to read metadata file")?;
let metadata = frame_metadata::RuntimeMetadataPrefixed::decode(&mut &bytes[..])
.with_context(|| "Failed to decode metadata")?;
println!("Metadata successfully loaded!");
let runtime_calls = if let frame_metadata::RuntimeMetadata::V14(metadata_v14) = metadata.1 {
get_calls_from_metadata_v14(metadata_v14)?
} else {
bail!("unsuported metadata version")
};
let output = print_runtime_calls(runtime_calls);
let mut file = File::create(CALLS_DOC_FILEPATH)
.with_context(|| format!("Failed to create file '{}'", CALLS_DOC_FILEPATH))?;
file.write_all(output.as_bytes())
.with_context(|| format!("Failed to write to file '{}'", CALLS_DOC_FILEPATH))?;
Ok(())
}
fn get_calls_from_metadata_v14(
metadata_v14: frame_metadata::v14::RuntimeMetadataV14,
) -> Result<RuntimeCalls> {
println!("Number of pallets: {}", metadata_v14.pallets.len());
let mut pallets = Vec::new();
for pallet in metadata_v14.pallets {
if let Some(calls) = pallet.calls {
if let Some(calls_type) = metadata_v14.types.resolve(calls.ty.id()) {
let pallet = Pallet::new(pallet.index, pallet.name.clone(), calls_type.type_def())?;
let calls_len = pallet.calls.len();
println!("{}: {} ({} calls)", pallet.index, pallet.name, calls_len);
pallets.push(pallet);
} else {
bail!("Invalid metadata")
}
} else {
println!("{}: {} (0 calls)", pallet.index, pallet.name);
}
}
Ok(pallets)
}
fn print_runtime_calls(pallets: RuntimeCalls) -> String {
let mut user_calls_counter = 0;
let user_calls_pallets: RuntimeCalls = pallets
.iter()
.cloned()
.filter_map(|mut pallet| {
let pallet_name = pallet.name.clone();
pallet
.calls
.retain(|call| CallCategory::is_user(&pallet_name, &call.name));
if pallet.calls.is_empty() {
None
} else {
user_calls_counter += pallet.calls.len();
Some(pallet)
}
})
.collect();
let mut root_calls_counter = 0;
let root_calls_pallets: RuntimeCalls = pallets
.iter()
.cloned()
.filter_map(|mut pallet| {
let pallet_name = pallet.name.clone();
pallet
.calls
.retain(|call| CallCategory::is_root(&pallet_name, &call.name));
if pallet.calls.is_empty() {
None
} else {
root_calls_counter += pallet.calls.len();
Some(pallet)
}
})
.collect();
let mut output = String::new();
output.push_str("# Runtime calls\n\n");
output.push_str("Calls are categorized according to the dispatch origin they require:\n\n");
output.push_str(
r#"1. User calls: the dispatch origin for this kind of call must be Signed by
the transactor. This is the only call category that can be submitted with an extrinsic.
"#,
);
output.push_str(
r#"1. Root calls: This kind of call requires a special origin that can only be invoked
through on-chain governance mechanisms.
"#,
);
output.push_str(
r#"1. Inherent calls: This kind of call is invoked by the author of the block itself
(usually automatically by the node).
"#,
);
output.push_str("\n\n## User calls\n\n");
output.push_str(&print_calls_category(
user_calls_counter,
"user",
user_calls_pallets,
));
output.push_str("\n\n## Root calls\n\n");
output.push_str(&print_calls_category(
root_calls_counter,
"root",
root_calls_pallets,
));
output
}
fn print_calls_category(calls_counter: usize, category_name: &str, pallets: Vec<Pallet>) -> String {
let mut output = String::new();
output.push_str(&format!(
"There are **{}** {} calls organized in **{}** pallets.\n",
calls_counter,
category_name,
pallets.len()
));
for pallet in pallets {
output.push_str(&format!("\n### {}: {}\n\n", pallet.index, pallet.name));
for call in pallet.calls {
output.push_str(&format!(
"<details><summary>{}: {}({})</summary>\n<p>\n\n{}</p>\n</details>\n\n",
call.index,
call.name,
print_call_params(&call.params),
print_call_details(&call),
));
}
}
output
}
fn print_call_details(call: &Call) -> String {
let mut output = String::new();
output.push_str(&format!("### Index\n\n`{}`\n\n", call.index));
output.push_str(&format!(
"### Documentation\n\n{}\n\n",
call.docs
.iter()
.take_while(|line| !line.starts_with("# <weight>"))
.cloned()
.collect::<Vec<_>>()
.join("\n")
));
if !call.params.is_empty() {
output.push_str("### Types of parameters\n\n```rust\n");
output.push_str(
&call
.params
.iter()
.map(|param| format!("{}: {}", param.name, param.type_name))
.collect::<Vec<_>>()
.join(",\n"),
);
output.push_str("\n```\n\n");
}
output
}
fn print_call_params(call_params: &[CallParam]) -> String {
call_params
.iter()
.map(|param| param.name.clone())
.collect::<Vec<_>>()
.join(", ")
}
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
mod gen_calls_doc;
use anyhow::Result;
use clap::Parser;
use std::process::Command;
const MIN_RUST_VERSION: &str = "1.58.0";
#[derive(Debug, clap::Parser)]
struct DuniterXTask {
#[clap(subcommand)]
command: DuniterXTaskCommand,
}
#[derive(Debug, clap::Subcommand)]
enum DuniterXTaskCommand {
/// Build duniter binary
Build {
#[clap(long)]
production: bool,
},
/// Generate calls documentation
GenCallsDoc,
/// Execute unit tests and integration tests
/// End2tests are skipped
Test,
}
fn main() -> Result<()> {
let args = DuniterXTask::parse();
if !version_check::is_min_version(MIN_RUST_VERSION).unwrap_or(false)
&& exec_should_success(Command::new("rustup").args(&["update", "stable"])).is_err()
{
eprintln!(
"Duniter requires stable Rust {} or higher. If you installed the Rust toolchain via rustup, please execute the command `rustup update stable`.",
MIN_RUST_VERSION
);
std::process::exit(1);
}
Command::new("rustc").arg("--version").status()?;
Command::new("cargo").arg("--version").status()?;
match args.command {
DuniterXTaskCommand::Build { production } => build(production),
DuniterXTaskCommand::GenCallsDoc => gen_calls_doc::gen_calls_doc(),
DuniterXTaskCommand::Test => test(),
}
}
fn build(production: bool) -> Result<()> {
exec_should_success(Command::new("cargo").args(&["clean", "-p", "duniter"]))?;
exec_should_success(Command::new("cargo").args(&["build", "--locked"]))?;
exec_should_success(Command::new("mkdir").args(&["build"]))?;
exec_should_success(Command::new("mv").args(&["target/debug/duniter", "build/duniter"]))?;
Ok(())
}
fn test() -> Result<()> {
exec_should_success(Command::new("cargo").args(&[
"test",
"--workspace",
"--exclude",
"duniter-end2end-tests",
]))?;
Ok(())
}
fn exec_should_success(command: &mut Command) -> Result<()> {
if !command.status()?.success() {
std::process::exit(1);
} else {
Ok(())
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment