├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md └── src ├── main.rs ├── testing ├── cargo-lock │ ├── input.Cargo.toml │ └── output.Cargo.toml ├── orml │ ├── input.Cargo.toml │ ├── noFlag.Cargo.toml │ ├── notOrml.Cargo.toml │ └── output.Cargo.toml └── plan-toml │ ├── check.Cargo.toml │ ├── input.Cargo.toml │ └── output.Cargo.toml ├── tests.rs └── versions.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: [ "main" ] 10 | pull_request: 11 | branches: [ "main" ] 12 | 13 | env: 14 | CARGO_TERM_COLOR: always 15 | 16 | jobs: 17 | build: 18 | 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | 24 | - name: Build 25 | run: cargo build --locked 26 | 27 | - name: Run tests 28 | run: cargo test --locked 29 | 30 | - name: Polkadot Runtimes Work 31 | run: | 32 | cargo install --path . --locked 33 | git clone --depth 1 --branch main https://github.com/polkadot-fellows/runtimes 34 | cd runtimes 35 | 36 | # Some testing 37 | psvm -v stable2407 38 | psvm -v stable2407-2 39 | psvm -v 1.13.0 40 | psvm -l 41 | 42 | - name: Fmt 43 | run: cargo fmt --all -- --check 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .vscode 3 | .DS_Store -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "anstream" 31 | version = "0.6.13" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" 34 | dependencies = [ 35 | "anstyle", 36 | "anstyle-parse", 37 | "anstyle-query", 38 | "anstyle-wincon", 39 | "colorchoice", 40 | "utf8parse", 41 | ] 42 | 43 | [[package]] 44 | name = "anstyle" 45 | version = "1.0.6" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" 48 | 49 | [[package]] 50 | name = "anstyle-parse" 51 | version = "0.2.3" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" 54 | dependencies = [ 55 | "utf8parse", 56 | ] 57 | 58 | [[package]] 59 | name = "anstyle-query" 60 | version = "1.0.2" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" 63 | dependencies = [ 64 | "windows-sys 0.52.0", 65 | ] 66 | 67 | [[package]] 68 | name = "anstyle-wincon" 69 | version = "3.0.2" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" 72 | dependencies = [ 73 | "anstyle", 74 | "windows-sys 0.52.0", 75 | ] 76 | 77 | [[package]] 78 | name = "assert-json-diff" 79 | version = "2.0.2" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" 82 | dependencies = [ 83 | "serde", 84 | "serde_json", 85 | ] 86 | 87 | [[package]] 88 | name = "async-stream" 89 | version = "0.3.5" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" 92 | dependencies = [ 93 | "async-stream-impl", 94 | "futures-core", 95 | "pin-project-lite", 96 | ] 97 | 98 | [[package]] 99 | name = "async-stream-impl" 100 | version = "0.3.5" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" 103 | dependencies = [ 104 | "proc-macro2", 105 | "quote", 106 | "syn", 107 | ] 108 | 109 | [[package]] 110 | name = "autocfg" 111 | version = "1.2.0" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 114 | 115 | [[package]] 116 | name = "backtrace" 117 | version = "0.3.71" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" 120 | dependencies = [ 121 | "addr2line", 122 | "cc", 123 | "cfg-if", 124 | "libc", 125 | "miniz_oxide", 126 | "object", 127 | "rustc-demangle", 128 | ] 129 | 130 | [[package]] 131 | name = "base64" 132 | version = "0.22.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" 135 | 136 | [[package]] 137 | name = "bitflags" 138 | version = "1.3.2" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 141 | 142 | [[package]] 143 | name = "bitflags" 144 | version = "2.5.0" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 147 | 148 | [[package]] 149 | name = "bumpalo" 150 | version = "3.16.0" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 153 | 154 | [[package]] 155 | name = "bytes" 156 | version = "1.6.0" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 159 | 160 | [[package]] 161 | name = "cc" 162 | version = "1.0.94" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" 165 | 166 | [[package]] 167 | name = "cfg-if" 168 | version = "1.0.0" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 171 | 172 | [[package]] 173 | name = "clap" 174 | version = "4.5.3" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" 177 | dependencies = [ 178 | "clap_builder", 179 | "clap_derive", 180 | ] 181 | 182 | [[package]] 183 | name = "clap_builder" 184 | version = "4.5.2" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" 187 | dependencies = [ 188 | "anstream", 189 | "anstyle", 190 | "clap_lex", 191 | "strsim", 192 | ] 193 | 194 | [[package]] 195 | name = "clap_derive" 196 | version = "4.5.3" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" 199 | dependencies = [ 200 | "heck", 201 | "proc-macro2", 202 | "quote", 203 | "syn", 204 | ] 205 | 206 | [[package]] 207 | name = "clap_lex" 208 | version = "0.7.0" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" 211 | 212 | [[package]] 213 | name = "colorchoice" 214 | version = "1.0.0" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 217 | 218 | [[package]] 219 | name = "colored" 220 | version = "2.1.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" 223 | dependencies = [ 224 | "lazy_static", 225 | "windows-sys 0.48.0", 226 | ] 227 | 228 | [[package]] 229 | name = "core-foundation" 230 | version = "0.9.4" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 233 | dependencies = [ 234 | "core-foundation-sys", 235 | "libc", 236 | ] 237 | 238 | [[package]] 239 | name = "core-foundation-sys" 240 | version = "0.8.6" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 243 | 244 | [[package]] 245 | name = "difference" 246 | version = "2.0.0" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 249 | 250 | [[package]] 251 | name = "encoding_rs" 252 | version = "0.8.34" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" 255 | dependencies = [ 256 | "cfg-if", 257 | ] 258 | 259 | [[package]] 260 | name = "env_filter" 261 | version = "0.1.0" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" 264 | dependencies = [ 265 | "log", 266 | "regex", 267 | ] 268 | 269 | [[package]] 270 | name = "env_logger" 271 | version = "0.11.3" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" 274 | dependencies = [ 275 | "anstream", 276 | "anstyle", 277 | "env_filter", 278 | "humantime", 279 | "log", 280 | ] 281 | 282 | [[package]] 283 | name = "equivalent" 284 | version = "1.0.1" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 287 | 288 | [[package]] 289 | name = "errno" 290 | version = "0.3.8" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 293 | dependencies = [ 294 | "libc", 295 | "windows-sys 0.52.0", 296 | ] 297 | 298 | [[package]] 299 | name = "fastrand" 300 | version = "2.0.2" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" 303 | 304 | [[package]] 305 | name = "fnv" 306 | version = "1.0.7" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 309 | 310 | [[package]] 311 | name = "foreign-types" 312 | version = "0.3.2" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 315 | dependencies = [ 316 | "foreign-types-shared", 317 | ] 318 | 319 | [[package]] 320 | name = "foreign-types-shared" 321 | version = "0.1.1" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 324 | 325 | [[package]] 326 | name = "form_urlencoded" 327 | version = "1.2.1" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 330 | dependencies = [ 331 | "percent-encoding", 332 | ] 333 | 334 | [[package]] 335 | name = "futures-channel" 336 | version = "0.3.30" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 339 | dependencies = [ 340 | "futures-core", 341 | ] 342 | 343 | [[package]] 344 | name = "futures-core" 345 | version = "0.3.30" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 348 | 349 | [[package]] 350 | name = "futures-sink" 351 | version = "0.3.30" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 354 | 355 | [[package]] 356 | name = "futures-task" 357 | version = "0.3.30" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 360 | 361 | [[package]] 362 | name = "futures-util" 363 | version = "0.3.30" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 366 | dependencies = [ 367 | "futures-core", 368 | "futures-task", 369 | "pin-project-lite", 370 | "pin-utils", 371 | ] 372 | 373 | [[package]] 374 | name = "getrandom" 375 | version = "0.2.14" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" 378 | dependencies = [ 379 | "cfg-if", 380 | "libc", 381 | "wasi", 382 | ] 383 | 384 | [[package]] 385 | name = "gimli" 386 | version = "0.28.1" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 389 | 390 | [[package]] 391 | name = "h2" 392 | version = "0.4.4" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" 395 | dependencies = [ 396 | "bytes", 397 | "fnv", 398 | "futures-core", 399 | "futures-sink", 400 | "futures-util", 401 | "http", 402 | "indexmap", 403 | "slab", 404 | "tokio", 405 | "tokio-util", 406 | "tracing", 407 | ] 408 | 409 | [[package]] 410 | name = "hashbrown" 411 | version = "0.14.3" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 414 | 415 | [[package]] 416 | name = "heck" 417 | version = "0.5.0" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 420 | 421 | [[package]] 422 | name = "hermit-abi" 423 | version = "0.3.9" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 426 | 427 | [[package]] 428 | name = "http" 429 | version = "1.1.0" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 432 | dependencies = [ 433 | "bytes", 434 | "fnv", 435 | "itoa", 436 | ] 437 | 438 | [[package]] 439 | name = "http-body" 440 | version = "1.0.0" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" 443 | dependencies = [ 444 | "bytes", 445 | "http", 446 | ] 447 | 448 | [[package]] 449 | name = "http-body-util" 450 | version = "0.1.1" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" 453 | dependencies = [ 454 | "bytes", 455 | "futures-core", 456 | "http", 457 | "http-body", 458 | "pin-project-lite", 459 | ] 460 | 461 | [[package]] 462 | name = "httparse" 463 | version = "1.8.0" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 466 | 467 | [[package]] 468 | name = "humantime" 469 | version = "2.1.0" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 472 | 473 | [[package]] 474 | name = "hyper" 475 | version = "1.3.0" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "9f24ce812868d86d19daa79bf3bf9175bc44ea323391147a5e3abde2a283871b" 478 | dependencies = [ 479 | "bytes", 480 | "futures-channel", 481 | "futures-util", 482 | "h2", 483 | "http", 484 | "http-body", 485 | "httparse", 486 | "itoa", 487 | "pin-project-lite", 488 | "smallvec", 489 | "tokio", 490 | "want", 491 | ] 492 | 493 | [[package]] 494 | name = "hyper-tls" 495 | version = "0.6.0" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 498 | dependencies = [ 499 | "bytes", 500 | "http-body-util", 501 | "hyper", 502 | "hyper-util", 503 | "native-tls", 504 | "tokio", 505 | "tokio-native-tls", 506 | "tower-service", 507 | ] 508 | 509 | [[package]] 510 | name = "hyper-util" 511 | version = "0.1.3" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" 514 | dependencies = [ 515 | "bytes", 516 | "futures-channel", 517 | "futures-util", 518 | "http", 519 | "http-body", 520 | "hyper", 521 | "pin-project-lite", 522 | "socket2", 523 | "tokio", 524 | "tower", 525 | "tower-service", 526 | "tracing", 527 | ] 528 | 529 | [[package]] 530 | name = "idna" 531 | version = "0.5.0" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 534 | dependencies = [ 535 | "unicode-bidi", 536 | "unicode-normalization", 537 | ] 538 | 539 | [[package]] 540 | name = "indexmap" 541 | version = "2.2.6" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 544 | dependencies = [ 545 | "equivalent", 546 | "hashbrown", 547 | ] 548 | 549 | [[package]] 550 | name = "ipnet" 551 | version = "2.9.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" 554 | 555 | [[package]] 556 | name = "itoa" 557 | version = "1.0.10" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 560 | 561 | [[package]] 562 | name = "js-sys" 563 | version = "0.3.69" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 566 | dependencies = [ 567 | "wasm-bindgen", 568 | ] 569 | 570 | [[package]] 571 | name = "lazy_static" 572 | version = "1.4.0" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 575 | 576 | [[package]] 577 | name = "libc" 578 | version = "0.2.153" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 581 | 582 | [[package]] 583 | name = "linux-raw-sys" 584 | version = "0.4.13" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 587 | 588 | [[package]] 589 | name = "lock_api" 590 | version = "0.4.11" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 593 | dependencies = [ 594 | "autocfg", 595 | "scopeguard", 596 | ] 597 | 598 | [[package]] 599 | name = "log" 600 | version = "0.4.21" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 603 | 604 | [[package]] 605 | name = "memchr" 606 | version = "2.7.1" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 609 | 610 | [[package]] 611 | name = "mime" 612 | version = "0.3.17" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 615 | 616 | [[package]] 617 | name = "miniz_oxide" 618 | version = "0.7.2" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" 621 | dependencies = [ 622 | "adler", 623 | ] 624 | 625 | [[package]] 626 | name = "mio" 627 | version = "0.8.11" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 630 | dependencies = [ 631 | "libc", 632 | "wasi", 633 | "windows-sys 0.48.0", 634 | ] 635 | 636 | [[package]] 637 | name = "mockito" 638 | version = "0.30.0" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "d10030163d67f681db11810bc486df3149e6d91c8b4f3f96fa8b62b546c2cef8" 641 | dependencies = [ 642 | "assert-json-diff", 643 | "colored", 644 | "difference", 645 | "httparse", 646 | "lazy_static", 647 | "log", 648 | "rand", 649 | "regex", 650 | "serde_json", 651 | "serde_urlencoded", 652 | ] 653 | 654 | [[package]] 655 | name = "native-tls" 656 | version = "0.2.11" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 659 | dependencies = [ 660 | "lazy_static", 661 | "libc", 662 | "log", 663 | "openssl", 664 | "openssl-probe", 665 | "openssl-sys", 666 | "schannel", 667 | "security-framework", 668 | "security-framework-sys", 669 | "tempfile", 670 | ] 671 | 672 | [[package]] 673 | name = "num_cpus" 674 | version = "1.16.0" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 677 | dependencies = [ 678 | "hermit-abi", 679 | "libc", 680 | ] 681 | 682 | [[package]] 683 | name = "object" 684 | version = "0.32.2" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 687 | dependencies = [ 688 | "memchr", 689 | ] 690 | 691 | [[package]] 692 | name = "once_cell" 693 | version = "1.19.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 696 | 697 | [[package]] 698 | name = "openssl" 699 | version = "0.10.66" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" 702 | dependencies = [ 703 | "bitflags 2.5.0", 704 | "cfg-if", 705 | "foreign-types", 706 | "libc", 707 | "once_cell", 708 | "openssl-macros", 709 | "openssl-sys", 710 | ] 711 | 712 | [[package]] 713 | name = "openssl-macros" 714 | version = "0.1.1" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 717 | dependencies = [ 718 | "proc-macro2", 719 | "quote", 720 | "syn", 721 | ] 722 | 723 | [[package]] 724 | name = "openssl-probe" 725 | version = "0.1.5" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 728 | 729 | [[package]] 730 | name = "openssl-sys" 731 | version = "0.9.103" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" 734 | dependencies = [ 735 | "cc", 736 | "libc", 737 | "pkg-config", 738 | "vcpkg", 739 | ] 740 | 741 | [[package]] 742 | name = "parking_lot" 743 | version = "0.12.1" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 746 | dependencies = [ 747 | "lock_api", 748 | "parking_lot_core", 749 | ] 750 | 751 | [[package]] 752 | name = "parking_lot_core" 753 | version = "0.9.9" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 756 | dependencies = [ 757 | "cfg-if", 758 | "libc", 759 | "redox_syscall", 760 | "smallvec", 761 | "windows-targets 0.48.5", 762 | ] 763 | 764 | [[package]] 765 | name = "percent-encoding" 766 | version = "2.3.1" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 769 | 770 | [[package]] 771 | name = "pin-project" 772 | version = "1.1.5" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 775 | dependencies = [ 776 | "pin-project-internal", 777 | ] 778 | 779 | [[package]] 780 | name = "pin-project-internal" 781 | version = "1.1.5" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 784 | dependencies = [ 785 | "proc-macro2", 786 | "quote", 787 | "syn", 788 | ] 789 | 790 | [[package]] 791 | name = "pin-project-lite" 792 | version = "0.2.14" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 795 | 796 | [[package]] 797 | name = "pin-utils" 798 | version = "0.1.0" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 801 | 802 | [[package]] 803 | name = "pkg-config" 804 | version = "0.3.30" 805 | source = "registry+https://github.com/rust-lang/crates.io-index" 806 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 807 | 808 | [[package]] 809 | name = "ppv-lite86" 810 | version = "0.2.17" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 813 | 814 | [[package]] 815 | name = "proc-macro2" 816 | version = "1.0.79" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" 819 | dependencies = [ 820 | "unicode-ident", 821 | ] 822 | 823 | [[package]] 824 | name = "psvm" 825 | version = "0.2.4" 826 | dependencies = [ 827 | "clap", 828 | "env_logger", 829 | "log", 830 | "mockito", 831 | "regex", 832 | "reqwest", 833 | "serde", 834 | "serde_json", 835 | "tokio", 836 | "tokio-test", 837 | "toml", 838 | "toml_edit", 839 | ] 840 | 841 | [[package]] 842 | name = "quote" 843 | version = "1.0.35" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 846 | dependencies = [ 847 | "proc-macro2", 848 | ] 849 | 850 | [[package]] 851 | name = "rand" 852 | version = "0.8.5" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 855 | dependencies = [ 856 | "libc", 857 | "rand_chacha", 858 | "rand_core", 859 | ] 860 | 861 | [[package]] 862 | name = "rand_chacha" 863 | version = "0.3.1" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 866 | dependencies = [ 867 | "ppv-lite86", 868 | "rand_core", 869 | ] 870 | 871 | [[package]] 872 | name = "rand_core" 873 | version = "0.6.4" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 876 | dependencies = [ 877 | "getrandom", 878 | ] 879 | 880 | [[package]] 881 | name = "redox_syscall" 882 | version = "0.4.1" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 885 | dependencies = [ 886 | "bitflags 1.3.2", 887 | ] 888 | 889 | [[package]] 890 | name = "regex" 891 | version = "1.10.6" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" 894 | dependencies = [ 895 | "aho-corasick", 896 | "memchr", 897 | "regex-automata", 898 | "regex-syntax", 899 | ] 900 | 901 | [[package]] 902 | name = "regex-automata" 903 | version = "0.4.6" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 906 | dependencies = [ 907 | "aho-corasick", 908 | "memchr", 909 | "regex-syntax", 910 | ] 911 | 912 | [[package]] 913 | name = "regex-syntax" 914 | version = "0.8.2" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 917 | 918 | [[package]] 919 | name = "reqwest" 920 | version = "0.12.3" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" 923 | dependencies = [ 924 | "base64", 925 | "bytes", 926 | "encoding_rs", 927 | "futures-core", 928 | "futures-util", 929 | "h2", 930 | "http", 931 | "http-body", 932 | "http-body-util", 933 | "hyper", 934 | "hyper-tls", 935 | "hyper-util", 936 | "ipnet", 937 | "js-sys", 938 | "log", 939 | "mime", 940 | "native-tls", 941 | "once_cell", 942 | "percent-encoding", 943 | "pin-project-lite", 944 | "rustls-pemfile", 945 | "serde", 946 | "serde_json", 947 | "serde_urlencoded", 948 | "sync_wrapper", 949 | "system-configuration", 950 | "tokio", 951 | "tokio-native-tls", 952 | "tower-service", 953 | "url", 954 | "wasm-bindgen", 955 | "wasm-bindgen-futures", 956 | "web-sys", 957 | "winreg", 958 | ] 959 | 960 | [[package]] 961 | name = "rustc-demangle" 962 | version = "0.1.23" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 965 | 966 | [[package]] 967 | name = "rustix" 968 | version = "0.38.32" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" 971 | dependencies = [ 972 | "bitflags 2.5.0", 973 | "errno", 974 | "libc", 975 | "linux-raw-sys", 976 | "windows-sys 0.52.0", 977 | ] 978 | 979 | [[package]] 980 | name = "rustls-pemfile" 981 | version = "2.1.2" 982 | source = "registry+https://github.com/rust-lang/crates.io-index" 983 | checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" 984 | dependencies = [ 985 | "base64", 986 | "rustls-pki-types", 987 | ] 988 | 989 | [[package]] 990 | name = "rustls-pki-types" 991 | version = "1.4.1" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" 994 | 995 | [[package]] 996 | name = "ryu" 997 | version = "1.0.17" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 1000 | 1001 | [[package]] 1002 | name = "schannel" 1003 | version = "0.1.23" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" 1006 | dependencies = [ 1007 | "windows-sys 0.52.0", 1008 | ] 1009 | 1010 | [[package]] 1011 | name = "scopeguard" 1012 | version = "1.2.0" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1015 | 1016 | [[package]] 1017 | name = "security-framework" 1018 | version = "2.10.0" 1019 | source = "registry+https://github.com/rust-lang/crates.io-index" 1020 | checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" 1021 | dependencies = [ 1022 | "bitflags 1.3.2", 1023 | "core-foundation", 1024 | "core-foundation-sys", 1025 | "libc", 1026 | "security-framework-sys", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "security-framework-sys" 1031 | version = "2.10.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" 1034 | dependencies = [ 1035 | "core-foundation-sys", 1036 | "libc", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "serde" 1041 | version = "1.0.197" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 1044 | dependencies = [ 1045 | "serde_derive", 1046 | ] 1047 | 1048 | [[package]] 1049 | name = "serde_derive" 1050 | version = "1.0.197" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 1053 | dependencies = [ 1054 | "proc-macro2", 1055 | "quote", 1056 | "syn", 1057 | ] 1058 | 1059 | [[package]] 1060 | name = "serde_json" 1061 | version = "1.0.114" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" 1064 | dependencies = [ 1065 | "itoa", 1066 | "ryu", 1067 | "serde", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "serde_spanned" 1072 | version = "0.6.5" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" 1075 | dependencies = [ 1076 | "serde", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "serde_urlencoded" 1081 | version = "0.7.1" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1084 | dependencies = [ 1085 | "form_urlencoded", 1086 | "itoa", 1087 | "ryu", 1088 | "serde", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "signal-hook-registry" 1093 | version = "1.4.1" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1096 | dependencies = [ 1097 | "libc", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "slab" 1102 | version = "0.4.9" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1105 | dependencies = [ 1106 | "autocfg", 1107 | ] 1108 | 1109 | [[package]] 1110 | name = "smallvec" 1111 | version = "1.13.2" 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" 1113 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1114 | 1115 | [[package]] 1116 | name = "socket2" 1117 | version = "0.5.6" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" 1120 | dependencies = [ 1121 | "libc", 1122 | "windows-sys 0.52.0", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "strsim" 1127 | version = "0.11.0" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" 1130 | 1131 | [[package]] 1132 | name = "syn" 1133 | version = "2.0.55" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" 1136 | dependencies = [ 1137 | "proc-macro2", 1138 | "quote", 1139 | "unicode-ident", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "sync_wrapper" 1144 | version = "0.1.2" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1147 | 1148 | [[package]] 1149 | name = "system-configuration" 1150 | version = "0.5.1" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" 1153 | dependencies = [ 1154 | "bitflags 1.3.2", 1155 | "core-foundation", 1156 | "system-configuration-sys", 1157 | ] 1158 | 1159 | [[package]] 1160 | name = "system-configuration-sys" 1161 | version = "0.5.0" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" 1164 | dependencies = [ 1165 | "core-foundation-sys", 1166 | "libc", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "tempfile" 1171 | version = "3.10.1" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" 1174 | dependencies = [ 1175 | "cfg-if", 1176 | "fastrand", 1177 | "rustix", 1178 | "windows-sys 0.52.0", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "tinyvec" 1183 | version = "1.6.0" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1186 | dependencies = [ 1187 | "tinyvec_macros", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "tinyvec_macros" 1192 | version = "0.1.1" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1195 | 1196 | [[package]] 1197 | name = "tokio" 1198 | version = "1.37.0" 1199 | source = "registry+https://github.com/rust-lang/crates.io-index" 1200 | checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" 1201 | dependencies = [ 1202 | "backtrace", 1203 | "bytes", 1204 | "libc", 1205 | "mio", 1206 | "num_cpus", 1207 | "parking_lot", 1208 | "pin-project-lite", 1209 | "signal-hook-registry", 1210 | "socket2", 1211 | "tokio-macros", 1212 | "windows-sys 0.48.0", 1213 | ] 1214 | 1215 | [[package]] 1216 | name = "tokio-macros" 1217 | version = "2.2.0" 1218 | source = "registry+https://github.com/rust-lang/crates.io-index" 1219 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 1220 | dependencies = [ 1221 | "proc-macro2", 1222 | "quote", 1223 | "syn", 1224 | ] 1225 | 1226 | [[package]] 1227 | name = "tokio-native-tls" 1228 | version = "0.3.1" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1231 | dependencies = [ 1232 | "native-tls", 1233 | "tokio", 1234 | ] 1235 | 1236 | [[package]] 1237 | name = "tokio-stream" 1238 | version = "0.1.15" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" 1241 | dependencies = [ 1242 | "futures-core", 1243 | "pin-project-lite", 1244 | "tokio", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "tokio-test" 1249 | version = "0.4.4" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" 1252 | dependencies = [ 1253 | "async-stream", 1254 | "bytes", 1255 | "futures-core", 1256 | "tokio", 1257 | "tokio-stream", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "tokio-util" 1262 | version = "0.7.10" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" 1265 | dependencies = [ 1266 | "bytes", 1267 | "futures-core", 1268 | "futures-sink", 1269 | "pin-project-lite", 1270 | "tokio", 1271 | "tracing", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "toml" 1276 | version = "0.8.12" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" 1279 | dependencies = [ 1280 | "serde", 1281 | "serde_spanned", 1282 | "toml_datetime", 1283 | "toml_edit", 1284 | ] 1285 | 1286 | [[package]] 1287 | name = "toml_datetime" 1288 | version = "0.6.5" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 1291 | dependencies = [ 1292 | "serde", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "toml_edit" 1297 | version = "0.22.9" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" 1300 | dependencies = [ 1301 | "indexmap", 1302 | "serde", 1303 | "serde_spanned", 1304 | "toml_datetime", 1305 | "winnow", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "tower" 1310 | version = "0.4.13" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1313 | dependencies = [ 1314 | "futures-core", 1315 | "futures-util", 1316 | "pin-project", 1317 | "pin-project-lite", 1318 | "tokio", 1319 | "tower-layer", 1320 | "tower-service", 1321 | "tracing", 1322 | ] 1323 | 1324 | [[package]] 1325 | name = "tower-layer" 1326 | version = "0.3.2" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1329 | 1330 | [[package]] 1331 | name = "tower-service" 1332 | version = "0.3.2" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1335 | 1336 | [[package]] 1337 | name = "tracing" 1338 | version = "0.1.40" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1341 | dependencies = [ 1342 | "log", 1343 | "pin-project-lite", 1344 | "tracing-core", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "tracing-core" 1349 | version = "0.1.32" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1352 | dependencies = [ 1353 | "once_cell", 1354 | ] 1355 | 1356 | [[package]] 1357 | name = "try-lock" 1358 | version = "0.2.5" 1359 | source = "registry+https://github.com/rust-lang/crates.io-index" 1360 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1361 | 1362 | [[package]] 1363 | name = "unicode-bidi" 1364 | version = "0.3.15" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1367 | 1368 | [[package]] 1369 | name = "unicode-ident" 1370 | version = "1.0.12" 1371 | source = "registry+https://github.com/rust-lang/crates.io-index" 1372 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1373 | 1374 | [[package]] 1375 | name = "unicode-normalization" 1376 | version = "0.1.22" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1379 | dependencies = [ 1380 | "tinyvec", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "url" 1385 | version = "2.5.0" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" 1388 | dependencies = [ 1389 | "form_urlencoded", 1390 | "idna", 1391 | "percent-encoding", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "utf8parse" 1396 | version = "0.2.1" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1399 | 1400 | [[package]] 1401 | name = "vcpkg" 1402 | version = "0.2.15" 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" 1404 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1405 | 1406 | [[package]] 1407 | name = "want" 1408 | version = "0.3.1" 1409 | source = "registry+https://github.com/rust-lang/crates.io-index" 1410 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1411 | dependencies = [ 1412 | "try-lock", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "wasi" 1417 | version = "0.11.0+wasi-snapshot-preview1" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1420 | 1421 | [[package]] 1422 | name = "wasm-bindgen" 1423 | version = "0.2.92" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1426 | dependencies = [ 1427 | "cfg-if", 1428 | "wasm-bindgen-macro", 1429 | ] 1430 | 1431 | [[package]] 1432 | name = "wasm-bindgen-backend" 1433 | version = "0.2.92" 1434 | source = "registry+https://github.com/rust-lang/crates.io-index" 1435 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1436 | dependencies = [ 1437 | "bumpalo", 1438 | "log", 1439 | "once_cell", 1440 | "proc-macro2", 1441 | "quote", 1442 | "syn", 1443 | "wasm-bindgen-shared", 1444 | ] 1445 | 1446 | [[package]] 1447 | name = "wasm-bindgen-futures" 1448 | version = "0.4.42" 1449 | source = "registry+https://github.com/rust-lang/crates.io-index" 1450 | checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" 1451 | dependencies = [ 1452 | "cfg-if", 1453 | "js-sys", 1454 | "wasm-bindgen", 1455 | "web-sys", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "wasm-bindgen-macro" 1460 | version = "0.2.92" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1463 | dependencies = [ 1464 | "quote", 1465 | "wasm-bindgen-macro-support", 1466 | ] 1467 | 1468 | [[package]] 1469 | name = "wasm-bindgen-macro-support" 1470 | version = "0.2.92" 1471 | source = "registry+https://github.com/rust-lang/crates.io-index" 1472 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1473 | dependencies = [ 1474 | "proc-macro2", 1475 | "quote", 1476 | "syn", 1477 | "wasm-bindgen-backend", 1478 | "wasm-bindgen-shared", 1479 | ] 1480 | 1481 | [[package]] 1482 | name = "wasm-bindgen-shared" 1483 | version = "0.2.92" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1486 | 1487 | [[package]] 1488 | name = "web-sys" 1489 | version = "0.3.69" 1490 | source = "registry+https://github.com/rust-lang/crates.io-index" 1491 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 1492 | dependencies = [ 1493 | "js-sys", 1494 | "wasm-bindgen", 1495 | ] 1496 | 1497 | [[package]] 1498 | name = "windows-sys" 1499 | version = "0.48.0" 1500 | source = "registry+https://github.com/rust-lang/crates.io-index" 1501 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1502 | dependencies = [ 1503 | "windows-targets 0.48.5", 1504 | ] 1505 | 1506 | [[package]] 1507 | name = "windows-sys" 1508 | version = "0.52.0" 1509 | source = "registry+https://github.com/rust-lang/crates.io-index" 1510 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1511 | dependencies = [ 1512 | "windows-targets 0.52.4", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "windows-targets" 1517 | version = "0.48.5" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1520 | dependencies = [ 1521 | "windows_aarch64_gnullvm 0.48.5", 1522 | "windows_aarch64_msvc 0.48.5", 1523 | "windows_i686_gnu 0.48.5", 1524 | "windows_i686_msvc 0.48.5", 1525 | "windows_x86_64_gnu 0.48.5", 1526 | "windows_x86_64_gnullvm 0.48.5", 1527 | "windows_x86_64_msvc 0.48.5", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "windows-targets" 1532 | version = "0.52.4" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" 1535 | dependencies = [ 1536 | "windows_aarch64_gnullvm 0.52.4", 1537 | "windows_aarch64_msvc 0.52.4", 1538 | "windows_i686_gnu 0.52.4", 1539 | "windows_i686_msvc 0.52.4", 1540 | "windows_x86_64_gnu 0.52.4", 1541 | "windows_x86_64_gnullvm 0.52.4", 1542 | "windows_x86_64_msvc 0.52.4", 1543 | ] 1544 | 1545 | [[package]] 1546 | name = "windows_aarch64_gnullvm" 1547 | version = "0.48.5" 1548 | source = "registry+https://github.com/rust-lang/crates.io-index" 1549 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1550 | 1551 | [[package]] 1552 | name = "windows_aarch64_gnullvm" 1553 | version = "0.52.4" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" 1556 | 1557 | [[package]] 1558 | name = "windows_aarch64_msvc" 1559 | version = "0.48.5" 1560 | source = "registry+https://github.com/rust-lang/crates.io-index" 1561 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1562 | 1563 | [[package]] 1564 | name = "windows_aarch64_msvc" 1565 | version = "0.52.4" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" 1568 | 1569 | [[package]] 1570 | name = "windows_i686_gnu" 1571 | version = "0.48.5" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1574 | 1575 | [[package]] 1576 | name = "windows_i686_gnu" 1577 | version = "0.52.4" 1578 | source = "registry+https://github.com/rust-lang/crates.io-index" 1579 | checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" 1580 | 1581 | [[package]] 1582 | name = "windows_i686_msvc" 1583 | version = "0.48.5" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1586 | 1587 | [[package]] 1588 | name = "windows_i686_msvc" 1589 | version = "0.52.4" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" 1592 | 1593 | [[package]] 1594 | name = "windows_x86_64_gnu" 1595 | version = "0.48.5" 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" 1597 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1598 | 1599 | [[package]] 1600 | name = "windows_x86_64_gnu" 1601 | version = "0.52.4" 1602 | source = "registry+https://github.com/rust-lang/crates.io-index" 1603 | checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" 1604 | 1605 | [[package]] 1606 | name = "windows_x86_64_gnullvm" 1607 | version = "0.48.5" 1608 | source = "registry+https://github.com/rust-lang/crates.io-index" 1609 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1610 | 1611 | [[package]] 1612 | name = "windows_x86_64_gnullvm" 1613 | version = "0.52.4" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" 1616 | 1617 | [[package]] 1618 | name = "windows_x86_64_msvc" 1619 | version = "0.48.5" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1622 | 1623 | [[package]] 1624 | name = "windows_x86_64_msvc" 1625 | version = "0.52.4" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" 1628 | 1629 | [[package]] 1630 | name = "winnow" 1631 | version = "0.6.5" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" 1634 | dependencies = [ 1635 | "memchr", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "winreg" 1640 | version = "0.52.0" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" 1643 | dependencies = [ 1644 | "cfg-if", 1645 | "windows-sys 0.48.0", 1646 | ] 1647 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "psvm" 3 | version = "0.2.4" 4 | description = "A tool to manage and update the Polkadot SDK dependencies in any Cargo.toml file." 5 | repository = "https://github.com/paritytech/psvm" 6 | authors = ["Parity Technologies ", "Patricio (patriciobcs)"] 7 | edition = "2021" 8 | include = ["src/**/*", "Cargo.toml"] 9 | license = "Apache-2.0 OR GPL-3.0" 10 | 11 | [dependencies] 12 | regex = "1.10.6" 13 | clap = { version = "4.5", features = ["derive"] } 14 | toml_edit = "0.22.9" 15 | serde = { version = "1.0", features = ["derive"] } 16 | serde_json = "1.0" 17 | log = "0.4.21" 18 | env_logger = "0.11.3" 19 | reqwest = { version = "0.12.3", features = ["json"] } 20 | toml = "0.8.12" 21 | tokio = { version = "1.37.0", features = ["full"] } 22 | 23 | [dev-dependencies] 24 | tokio-test = "0.4" 25 | mockito = "0.30" 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019-2024 Parity Technologies (UK) Ltd. 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of (at your option) either the Apache License, 5 | Version 2.0, or the GNU General Public License as published by the 6 | Free Software Foundation, either version 3 of the License, or (at your 7 | option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | For details and specific language governing permissions and 14 | limitations, see either 15 | 16 | - http://www.gnu.org/licenses/ for the GNU GPL 17 | - http://www.apache.org/licenses/LICENSE-2.0 for the Apache license -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Polkadot SDK Version Manager 2 | 3 | This is a simple tool to manage and update the Polkadot SDK dependencies in any Cargo.toml file. It will automatically update the Polkadot SDK dependencies to their correct crates.io version. 4 | 5 | ## Installation 6 | 7 | From [GitHub](https://github.com/paritytech/psvm): 8 | 9 | ```sh 10 | cargo install --git https://github.com/paritytech/psvm psvm 11 | ``` 12 | 13 | From [crates.io](https://crates.io/crates/psvm): 14 | 15 | ```sh 16 | cargo install psvm 17 | ``` 18 | 19 | ## Usage 20 | 21 | Go to the directory containing the Cargo.toml file you want to update and run `psvm`. This will automatically update the Polkadot SDK dependencies in the Cargo.toml file to their correct crates.io version. 22 | 23 | If you want to update the local dependencies (using `path="..."`), you can use the `-o` or `-overwrite` flag, this will remove the `path` and set a crates.io version instead. 24 | 25 | If you want to update the dependencies to a specific Polkadot SDK version, you can use the `-v` or `--version` flag, followed by the version you want to update to. 26 | 27 | If you want to check if the dependencies in your local Cargo.toml file are matching to a specific Polkadot SDK version, you can use the `-c` or `--check` flag along with the `--version` flag followed by the version you want to check against. 28 | 29 | If you want to update the ORML crates in your local Cargo.toml, you can use the `-O` or `--orml` flag along with the `--version` flag to update the ORML crates along with the polkadot-sdk crates. This works only if the supplied version is present in the ORML releases. 30 | 31 | ```sh 32 | # Go to the directory containing the Cargo.toml file you want to update 33 | cd 34 | # Update to a specific Polkadot SDK version 35 | psvm -v "1.3.0" 36 | # You can also update an specific Cargo.toml file by passing its path 37 | psvm -v "1.4.0" -p /Cargo.toml 38 | # Overwrite local dependencies (with same name as Polkadot SDK crates) with crates.io versions 39 | psvm -v "1.7.0" -o 40 | # List all available Polkadot SDK versions 41 | psvm -l 42 | # Check against a particular Polkadot SDK version without updating the Cargo.toml file 43 | psvm -v "1.4.0" -c 44 | # Update the ORML dependencies along with the Polkadot SDK dependencies. 45 | psvm -v "1.6.0" -O 46 | ``` 47 | 48 | > Listing all available Polkadot SDK versions requires querying the GitHub API, so your IP may be rate-limited. If a rate limit is reached, the tool will fallback to the GitHub CLI to list the versions. Ensure you have the GitHub CLI installed and authenticated to avoid any issue. 49 | 50 | ## Workflow 51 | 52 | To update a `Cargo.toml`, the tool will fetch the `Plan.toml` file (used to publish crates into crates.io) from the release branch in Polkadot SDK associated to the version input (`--version` argument), generate a mapping (crate -> version) filtering all crates that were not published in this released (i.e. `publish = false`) **but keeping the [crates published by `parity-crate_owner`](https://crates.io/users/parity-crate-owner) (even if they were not published in this release)**, and overwrite the input Cargo.toml file to match the version from the mapping (i.e [v1.6.0 `Plan.toml`](https://raw.githubusercontent.com/paritytech/polkadot-sdk/release-crates-io-v1.6.0/Plan.toml)). 53 | 54 | In specific versions, the `Plan.toml` file may not exists (i.e. v1.3.0). In this case, the tool will fallback to the `Cargo.lock` file (i.e. [v1.3.0 `Cargo.lock`](https://raw.githubusercontent.com/paritytech/polkadot-sdk/release-crates-io-v1.3.0/Cargo.lock)) from the branch, generate a mapping using this file and overwrite the input Cargo.toml file to match the version from the mapping. The only concern to be aware in this scenario is that the `Cargo.lock` file may contain dependencies that are not published in crates.io, and the tool will not be able to filter them out cause it is not possible to determine if a crate is published or not (with this file). If you have a local dependency with a name similar to a crate not published, the tool will overwrite it, so be careful. Currently, this only happens with v1.3.0, but as the branches can change at any time, it is important to be aware of this. The tool will alert with a message "Failed to get Plan.toml, falling back to Cargo.lock." if this happens. 55 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Parity Technologies (UK) Ltd. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod tests; 17 | mod versions; 18 | 19 | use clap::Parser; 20 | use env_logger::Env; 21 | use std::{ 22 | collections::BTreeMap, 23 | fs, 24 | path::{Path, PathBuf}, 25 | }; 26 | use toml_edit::DocumentMut; 27 | use versions::{ 28 | get_orml_crates_and_version, get_polkadot_sdk_versions, get_release_branches_versions, 29 | get_version_mapping_with_fallback, include_orml_crates_in_version_mapping, Repository, 30 | }; 31 | 32 | pub const DEFAULT_GIT_SERVER: &str = "https://raw.githubusercontent.com"; 33 | 34 | /// Polkadot SDK Version Manager. 35 | /// 36 | /// Updates Cargo.toml dependencies based on Polkadot SDK crates.io release branch. 37 | #[derive(Parser, Debug)] 38 | #[command(about, author)] 39 | struct Command { 40 | /// Path to a crate folder or Cargo.toml file. 41 | #[clap(short, long, default_value = "Cargo.toml")] 42 | path: PathBuf, 43 | 44 | /// Specifies the Polkadot SDK version. Use '--list' flag to display available versions. 45 | #[clap(short, long, required_unless_present = "list")] 46 | version: Option, 47 | 48 | /// Overwrite local dependencies (using path) with same name as the ones in the Polkadot SDK. 49 | #[clap(short, long)] 50 | overwrite: bool, 51 | 52 | /// List available versions. 53 | #[clap(short, long)] 54 | list: bool, 55 | 56 | /// Check if the dependencies versions match the Polkadot SDK version. Does not update the Cargo.toml 57 | #[clap(short, long)] 58 | check: bool, 59 | 60 | /// To either list available ORML versions or update the Cargo.toml file with corresponding ORML versions. 61 | #[clap(short('O'), long)] 62 | orml: bool, 63 | } 64 | 65 | #[tokio::main] 66 | async fn main() -> Result<(), Box> { 67 | env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); 68 | let cmd = Command::parse(); 69 | 70 | if cmd.list { 71 | let crates_versions = if cmd.orml { 72 | get_release_branches_versions(Repository::Orml).await? 73 | } else { 74 | get_polkadot_sdk_versions().await? 75 | }; 76 | 77 | println!("Available versions:"); 78 | for version in crates_versions.iter() { 79 | println!("- {}", version); 80 | } 81 | return Ok(()); 82 | } 83 | 84 | let version = cmd.version.unwrap(); // Safe to unwrap due to `required_unless_present` 85 | 86 | let cargo_toml_path = validate_workspace_path(cmd.path)?; 87 | 88 | // Decide which branch data to use based on the branch name 89 | let mut crates_versions: BTreeMap = 90 | get_version_mapping_with_fallback(DEFAULT_GIT_SERVER, &version).await?; 91 | 92 | if cmd.orml { 93 | let orml_crates = get_orml_crates_and_version(DEFAULT_GIT_SERVER, &version).await?; 94 | include_orml_crates_in_version_mapping(&mut crates_versions, orml_crates); 95 | } 96 | 97 | update_dependencies(&cargo_toml_path, &crates_versions, cmd.overwrite, cmd.check)?; 98 | 99 | Ok(()) 100 | } 101 | 102 | fn validate_workspace_path(mut path: PathBuf) -> Result> { 103 | if path.is_dir() { 104 | path = path.join("Cargo.toml"); 105 | } 106 | 107 | if !path.exists() { 108 | return Err(format!( 109 | "Could not find workspace root Cargo.toml file at {}", 110 | path.display() 111 | ) 112 | .into()); 113 | } 114 | 115 | Ok(path) 116 | } 117 | 118 | fn update_dependencies( 119 | cargo_toml_path: &Path, 120 | crates_versions: &BTreeMap, 121 | overwrite: bool, 122 | only_check: bool, 123 | ) -> Result<(), Box> { 124 | let cargo_toml = 125 | update_dependencies_impl(cargo_toml_path, crates_versions, overwrite, only_check)?; 126 | 127 | match cargo_toml { 128 | Some(new_content) => { 129 | fs::write(cargo_toml_path, new_content)?; 130 | println!("Updated dependencies in {}", cargo_toml_path.display()); 131 | } 132 | None => { 133 | println!( 134 | "Dependencies in {} are already up to date", 135 | cargo_toml_path.display() 136 | ); 137 | } 138 | } 139 | 140 | Ok(()) 141 | } 142 | 143 | fn update_dependencies_impl( 144 | cargo_toml_path: &Path, 145 | crates_versions: &BTreeMap, 146 | overwrite: bool, 147 | only_check: bool, 148 | ) -> Result, Box> { 149 | let cargo_toml_content = fs::read_to_string(cargo_toml_path)?; 150 | let mut cargo_toml: DocumentMut = cargo_toml_content.parse()?; 151 | // Check if cargo workspace is defined 152 | let deps = match cargo_toml.as_table_mut().get_mut("workspace") { 153 | Some(toml_edit::Item::Table(table)) => table, 154 | _ => cargo_toml.as_table_mut(), 155 | }; 156 | 157 | for table in ["dependencies", "dev-dependencies", "build-dependencies"].iter() { 158 | if let Some(toml_edit::Item::Table(dep_table)) = deps.get_mut(table) { 159 | update_table_dependencies(dep_table, crates_versions, overwrite); 160 | } 161 | } 162 | 163 | let new_content = cargo_toml.to_string(); 164 | if new_content != cargo_toml_content { 165 | if only_check { 166 | Err("Dependencies are not up to date".into()) 167 | } else { 168 | Ok(Some(new_content)) 169 | } 170 | } else { 171 | Ok(None) 172 | } 173 | } 174 | 175 | pub fn update_table_dependencies( 176 | dep_table: &mut toml_edit::Table, 177 | crates_versions: &BTreeMap, 178 | overwrite: bool, 179 | ) { 180 | for (dep_key, dep_value) in dep_table.iter_mut() { 181 | let dep_key_str = dep_key.get(); 182 | 183 | // account for dep renaming: 184 | let lookup_key = if let Some(table) = dep_value.as_table_like() { 185 | table 186 | .get("package") 187 | .and_then(|p| p.as_str()) 188 | .unwrap_or(dep_key_str) 189 | } else { 190 | dep_key_str 191 | }; 192 | 193 | let Some(crate_version) = crates_versions.get(lookup_key) else { 194 | log::debug!("Could not find version for {}", lookup_key); 195 | continue; 196 | }; 197 | 198 | if let Some(table) = dep_value.as_table_like_mut() { 199 | if !overwrite && table.get("path").is_some() { 200 | continue; 201 | } 202 | 203 | table.remove("rev"); 204 | table.remove("branch"); 205 | table.remove("tag"); 206 | table.remove("path"); 207 | table.remove("git"); 208 | 209 | let mut new_table = toml_edit::InlineTable::default(); 210 | 211 | // Directly create a `toml_edit::Value` for the version 212 | new_table.get_or_insert( 213 | "version", 214 | toml_edit::value(crate_version.clone()).as_value().unwrap(), 215 | ); 216 | 217 | for (key, value) in table.iter() { 218 | // Ensure we're inserting `Value`s, not `Item`s 219 | if key != "version" && value.is_value() { 220 | new_table.get_or_insert(key, value.as_value().unwrap().clone()); 221 | } 222 | } 223 | new_table.fmt(); 224 | 225 | // Replace the original table-like item with the new inline table 226 | *dep_value = toml_edit::Item::Value(toml_edit::Value::InlineTable(new_table)); 227 | } else if dep_value.is_str() { 228 | *dep_value = toml_edit::value(crate_version.clone()); 229 | } else { 230 | log::error!("Unexpected dependency value type for {}", dep_key_str); 231 | continue; 232 | } 233 | 234 | log::debug!("Setting {} to {}", dep_key_str, crate_version); 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /src/testing/cargo-lock/input.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", optional = true, version = "14.0.0" } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 24 | 25 | # Substrate 26 | frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 27 | frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 28 | frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 29 | frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 30 | frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 31 | frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 32 | frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 33 | pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 34 | pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 35 | pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 36 | pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 37 | pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 38 | pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 39 | pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 40 | pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 41 | sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 42 | sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 43 | sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 44 | sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 45 | sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 46 | sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 47 | sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 48 | sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 49 | sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 50 | sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 51 | sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 52 | sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 53 | 54 | # Polkadot 55 | pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 56 | polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 57 | polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 58 | xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 59 | xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 60 | xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 61 | 62 | # Cumulus 63 | cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 64 | cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 65 | cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, features = ["parameterized-consensus-hook"] } 66 | cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 67 | cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 68 | cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 69 | cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 70 | cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 71 | pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 72 | parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 73 | 74 | [features] 75 | default = [ "std" ] 76 | std = [ 77 | "codec/std", 78 | "cumulus-pallet-aura-ext/std", 79 | "cumulus-pallet-dmp-queue/std", 80 | "cumulus-pallet-parachain-system/std", 81 | "cumulus-pallet-session-benchmarking/std", 82 | "cumulus-pallet-xcm/std", 83 | "cumulus-pallet-xcmp-queue/std", 84 | "cumulus-primitives-core/std", 85 | "cumulus-primitives-utility/std", 86 | "frame-benchmarking?/std", 87 | "frame-executive/std", 88 | "frame-support/std", 89 | "frame-system-benchmarking?/std", 90 | "frame-system-rpc-runtime-api/std", 91 | "frame-system/std", 92 | "frame-try-runtime?/std", 93 | "log/std", 94 | "pallet-aura/std", 95 | "pallet-authorship/std", 96 | "pallet-balances/std", 97 | "pallet-collator-selection/std", 98 | "pallet-parachain-template/std", 99 | "pallet-session/std", 100 | "pallet-sudo/std", 101 | "pallet-timestamp/std", 102 | "pallet-transaction-payment-rpc-runtime-api/std", 103 | "pallet-transaction-payment/std", 104 | "pallet-xcm/std", 105 | "parachain-info/std", 106 | "polkadot-parachain-primitives/std", 107 | "polkadot-runtime-common/std", 108 | "scale-info/std", 109 | "sp-api/std", 110 | "sp-block-builder/std", 111 | "sp-consensus-aura/std", 112 | "sp-core/std", 113 | "sp-genesis-builder/std", 114 | "sp-inherents/std", 115 | "sp-offchain/std", 116 | "sp-runtime/std", 117 | "sp-session/std", 118 | "sp-std/std", 119 | "sp-transaction-pool/std", 120 | "sp-version/std", 121 | "substrate-wasm-builder", 122 | "xcm-builder/std", 123 | "xcm-executor/std", 124 | "xcm/std", 125 | ] 126 | 127 | runtime-benchmarks = [ 128 | "cumulus-pallet-parachain-system/runtime-benchmarks", 129 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 130 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 131 | "cumulus-primitives-utility/runtime-benchmarks", 132 | "frame-benchmarking/runtime-benchmarks", 133 | "frame-support/runtime-benchmarks", 134 | "frame-system-benchmarking/runtime-benchmarks", 135 | "frame-system/runtime-benchmarks", 136 | "hex-literal", 137 | "pallet-balances/runtime-benchmarks", 138 | "pallet-collator-selection/runtime-benchmarks", 139 | "pallet-parachain-template/runtime-benchmarks", 140 | "pallet-sudo/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-xcm/runtime-benchmarks", 143 | "polkadot-parachain-primitives/runtime-benchmarks", 144 | "polkadot-runtime-common/runtime-benchmarks", 145 | "sp-runtime/runtime-benchmarks", 146 | "xcm-builder/runtime-benchmarks", 147 | "xcm-executor/runtime-benchmarks", 148 | ] 149 | 150 | try-runtime = [ 151 | "cumulus-pallet-aura-ext/try-runtime", 152 | "cumulus-pallet-dmp-queue/try-runtime", 153 | "cumulus-pallet-parachain-system/try-runtime", 154 | "cumulus-pallet-xcm/try-runtime", 155 | "cumulus-pallet-xcmp-queue/try-runtime", 156 | "frame-executive/try-runtime", 157 | "frame-support/try-runtime", 158 | "frame-system/try-runtime", 159 | "frame-try-runtime/try-runtime", 160 | "pallet-aura/try-runtime", 161 | "pallet-authorship/try-runtime", 162 | "pallet-balances/try-runtime", 163 | "pallet-collator-selection/try-runtime", 164 | "pallet-parachain-template/try-runtime", 165 | "pallet-session/try-runtime", 166 | "pallet-sudo/try-runtime", 167 | "pallet-timestamp/try-runtime", 168 | "pallet-transaction-payment/try-runtime", 169 | "pallet-xcm/try-runtime", 170 | "parachain-info/try-runtime", 171 | "polkadot-runtime-common/try-runtime", 172 | "sp-runtime/try-runtime", 173 | ] 174 | 175 | experimental = [ "pallet-aura/experimental" ] 176 | -------------------------------------------------------------------------------- /src/testing/cargo-lock/output.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "14.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.4.0", default-features = false } 24 | 25 | # Substrate 26 | frame-benchmarking = { version = "25.0.0", default-features = false, optional = true } 27 | frame-executive = { version = "25.0.0", default-features = false } 28 | frame-support = { version = "25.0.0", default-features = false } 29 | frame-system = { version = "25.0.0", default-features = false } 30 | frame-system-benchmarking = { version = "25.0.0", default-features = false, optional = true } 31 | frame-system-rpc-runtime-api = { version = "23.0.0", default-features = false } 32 | frame-try-runtime = { version = "0.31.0", default-features = false, optional = true } 33 | pallet-aura = { version = "24.0.0", default-features = false } 34 | pallet-authorship = { version = "25.0.0", default-features = false } 35 | pallet-balances = { version = "25.0.0", default-features = false } 36 | pallet-session = { version = "25.0.0", default-features = false } 37 | pallet-sudo = { version = "25.0.0", default-features = false } 38 | pallet-timestamp = { version = "24.0.0", default-features = false } 39 | pallet-transaction-payment = { version = "25.0.0", default-features = false } 40 | pallet-transaction-payment-rpc-runtime-api = { version = "25.0.0", default-features = false } 41 | sp-api = { version = "23.0.0", default-features = false } 42 | sp-block-builder = { version = "23.0.0", default-features = false } 43 | sp-consensus-aura = { version = "0.29.0", default-features = false } 44 | sp-core = { version = "25.0.0", default-features = false } 45 | sp-genesis-builder = { version = "0.4.0", default-features = false } 46 | sp-inherents = { version = "23.0.0", default-features = false } 47 | sp-offchain = { version = "23.0.0", default-features = false } 48 | sp-runtime = { version = "28.0.0", default-features = false } 49 | sp-session = { version = "24.0.0", default-features = false } 50 | sp-std = { version = "12.0.0", default-features = false } 51 | sp-transaction-pool = { version = "23.0.0", default-features = false } 52 | sp-version = { version = "26.0.0", default-features = false } 53 | 54 | # Polkadot 55 | pallet-xcm = { version = "4.0.0", default-features = false } 56 | polkadot-parachain-primitives = { version = "3.0.0", default-features = false } 57 | polkadot-runtime-common = { version = "4.0.0", default-features = false } 58 | xcm = { version = "4.0.0", package = "staging-xcm", default-features = false } 59 | xcm-builder = { version = "4.0.1", package = "staging-xcm-builder", default-features = false } 60 | xcm-executor = { version = "4.0.2", package = "staging-xcm-executor", default-features = false } 61 | 62 | # Cumulus 63 | cumulus-pallet-aura-ext = { version = "0.4.0", default-features = false } 64 | cumulus-pallet-dmp-queue = { version = "0.4.0", default-features = false } 65 | cumulus-pallet-parachain-system = { version = "0.4.1", default-features = false, features = ["parameterized-consensus-hook"] } 66 | cumulus-pallet-session-benchmarking = { version = "6.0.0", default-features = false } 67 | cumulus-pallet-xcm = { version = "0.4.0", default-features = false } 68 | cumulus-pallet-xcmp-queue = { version = "0.4.0", default-features = false } 69 | cumulus-primitives-core = { version = "0.4.0", default-features = false } 70 | cumulus-primitives-utility = { version = "0.4.1", default-features = false } 71 | pallet-collator-selection = { version = "6.0.0", default-features = false } 72 | parachain-info = { version = "0.4.0", package = "staging-parachain-info", default-features = false } 73 | 74 | [features] 75 | default = [ "std" ] 76 | std = [ 77 | "codec/std", 78 | "cumulus-pallet-aura-ext/std", 79 | "cumulus-pallet-dmp-queue/std", 80 | "cumulus-pallet-parachain-system/std", 81 | "cumulus-pallet-session-benchmarking/std", 82 | "cumulus-pallet-xcm/std", 83 | "cumulus-pallet-xcmp-queue/std", 84 | "cumulus-primitives-core/std", 85 | "cumulus-primitives-utility/std", 86 | "frame-benchmarking?/std", 87 | "frame-executive/std", 88 | "frame-support/std", 89 | "frame-system-benchmarking?/std", 90 | "frame-system-rpc-runtime-api/std", 91 | "frame-system/std", 92 | "frame-try-runtime?/std", 93 | "log/std", 94 | "pallet-aura/std", 95 | "pallet-authorship/std", 96 | "pallet-balances/std", 97 | "pallet-collator-selection/std", 98 | "pallet-parachain-template/std", 99 | "pallet-session/std", 100 | "pallet-sudo/std", 101 | "pallet-timestamp/std", 102 | "pallet-transaction-payment-rpc-runtime-api/std", 103 | "pallet-transaction-payment/std", 104 | "pallet-xcm/std", 105 | "parachain-info/std", 106 | "polkadot-parachain-primitives/std", 107 | "polkadot-runtime-common/std", 108 | "scale-info/std", 109 | "sp-api/std", 110 | "sp-block-builder/std", 111 | "sp-consensus-aura/std", 112 | "sp-core/std", 113 | "sp-genesis-builder/std", 114 | "sp-inherents/std", 115 | "sp-offchain/std", 116 | "sp-runtime/std", 117 | "sp-session/std", 118 | "sp-std/std", 119 | "sp-transaction-pool/std", 120 | "sp-version/std", 121 | "substrate-wasm-builder", 122 | "xcm-builder/std", 123 | "xcm-executor/std", 124 | "xcm/std", 125 | ] 126 | 127 | runtime-benchmarks = [ 128 | "cumulus-pallet-parachain-system/runtime-benchmarks", 129 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 130 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 131 | "cumulus-primitives-utility/runtime-benchmarks", 132 | "frame-benchmarking/runtime-benchmarks", 133 | "frame-support/runtime-benchmarks", 134 | "frame-system-benchmarking/runtime-benchmarks", 135 | "frame-system/runtime-benchmarks", 136 | "hex-literal", 137 | "pallet-balances/runtime-benchmarks", 138 | "pallet-collator-selection/runtime-benchmarks", 139 | "pallet-parachain-template/runtime-benchmarks", 140 | "pallet-sudo/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-xcm/runtime-benchmarks", 143 | "polkadot-parachain-primitives/runtime-benchmarks", 144 | "polkadot-runtime-common/runtime-benchmarks", 145 | "sp-runtime/runtime-benchmarks", 146 | "xcm-builder/runtime-benchmarks", 147 | "xcm-executor/runtime-benchmarks", 148 | ] 149 | 150 | try-runtime = [ 151 | "cumulus-pallet-aura-ext/try-runtime", 152 | "cumulus-pallet-dmp-queue/try-runtime", 153 | "cumulus-pallet-parachain-system/try-runtime", 154 | "cumulus-pallet-xcm/try-runtime", 155 | "cumulus-pallet-xcmp-queue/try-runtime", 156 | "frame-executive/try-runtime", 157 | "frame-support/try-runtime", 158 | "frame-system/try-runtime", 159 | "frame-try-runtime/try-runtime", 160 | "pallet-aura/try-runtime", 161 | "pallet-authorship/try-runtime", 162 | "pallet-balances/try-runtime", 163 | "pallet-collator-selection/try-runtime", 164 | "pallet-parachain-template/try-runtime", 165 | "pallet-session/try-runtime", 166 | "pallet-sudo/try-runtime", 167 | "pallet-timestamp/try-runtime", 168 | "pallet-transaction-payment/try-runtime", 169 | "pallet-xcm/try-runtime", 170 | "parachain-info/try-runtime", 171 | "polkadot-runtime-common/try-runtime", 172 | "sp-runtime/try-runtime", 173 | ] 174 | 175 | experimental = [ "pallet-aura/experimental" ] 176 | -------------------------------------------------------------------------------- /src/testing/orml/input.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", optional = true, version = "14.0.0" } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 24 | 25 | # ORML 26 | orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 27 | orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 28 | orml-authority = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 29 | orml-nft = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 30 | orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 31 | 32 | # Substrate 33 | frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 34 | frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 35 | frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 36 | frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 37 | frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 38 | frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 39 | frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 40 | pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 41 | pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 42 | pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 43 | pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 44 | pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 45 | pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 46 | pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 47 | pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 48 | sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 49 | sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 50 | sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 51 | sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 52 | sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 53 | sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 54 | sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 55 | sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 56 | sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 57 | sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 58 | sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 59 | sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 60 | 61 | # Polkadot 62 | pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 63 | polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 64 | polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 65 | xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 66 | xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 67 | xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 68 | 69 | # Cumulus 70 | cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 71 | cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 72 | cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, features = ["parameterized-consensus-hook"] } 73 | cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 74 | cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 75 | cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 76 | cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 77 | cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 78 | pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 79 | parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 80 | 81 | [features] 82 | default = [ "std" ] 83 | std = [ 84 | "codec/std", 85 | "cumulus-pallet-aura-ext/std", 86 | "cumulus-pallet-dmp-queue/std", 87 | "cumulus-pallet-parachain-system/std", 88 | "cumulus-pallet-session-benchmarking/std", 89 | "cumulus-pallet-xcm/std", 90 | "cumulus-pallet-xcmp-queue/std", 91 | "cumulus-primitives-core/std", 92 | "cumulus-primitives-utility/std", 93 | "frame-benchmarking?/std", 94 | "frame-executive/std", 95 | "frame-support/std", 96 | "frame-system-benchmarking?/std", 97 | "frame-system-rpc-runtime-api/std", 98 | "frame-system/std", 99 | "frame-try-runtime?/std", 100 | "log/std", 101 | "pallet-aura/std", 102 | "pallet-authorship/std", 103 | "pallet-balances/std", 104 | "pallet-collator-selection/std", 105 | "pallet-parachain-template/std", 106 | "pallet-session/std", 107 | "pallet-sudo/std", 108 | "pallet-timestamp/std", 109 | "pallet-transaction-payment-rpc-runtime-api/std", 110 | "pallet-transaction-payment/std", 111 | "pallet-xcm/std", 112 | "parachain-info/std", 113 | "polkadot-parachain-primitives/std", 114 | "polkadot-runtime-common/std", 115 | "scale-info/std", 116 | "sp-api/std", 117 | "sp-block-builder/std", 118 | "sp-consensus-aura/std", 119 | "sp-core/std", 120 | "sp-genesis-builder/std", 121 | "sp-inherents/std", 122 | "sp-offchain/std", 123 | "sp-runtime/std", 124 | "sp-session/std", 125 | "sp-std/std", 126 | "sp-transaction-pool/std", 127 | "sp-version/std", 128 | "substrate-wasm-builder", 129 | "xcm-builder/std", 130 | "xcm-executor/std", 131 | "xcm/std", 132 | ] 133 | 134 | runtime-benchmarks = [ 135 | "cumulus-pallet-parachain-system/runtime-benchmarks", 136 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 137 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 138 | "cumulus-primitives-utility/runtime-benchmarks", 139 | "frame-benchmarking/runtime-benchmarks", 140 | "frame-support/runtime-benchmarks", 141 | "frame-system-benchmarking/runtime-benchmarks", 142 | "frame-system/runtime-benchmarks", 143 | "hex-literal", 144 | "pallet-balances/runtime-benchmarks", 145 | "pallet-collator-selection/runtime-benchmarks", 146 | "pallet-parachain-template/runtime-benchmarks", 147 | "pallet-sudo/runtime-benchmarks", 148 | "pallet-timestamp/runtime-benchmarks", 149 | "pallet-xcm/runtime-benchmarks", 150 | "polkadot-parachain-primitives/runtime-benchmarks", 151 | "polkadot-runtime-common/runtime-benchmarks", 152 | "sp-runtime/runtime-benchmarks", 153 | "xcm-builder/runtime-benchmarks", 154 | "xcm-executor/runtime-benchmarks", 155 | ] 156 | 157 | try-runtime = [ 158 | "cumulus-pallet-aura-ext/try-runtime", 159 | "cumulus-pallet-dmp-queue/try-runtime", 160 | "cumulus-pallet-parachain-system/try-runtime", 161 | "cumulus-pallet-xcm/try-runtime", 162 | "cumulus-pallet-xcmp-queue/try-runtime", 163 | "frame-executive/try-runtime", 164 | "frame-support/try-runtime", 165 | "frame-system/try-runtime", 166 | "frame-try-runtime/try-runtime", 167 | "pallet-aura/try-runtime", 168 | "pallet-authorship/try-runtime", 169 | "pallet-balances/try-runtime", 170 | "pallet-collator-selection/try-runtime", 171 | "pallet-parachain-template/try-runtime", 172 | "pallet-session/try-runtime", 173 | "pallet-sudo/try-runtime", 174 | "pallet-timestamp/try-runtime", 175 | "pallet-transaction-payment/try-runtime", 176 | "pallet-xcm/try-runtime", 177 | "parachain-info/try-runtime", 178 | "polkadot-runtime-common/try-runtime", 179 | "sp-runtime/try-runtime", 180 | ] 181 | 182 | experimental = [ "pallet-aura/experimental" ] 183 | -------------------------------------------------------------------------------- /src/testing/orml/noFlag.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "17.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.7.0", default-features = false } 24 | 25 | # ORML 26 | orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 27 | orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 28 | orml-authority = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 29 | orml-nft = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 30 | orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 31 | 32 | # Substrate 33 | frame-benchmarking = { version = "28.0.0", default-features = false, optional = true } 34 | frame-executive = { version = "28.0.0", default-features = false } 35 | frame-support = { version = "28.0.0", default-features = false } 36 | frame-system = { version = "28.0.0", default-features = false } 37 | frame-system-benchmarking = { version = "28.0.0", default-features = false, optional = true } 38 | frame-system-rpc-runtime-api = { version = "26.0.0", default-features = false } 39 | frame-try-runtime = { version = "0.34.0", default-features = false, optional = true } 40 | pallet-aura = { version = "27.0.0", default-features = false } 41 | pallet-authorship = { version = "28.0.0", default-features = false } 42 | pallet-balances = { version = "28.0.0", default-features = false } 43 | pallet-session = { version = "28.0.0", default-features = false } 44 | pallet-sudo = { version = "28.0.0", default-features = false } 45 | pallet-timestamp = { version = "27.0.0", default-features = false } 46 | pallet-transaction-payment = { version = "28.0.0", default-features = false } 47 | pallet-transaction-payment-rpc-runtime-api = { version = "28.0.0", default-features = false } 48 | sp-api = { version = "26.0.0", default-features = false } 49 | sp-block-builder = { version = "26.0.0", default-features = false } 50 | sp-consensus-aura = { version = "0.32.0", default-features = false } 51 | sp-core = { version = "28.0.0", default-features = false } 52 | sp-genesis-builder = { version = "0.7.0", default-features = false } 53 | sp-inherents = { version = "26.0.0", default-features = false } 54 | sp-offchain = { version = "26.0.0", default-features = false } 55 | sp-runtime = { version = "31.0.0", default-features = false } 56 | sp-session = { version = "27.0.0", default-features = false } 57 | sp-std = { version = "14.0.0", default-features = false } 58 | sp-transaction-pool = { version = "26.0.0", default-features = false } 59 | sp-version = { version = "29.0.0", default-features = false } 60 | 61 | # Polkadot 62 | pallet-xcm = { version = "7.0.0", default-features = false } 63 | polkadot-parachain-primitives = { version = "6.0.0", default-features = false } 64 | polkadot-runtime-common = { version = "7.0.0", default-features = false } 65 | xcm = { version = "7.0.0", package = "staging-xcm", default-features = false } 66 | xcm-builder = { version = "7.0.3", package = "staging-xcm-builder", default-features = false } 67 | xcm-executor = { version = "7.0.3", package = "staging-xcm-executor", default-features = false } 68 | 69 | # Cumulus 70 | cumulus-pallet-aura-ext = { version = "0.7.0", default-features = false } 71 | cumulus-pallet-dmp-queue = { version = "0.7.0", default-features = false } 72 | cumulus-pallet-parachain-system = { version = "0.7.0", default-features = false, features = ["parameterized-consensus-hook"] } 73 | cumulus-pallet-session-benchmarking = { version = "9.0.0", default-features = false } 74 | cumulus-pallet-xcm = { version = "0.7.0", default-features = false } 75 | cumulus-pallet-xcmp-queue = { version = "0.7.0", default-features = false } 76 | cumulus-primitives-core = { version = "0.7.0", default-features = false } 77 | cumulus-primitives-utility = { version = "0.7.3", default-features = false } 78 | pallet-collator-selection = { version = "9.0.2", default-features = false } 79 | parachain-info = { version = "0.7.0", package = "staging-parachain-info", default-features = false } 80 | 81 | [features] 82 | default = [ "std" ] 83 | std = [ 84 | "codec/std", 85 | "cumulus-pallet-aura-ext/std", 86 | "cumulus-pallet-dmp-queue/std", 87 | "cumulus-pallet-parachain-system/std", 88 | "cumulus-pallet-session-benchmarking/std", 89 | "cumulus-pallet-xcm/std", 90 | "cumulus-pallet-xcmp-queue/std", 91 | "cumulus-primitives-core/std", 92 | "cumulus-primitives-utility/std", 93 | "frame-benchmarking?/std", 94 | "frame-executive/std", 95 | "frame-support/std", 96 | "frame-system-benchmarking?/std", 97 | "frame-system-rpc-runtime-api/std", 98 | "frame-system/std", 99 | "frame-try-runtime?/std", 100 | "log/std", 101 | "pallet-aura/std", 102 | "pallet-authorship/std", 103 | "pallet-balances/std", 104 | "pallet-collator-selection/std", 105 | "pallet-parachain-template/std", 106 | "pallet-session/std", 107 | "pallet-sudo/std", 108 | "pallet-timestamp/std", 109 | "pallet-transaction-payment-rpc-runtime-api/std", 110 | "pallet-transaction-payment/std", 111 | "pallet-xcm/std", 112 | "parachain-info/std", 113 | "polkadot-parachain-primitives/std", 114 | "polkadot-runtime-common/std", 115 | "scale-info/std", 116 | "sp-api/std", 117 | "sp-block-builder/std", 118 | "sp-consensus-aura/std", 119 | "sp-core/std", 120 | "sp-genesis-builder/std", 121 | "sp-inherents/std", 122 | "sp-offchain/std", 123 | "sp-runtime/std", 124 | "sp-session/std", 125 | "sp-std/std", 126 | "sp-transaction-pool/std", 127 | "sp-version/std", 128 | "substrate-wasm-builder", 129 | "xcm-builder/std", 130 | "xcm-executor/std", 131 | "xcm/std", 132 | ] 133 | 134 | runtime-benchmarks = [ 135 | "cumulus-pallet-parachain-system/runtime-benchmarks", 136 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 137 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 138 | "cumulus-primitives-utility/runtime-benchmarks", 139 | "frame-benchmarking/runtime-benchmarks", 140 | "frame-support/runtime-benchmarks", 141 | "frame-system-benchmarking/runtime-benchmarks", 142 | "frame-system/runtime-benchmarks", 143 | "hex-literal", 144 | "pallet-balances/runtime-benchmarks", 145 | "pallet-collator-selection/runtime-benchmarks", 146 | "pallet-parachain-template/runtime-benchmarks", 147 | "pallet-sudo/runtime-benchmarks", 148 | "pallet-timestamp/runtime-benchmarks", 149 | "pallet-xcm/runtime-benchmarks", 150 | "polkadot-parachain-primitives/runtime-benchmarks", 151 | "polkadot-runtime-common/runtime-benchmarks", 152 | "sp-runtime/runtime-benchmarks", 153 | "xcm-builder/runtime-benchmarks", 154 | "xcm-executor/runtime-benchmarks", 155 | ] 156 | 157 | try-runtime = [ 158 | "cumulus-pallet-aura-ext/try-runtime", 159 | "cumulus-pallet-dmp-queue/try-runtime", 160 | "cumulus-pallet-parachain-system/try-runtime", 161 | "cumulus-pallet-xcm/try-runtime", 162 | "cumulus-pallet-xcmp-queue/try-runtime", 163 | "frame-executive/try-runtime", 164 | "frame-support/try-runtime", 165 | "frame-system/try-runtime", 166 | "frame-try-runtime/try-runtime", 167 | "pallet-aura/try-runtime", 168 | "pallet-authorship/try-runtime", 169 | "pallet-balances/try-runtime", 170 | "pallet-collator-selection/try-runtime", 171 | "pallet-parachain-template/try-runtime", 172 | "pallet-session/try-runtime", 173 | "pallet-sudo/try-runtime", 174 | "pallet-timestamp/try-runtime", 175 | "pallet-transaction-payment/try-runtime", 176 | "pallet-xcm/try-runtime", 177 | "parachain-info/try-runtime", 178 | "polkadot-runtime-common/try-runtime", 179 | "sp-runtime/try-runtime", 180 | ] 181 | 182 | experimental = [ "pallet-aura/experimental" ] 183 | -------------------------------------------------------------------------------- /src/testing/orml/notOrml.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "23.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.1.0", default-features = false } 24 | 25 | # ORML 26 | orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 27 | orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 28 | orml-authority = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 29 | orml-nft = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 30 | orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } 31 | 32 | # Substrate 33 | frame-benchmarking = { version = "36.0.0", default-features = false, optional = true } 34 | frame-executive = { version = "36.0.0", default-features = false } 35 | frame-support = { version = "36.0.0", default-features = false } 36 | frame-system = { version = "36.1.0", default-features = false } 37 | frame-system-benchmarking = { version = "36.0.0", default-features = false, optional = true } 38 | frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false } 39 | frame-try-runtime = { version = "0.42.0", default-features = false, optional = true } 40 | pallet-aura = { version = "35.0.0", default-features = false } 41 | pallet-authorship = { version = "36.0.0", default-features = false } 42 | pallet-balances = { version = "37.0.0", default-features = false } 43 | pallet-session = { version = "36.0.0", default-features = false } 44 | pallet-sudo = { version = "36.0.0", default-features = false } 45 | pallet-timestamp = { version = "35.0.0", default-features = false } 46 | pallet-transaction-payment = { version = "36.0.0", default-features = false } 47 | pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", default-features = false } 48 | sp-api = { version = "33.0.0", default-features = false } 49 | sp-block-builder = { version = "33.0.0", default-features = false } 50 | sp-consensus-aura = { version = "0.39.0", default-features = false } 51 | sp-core = { version = "34.0.0", default-features = false } 52 | sp-genesis-builder = { version = "0.14.0", default-features = false } 53 | sp-inherents = { version = "33.0.0", default-features = false } 54 | sp-offchain = { version = "33.0.0", default-features = false } 55 | sp-runtime = { version = "38.0.0", default-features = false } 56 | sp-session = { version = "34.0.0", default-features = false } 57 | sp-std = { version = "14.0.0", default-features = false } 58 | sp-transaction-pool = { version = "33.0.0", default-features = false } 59 | sp-version = { version = "36.0.0", default-features = false } 60 | 61 | # Polkadot 62 | pallet-xcm = { version = "15.0.0", default-features = false } 63 | polkadot-parachain-primitives = { version = "13.0.0", default-features = false } 64 | polkadot-runtime-common = { version = "15.0.0", default-features = false } 65 | xcm = { version = "14.0.3", package = "staging-xcm", default-features = false } 66 | xcm-builder = { version = "15.0.0", package = "staging-xcm-builder", default-features = false } 67 | xcm-executor = { version = "15.0.0", package = "staging-xcm-executor", default-features = false } 68 | 69 | # Cumulus 70 | cumulus-pallet-aura-ext = { version = "0.15.0", default-features = false } 71 | cumulus-pallet-dmp-queue = { version = "0.15.0", default-features = false } 72 | cumulus-pallet-parachain-system = { version = "0.15.0", default-features = false, features = ["parameterized-consensus-hook"] } 73 | cumulus-pallet-session-benchmarking = { version = "17.0.0", default-features = false } 74 | cumulus-pallet-xcm = { version = "0.15.0", default-features = false } 75 | cumulus-pallet-xcmp-queue = { version = "0.15.0", default-features = false } 76 | cumulus-primitives-core = { version = "0.14.0", default-features = false } 77 | cumulus-primitives-utility = { version = "0.15.0", default-features = false } 78 | pallet-collator-selection = { version = "17.0.0", default-features = false } 79 | parachain-info = { version = "0.15.0", package = "staging-parachain-info", default-features = false } 80 | 81 | [features] 82 | default = [ "std" ] 83 | std = [ 84 | "codec/std", 85 | "cumulus-pallet-aura-ext/std", 86 | "cumulus-pallet-dmp-queue/std", 87 | "cumulus-pallet-parachain-system/std", 88 | "cumulus-pallet-session-benchmarking/std", 89 | "cumulus-pallet-xcm/std", 90 | "cumulus-pallet-xcmp-queue/std", 91 | "cumulus-primitives-core/std", 92 | "cumulus-primitives-utility/std", 93 | "frame-benchmarking?/std", 94 | "frame-executive/std", 95 | "frame-support/std", 96 | "frame-system-benchmarking?/std", 97 | "frame-system-rpc-runtime-api/std", 98 | "frame-system/std", 99 | "frame-try-runtime?/std", 100 | "log/std", 101 | "pallet-aura/std", 102 | "pallet-authorship/std", 103 | "pallet-balances/std", 104 | "pallet-collator-selection/std", 105 | "pallet-parachain-template/std", 106 | "pallet-session/std", 107 | "pallet-sudo/std", 108 | "pallet-timestamp/std", 109 | "pallet-transaction-payment-rpc-runtime-api/std", 110 | "pallet-transaction-payment/std", 111 | "pallet-xcm/std", 112 | "parachain-info/std", 113 | "polkadot-parachain-primitives/std", 114 | "polkadot-runtime-common/std", 115 | "scale-info/std", 116 | "sp-api/std", 117 | "sp-block-builder/std", 118 | "sp-consensus-aura/std", 119 | "sp-core/std", 120 | "sp-genesis-builder/std", 121 | "sp-inherents/std", 122 | "sp-offchain/std", 123 | "sp-runtime/std", 124 | "sp-session/std", 125 | "sp-std/std", 126 | "sp-transaction-pool/std", 127 | "sp-version/std", 128 | "substrate-wasm-builder", 129 | "xcm-builder/std", 130 | "xcm-executor/std", 131 | "xcm/std", 132 | ] 133 | 134 | runtime-benchmarks = [ 135 | "cumulus-pallet-parachain-system/runtime-benchmarks", 136 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 137 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 138 | "cumulus-primitives-utility/runtime-benchmarks", 139 | "frame-benchmarking/runtime-benchmarks", 140 | "frame-support/runtime-benchmarks", 141 | "frame-system-benchmarking/runtime-benchmarks", 142 | "frame-system/runtime-benchmarks", 143 | "hex-literal", 144 | "pallet-balances/runtime-benchmarks", 145 | "pallet-collator-selection/runtime-benchmarks", 146 | "pallet-parachain-template/runtime-benchmarks", 147 | "pallet-sudo/runtime-benchmarks", 148 | "pallet-timestamp/runtime-benchmarks", 149 | "pallet-xcm/runtime-benchmarks", 150 | "polkadot-parachain-primitives/runtime-benchmarks", 151 | "polkadot-runtime-common/runtime-benchmarks", 152 | "sp-runtime/runtime-benchmarks", 153 | "xcm-builder/runtime-benchmarks", 154 | "xcm-executor/runtime-benchmarks", 155 | ] 156 | 157 | try-runtime = [ 158 | "cumulus-pallet-aura-ext/try-runtime", 159 | "cumulus-pallet-dmp-queue/try-runtime", 160 | "cumulus-pallet-parachain-system/try-runtime", 161 | "cumulus-pallet-xcm/try-runtime", 162 | "cumulus-pallet-xcmp-queue/try-runtime", 163 | "frame-executive/try-runtime", 164 | "frame-support/try-runtime", 165 | "frame-system/try-runtime", 166 | "frame-try-runtime/try-runtime", 167 | "pallet-aura/try-runtime", 168 | "pallet-authorship/try-runtime", 169 | "pallet-balances/try-runtime", 170 | "pallet-collator-selection/try-runtime", 171 | "pallet-parachain-template/try-runtime", 172 | "pallet-session/try-runtime", 173 | "pallet-sudo/try-runtime", 174 | "pallet-timestamp/try-runtime", 175 | "pallet-transaction-payment/try-runtime", 176 | "pallet-xcm/try-runtime", 177 | "parachain-info/try-runtime", 178 | "polkadot-runtime-common/try-runtime", 179 | "sp-runtime/try-runtime", 180 | ] 181 | 182 | experimental = [ "pallet-aura/experimental" ] 183 | -------------------------------------------------------------------------------- /src/testing/orml/output.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "17.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.7.0", default-features = false } 24 | 25 | # ORML 26 | orml-tokens = { version = "0.7.0", default-features = false } 27 | orml-xcm = { version = "0.7.0", default-features = false } 28 | orml-authority = { version = "0.7.0", default-features = false } 29 | orml-nft = { version = "0.7.0", default-features = false } 30 | orml-xtokens = { version = "0.7.0", default-features = false } 31 | 32 | # Substrate 33 | frame-benchmarking = { version = "28.0.0", default-features = false, optional = true } 34 | frame-executive = { version = "28.0.0", default-features = false } 35 | frame-support = { version = "28.0.0", default-features = false } 36 | frame-system = { version = "28.0.0", default-features = false } 37 | frame-system-benchmarking = { version = "28.0.0", default-features = false, optional = true } 38 | frame-system-rpc-runtime-api = { version = "26.0.0", default-features = false } 39 | frame-try-runtime = { version = "0.34.0", default-features = false, optional = true } 40 | pallet-aura = { version = "27.0.0", default-features = false } 41 | pallet-authorship = { version = "28.0.0", default-features = false } 42 | pallet-balances = { version = "28.0.0", default-features = false } 43 | pallet-session = { version = "28.0.0", default-features = false } 44 | pallet-sudo = { version = "28.0.0", default-features = false } 45 | pallet-timestamp = { version = "27.0.0", default-features = false } 46 | pallet-transaction-payment = { version = "28.0.0", default-features = false } 47 | pallet-transaction-payment-rpc-runtime-api = { version = "28.0.0", default-features = false } 48 | sp-api = { version = "26.0.0", default-features = false } 49 | sp-block-builder = { version = "26.0.0", default-features = false } 50 | sp-consensus-aura = { version = "0.32.0", default-features = false } 51 | sp-core = { version = "28.0.0", default-features = false } 52 | sp-genesis-builder = { version = "0.7.0", default-features = false } 53 | sp-inherents = { version = "26.0.0", default-features = false } 54 | sp-offchain = { version = "26.0.0", default-features = false } 55 | sp-runtime = { version = "31.0.0", default-features = false } 56 | sp-session = { version = "27.0.0", default-features = false } 57 | sp-std = { version = "14.0.0", default-features = false } 58 | sp-transaction-pool = { version = "26.0.0", default-features = false } 59 | sp-version = { version = "29.0.0", default-features = false } 60 | 61 | # Polkadot 62 | pallet-xcm = { version = "7.0.0", default-features = false } 63 | polkadot-parachain-primitives = { version = "6.0.0", default-features = false } 64 | polkadot-runtime-common = { version = "7.0.0", default-features = false } 65 | xcm = { version = "7.0.0", package = "staging-xcm", default-features = false } 66 | xcm-builder = { version = "7.0.3", package = "staging-xcm-builder", default-features = false } 67 | xcm-executor = { version = "7.0.3", package = "staging-xcm-executor", default-features = false } 68 | 69 | # Cumulus 70 | cumulus-pallet-aura-ext = { version = "0.7.0", default-features = false } 71 | cumulus-pallet-dmp-queue = { version = "0.7.0", default-features = false } 72 | cumulus-pallet-parachain-system = { version = "0.7.0", default-features = false, features = ["parameterized-consensus-hook"] } 73 | cumulus-pallet-session-benchmarking = { version = "9.0.0", default-features = false } 74 | cumulus-pallet-xcm = { version = "0.7.0", default-features = false } 75 | cumulus-pallet-xcmp-queue = { version = "0.7.0", default-features = false } 76 | cumulus-primitives-core = { version = "0.7.0", default-features = false } 77 | cumulus-primitives-utility = { version = "0.7.3", default-features = false } 78 | pallet-collator-selection = { version = "9.0.2", default-features = false } 79 | parachain-info = { version = "0.7.0", package = "staging-parachain-info", default-features = false } 80 | 81 | [features] 82 | default = [ "std" ] 83 | std = [ 84 | "codec/std", 85 | "cumulus-pallet-aura-ext/std", 86 | "cumulus-pallet-dmp-queue/std", 87 | "cumulus-pallet-parachain-system/std", 88 | "cumulus-pallet-session-benchmarking/std", 89 | "cumulus-pallet-xcm/std", 90 | "cumulus-pallet-xcmp-queue/std", 91 | "cumulus-primitives-core/std", 92 | "cumulus-primitives-utility/std", 93 | "frame-benchmarking?/std", 94 | "frame-executive/std", 95 | "frame-support/std", 96 | "frame-system-benchmarking?/std", 97 | "frame-system-rpc-runtime-api/std", 98 | "frame-system/std", 99 | "frame-try-runtime?/std", 100 | "log/std", 101 | "pallet-aura/std", 102 | "pallet-authorship/std", 103 | "pallet-balances/std", 104 | "pallet-collator-selection/std", 105 | "pallet-parachain-template/std", 106 | "pallet-session/std", 107 | "pallet-sudo/std", 108 | "pallet-timestamp/std", 109 | "pallet-transaction-payment-rpc-runtime-api/std", 110 | "pallet-transaction-payment/std", 111 | "pallet-xcm/std", 112 | "parachain-info/std", 113 | "polkadot-parachain-primitives/std", 114 | "polkadot-runtime-common/std", 115 | "scale-info/std", 116 | "sp-api/std", 117 | "sp-block-builder/std", 118 | "sp-consensus-aura/std", 119 | "sp-core/std", 120 | "sp-genesis-builder/std", 121 | "sp-inherents/std", 122 | "sp-offchain/std", 123 | "sp-runtime/std", 124 | "sp-session/std", 125 | "sp-std/std", 126 | "sp-transaction-pool/std", 127 | "sp-version/std", 128 | "substrate-wasm-builder", 129 | "xcm-builder/std", 130 | "xcm-executor/std", 131 | "xcm/std", 132 | ] 133 | 134 | runtime-benchmarks = [ 135 | "cumulus-pallet-parachain-system/runtime-benchmarks", 136 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 137 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 138 | "cumulus-primitives-utility/runtime-benchmarks", 139 | "frame-benchmarking/runtime-benchmarks", 140 | "frame-support/runtime-benchmarks", 141 | "frame-system-benchmarking/runtime-benchmarks", 142 | "frame-system/runtime-benchmarks", 143 | "hex-literal", 144 | "pallet-balances/runtime-benchmarks", 145 | "pallet-collator-selection/runtime-benchmarks", 146 | "pallet-parachain-template/runtime-benchmarks", 147 | "pallet-sudo/runtime-benchmarks", 148 | "pallet-timestamp/runtime-benchmarks", 149 | "pallet-xcm/runtime-benchmarks", 150 | "polkadot-parachain-primitives/runtime-benchmarks", 151 | "polkadot-runtime-common/runtime-benchmarks", 152 | "sp-runtime/runtime-benchmarks", 153 | "xcm-builder/runtime-benchmarks", 154 | "xcm-executor/runtime-benchmarks", 155 | ] 156 | 157 | try-runtime = [ 158 | "cumulus-pallet-aura-ext/try-runtime", 159 | "cumulus-pallet-dmp-queue/try-runtime", 160 | "cumulus-pallet-parachain-system/try-runtime", 161 | "cumulus-pallet-xcm/try-runtime", 162 | "cumulus-pallet-xcmp-queue/try-runtime", 163 | "frame-executive/try-runtime", 164 | "frame-support/try-runtime", 165 | "frame-system/try-runtime", 166 | "frame-try-runtime/try-runtime", 167 | "pallet-aura/try-runtime", 168 | "pallet-authorship/try-runtime", 169 | "pallet-balances/try-runtime", 170 | "pallet-collator-selection/try-runtime", 171 | "pallet-parachain-template/try-runtime", 172 | "pallet-session/try-runtime", 173 | "pallet-sudo/try-runtime", 174 | "pallet-timestamp/try-runtime", 175 | "pallet-transaction-payment/try-runtime", 176 | "pallet-xcm/try-runtime", 177 | "parachain-info/try-runtime", 178 | "polkadot-runtime-common/try-runtime", 179 | "sp-runtime/try-runtime", 180 | ] 181 | 182 | experimental = [ "pallet-aura/experimental" ] 183 | -------------------------------------------------------------------------------- /src/testing/plan-toml/check.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "23.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.1.0", default-features = false } 24 | 25 | # Substrate 26 | frame-benchmarking = { version = "36.0.0", default-features = false, optional = true } 27 | frame-executive = { version = "36.0.0", default-features = false } 28 | frame-support = { version = "36.0.0", default-features = false } 29 | frame-system = { version = "36.1.0", default-features = false } 30 | frame-system-benchmarking = { version = "36.0.0", default-features = false, optional = true } 31 | frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false } 32 | frame-try-runtime = { version = "0.42.0", default-features = false, optional = true } 33 | pallet-aura = { version = "35.0.0", default-features = false } 34 | pallet-authorship = { version = "36.0.0", default-features = false } 35 | pallet-balances = { version = "37.0.0", default-features = false } 36 | pallet-session = { version = "36.0.0", default-features = false } 37 | pallet-sudo = { version = "36.0.0", default-features = false } 38 | pallet-timestamp = { version = "35.0.0", default-features = false } 39 | pallet-transaction-payment = { version = "36.0.0", default-features = false } 40 | pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", default-features = false } 41 | sp-api = { version = "33.0.0", default-features = false } 42 | sp-block-builder = { version = "33.0.0", default-features = false } 43 | sp-consensus-aura = { version = "0.39.0", default-features = false } 44 | sp-core = { version = "34.0.0", default-features = false } 45 | sp-genesis-builder = { version = "0.14.0", default-features = false } 46 | sp-inherents = { version = "33.0.0", default-features = false } 47 | sp-offchain = { version = "33.0.0", default-features = false } 48 | sp-runtime = { version = "38.0.0", default-features = false } 49 | sp-session = { version = "34.0.0", default-features = false } 50 | sp-std = { version = "14.0.0", default-features = false } 51 | sp-transaction-pool = { version = "33.0.0", default-features = false } 52 | sp-version = { version = "36.0.0", default-features = false } 53 | 54 | # Polkadot 55 | pallet-xcm = { version = "15.0.0", default-features = false } 56 | polkadot-parachain-primitives = { version = "13.0.0", default-features = false } 57 | polkadot-runtime-common = { version = "15.0.0", default-features = false } 58 | xcm = { version = "14.0.3", package = "staging-xcm", default-features = false } 59 | xcm-builder = { version = "15.0.0", package = "staging-xcm-builder", default-features = false } 60 | xcm-executor = { version = "15.0.0", package = "staging-xcm-executor", default-features = false } 61 | 62 | # Cumulus 63 | cumulus-pallet-aura-ext = { version = "0.15.0", default-features = false } 64 | cumulus-pallet-dmp-queue = { version = "0.15.0", default-features = false } 65 | cumulus-pallet-parachain-system = { version = "0.15.0", default-features = false, features = ["parameterized-consensus-hook"] } 66 | cumulus-pallet-session-benchmarking = { version = "17.0.0", default-features = false } 67 | cumulus-pallet-xcm = { version = "0.15.0", default-features = false } 68 | cumulus-pallet-xcmp-queue = { version = "0.15.0", default-features = false } 69 | cumulus-primitives-core = { version = "0.14.0", default-features = false } 70 | cumulus-primitives-utility = { version = "0.15.0", default-features = false } 71 | pallet-collator-selection = { version = "17.0.0", default-features = false } 72 | parachain-info = { version = "0.15.0", package = "staging-parachain-info", default-features = false } 73 | 74 | [features] 75 | default = [ "std" ] 76 | std = [ 77 | "codec/std", 78 | "cumulus-pallet-aura-ext/std", 79 | "cumulus-pallet-dmp-queue/std", 80 | "cumulus-pallet-parachain-system/std", 81 | "cumulus-pallet-session-benchmarking/std", 82 | "cumulus-pallet-xcm/std", 83 | "cumulus-pallet-xcmp-queue/std", 84 | "cumulus-primitives-core/std", 85 | "cumulus-primitives-utility/std", 86 | "frame-benchmarking?/std", 87 | "frame-executive/std", 88 | "frame-support/std", 89 | "frame-system-benchmarking?/std", 90 | "frame-system-rpc-runtime-api/std", 91 | "frame-system/std", 92 | "frame-try-runtime?/std", 93 | "log/std", 94 | "pallet-aura/std", 95 | "pallet-authorship/std", 96 | "pallet-balances/std", 97 | "pallet-collator-selection/std", 98 | "pallet-parachain-template/std", 99 | "pallet-session/std", 100 | "pallet-sudo/std", 101 | "pallet-timestamp/std", 102 | "pallet-transaction-payment-rpc-runtime-api/std", 103 | "pallet-transaction-payment/std", 104 | "pallet-xcm/std", 105 | "parachain-info/std", 106 | "polkadot-parachain-primitives/std", 107 | "polkadot-runtime-common/std", 108 | "scale-info/std", 109 | "sp-api/std", 110 | "sp-block-builder/std", 111 | "sp-consensus-aura/std", 112 | "sp-core/std", 113 | "sp-genesis-builder/std", 114 | "sp-inherents/std", 115 | "sp-offchain/std", 116 | "sp-runtime/std", 117 | "sp-session/std", 118 | "sp-std/std", 119 | "sp-transaction-pool/std", 120 | "sp-version/std", 121 | "substrate-wasm-builder", 122 | "xcm-builder/std", 123 | "xcm-executor/std", 124 | "xcm/std", 125 | ] 126 | 127 | runtime-benchmarks = [ 128 | "cumulus-pallet-parachain-system/runtime-benchmarks", 129 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 130 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 131 | "cumulus-primitives-utility/runtime-benchmarks", 132 | "frame-benchmarking/runtime-benchmarks", 133 | "frame-support/runtime-benchmarks", 134 | "frame-system-benchmarking/runtime-benchmarks", 135 | "frame-system/runtime-benchmarks", 136 | "hex-literal", 137 | "pallet-balances/runtime-benchmarks", 138 | "pallet-collator-selection/runtime-benchmarks", 139 | "pallet-parachain-template/runtime-benchmarks", 140 | "pallet-sudo/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-xcm/runtime-benchmarks", 143 | "polkadot-parachain-primitives/runtime-benchmarks", 144 | "polkadot-runtime-common/runtime-benchmarks", 145 | "sp-runtime/runtime-benchmarks", 146 | "xcm-builder/runtime-benchmarks", 147 | "xcm-executor/runtime-benchmarks", 148 | ] 149 | 150 | try-runtime = [ 151 | "cumulus-pallet-aura-ext/try-runtime", 152 | "cumulus-pallet-dmp-queue/try-runtime", 153 | "cumulus-pallet-parachain-system/try-runtime", 154 | "cumulus-pallet-xcm/try-runtime", 155 | "cumulus-pallet-xcmp-queue/try-runtime", 156 | "frame-executive/try-runtime", 157 | "frame-support/try-runtime", 158 | "frame-system/try-runtime", 159 | "frame-try-runtime/try-runtime", 160 | "pallet-aura/try-runtime", 161 | "pallet-authorship/try-runtime", 162 | "pallet-balances/try-runtime", 163 | "pallet-collator-selection/try-runtime", 164 | "pallet-parachain-template/try-runtime", 165 | "pallet-session/try-runtime", 166 | "pallet-sudo/try-runtime", 167 | "pallet-timestamp/try-runtime", 168 | "pallet-transaction-payment/try-runtime", 169 | "pallet-xcm/try-runtime", 170 | "parachain-info/try-runtime", 171 | "polkadot-runtime-common/try-runtime", 172 | "sp-runtime/try-runtime", 173 | ] 174 | 175 | experimental = [ "pallet-aura/experimental" ] 176 | -------------------------------------------------------------------------------- /src/testing/plan-toml/input.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", optional = true, version = "14.0.0" } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 24 | 25 | # Substrate 26 | frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 27 | frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 28 | frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 29 | frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 30 | frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 31 | frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 32 | frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, optional = true } 33 | pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 34 | pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 35 | pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 36 | pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 37 | pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 38 | pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 39 | pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 40 | pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 41 | sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 42 | sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 43 | sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 44 | sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 45 | sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 46 | sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 47 | sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 48 | sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 49 | sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 50 | sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 51 | sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 52 | sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 53 | 54 | # Polkadot 55 | pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 56 | polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 57 | polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 58 | xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 59 | xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 60 | xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 61 | 62 | # Cumulus 63 | cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 64 | cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 65 | cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false, features = ["parameterized-consensus-hook"] } 66 | cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 67 | cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 68 | cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 69 | cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 70 | cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 71 | pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 72 | parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.3.0", default-features = false } 73 | 74 | [features] 75 | default = [ "std" ] 76 | std = [ 77 | "codec/std", 78 | "cumulus-pallet-aura-ext/std", 79 | "cumulus-pallet-dmp-queue/std", 80 | "cumulus-pallet-parachain-system/std", 81 | "cumulus-pallet-session-benchmarking/std", 82 | "cumulus-pallet-xcm/std", 83 | "cumulus-pallet-xcmp-queue/std", 84 | "cumulus-primitives-core/std", 85 | "cumulus-primitives-utility/std", 86 | "frame-benchmarking?/std", 87 | "frame-executive/std", 88 | "frame-support/std", 89 | "frame-system-benchmarking?/std", 90 | "frame-system-rpc-runtime-api/std", 91 | "frame-system/std", 92 | "frame-try-runtime?/std", 93 | "log/std", 94 | "pallet-aura/std", 95 | "pallet-authorship/std", 96 | "pallet-balances/std", 97 | "pallet-collator-selection/std", 98 | "pallet-parachain-template/std", 99 | "pallet-session/std", 100 | "pallet-sudo/std", 101 | "pallet-timestamp/std", 102 | "pallet-transaction-payment-rpc-runtime-api/std", 103 | "pallet-transaction-payment/std", 104 | "pallet-xcm/std", 105 | "parachain-info/std", 106 | "polkadot-parachain-primitives/std", 107 | "polkadot-runtime-common/std", 108 | "scale-info/std", 109 | "sp-api/std", 110 | "sp-block-builder/std", 111 | "sp-consensus-aura/std", 112 | "sp-core/std", 113 | "sp-genesis-builder/std", 114 | "sp-inherents/std", 115 | "sp-offchain/std", 116 | "sp-runtime/std", 117 | "sp-session/std", 118 | "sp-std/std", 119 | "sp-transaction-pool/std", 120 | "sp-version/std", 121 | "substrate-wasm-builder", 122 | "xcm-builder/std", 123 | "xcm-executor/std", 124 | "xcm/std", 125 | ] 126 | 127 | runtime-benchmarks = [ 128 | "cumulus-pallet-parachain-system/runtime-benchmarks", 129 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 130 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 131 | "cumulus-primitives-utility/runtime-benchmarks", 132 | "frame-benchmarking/runtime-benchmarks", 133 | "frame-support/runtime-benchmarks", 134 | "frame-system-benchmarking/runtime-benchmarks", 135 | "frame-system/runtime-benchmarks", 136 | "hex-literal", 137 | "pallet-balances/runtime-benchmarks", 138 | "pallet-collator-selection/runtime-benchmarks", 139 | "pallet-parachain-template/runtime-benchmarks", 140 | "pallet-sudo/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-xcm/runtime-benchmarks", 143 | "polkadot-parachain-primitives/runtime-benchmarks", 144 | "polkadot-runtime-common/runtime-benchmarks", 145 | "sp-runtime/runtime-benchmarks", 146 | "xcm-builder/runtime-benchmarks", 147 | "xcm-executor/runtime-benchmarks", 148 | ] 149 | 150 | try-runtime = [ 151 | "cumulus-pallet-aura-ext/try-runtime", 152 | "cumulus-pallet-dmp-queue/try-runtime", 153 | "cumulus-pallet-parachain-system/try-runtime", 154 | "cumulus-pallet-xcm/try-runtime", 155 | "cumulus-pallet-xcmp-queue/try-runtime", 156 | "frame-executive/try-runtime", 157 | "frame-support/try-runtime", 158 | "frame-system/try-runtime", 159 | "frame-try-runtime/try-runtime", 160 | "pallet-aura/try-runtime", 161 | "pallet-authorship/try-runtime", 162 | "pallet-balances/try-runtime", 163 | "pallet-collator-selection/try-runtime", 164 | "pallet-parachain-template/try-runtime", 165 | "pallet-session/try-runtime", 166 | "pallet-sudo/try-runtime", 167 | "pallet-timestamp/try-runtime", 168 | "pallet-transaction-payment/try-runtime", 169 | "pallet-xcm/try-runtime", 170 | "parachain-info/try-runtime", 171 | "polkadot-runtime-common/try-runtime", 172 | "sp-runtime/try-runtime", 173 | ] 174 | 175 | experimental = [ "pallet-aura/experimental" ] 176 | -------------------------------------------------------------------------------- /src/testing/plan-toml/output.Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runtime" 3 | version = "1.0.0" 4 | authors = ["Anonymous"] 5 | description = "A parachain runtime." 6 | license = "Unlicense" 7 | edition = 2021 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [build-dependencies] 13 | substrate-wasm-builder = { version = "16.0.0", optional = true } 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } 17 | hex-literal = { version = "0.4.1", optional = true } 18 | log = { version = "0.4.20", default-features = false } 19 | scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } 20 | smallvec = "1.11.0" 21 | 22 | # Local 23 | pallet-parachain-template = { version = "0.6.0", default-features = false } 24 | 25 | # Substrate 26 | frame-benchmarking = { version = "27.0.0", default-features = false, optional = true } 27 | frame-executive = { version = "27.0.0", default-features = false } 28 | frame-support = { version = "27.0.0", default-features = false } 29 | frame-system = { version = "27.0.0", default-features = false } 30 | frame-system-benchmarking = { version = "27.0.0", default-features = false, optional = true } 31 | frame-system-rpc-runtime-api = { version = "25.0.0", default-features = false } 32 | frame-try-runtime = { version = "0.33.0", default-features = false, optional = true } 33 | pallet-aura = { version = "26.0.0", default-features = false } 34 | pallet-authorship = { version = "27.0.0", default-features = false } 35 | pallet-balances = { version = "27.0.0", default-features = false } 36 | pallet-session = { version = "27.0.0", default-features = false } 37 | pallet-sudo = { version = "27.0.0", default-features = false } 38 | pallet-timestamp = { version = "26.0.0", default-features = false } 39 | pallet-transaction-payment = { version = "27.0.0", default-features = false } 40 | pallet-transaction-payment-rpc-runtime-api = { version = "27.0.0", default-features = false } 41 | sp-api = { version = "25.0.0", default-features = false } 42 | sp-block-builder = { version = "25.0.0", default-features = false } 43 | sp-consensus-aura = { version = "0.31.0", default-features = false } 44 | sp-core = { version = "27.0.0", default-features = false } 45 | sp-genesis-builder = { version = "0.6.0", default-features = false } 46 | sp-inherents = { version = "25.0.0", default-features = false } 47 | sp-offchain = { version = "25.0.0", default-features = false } 48 | sp-runtime = { version = "30.0.1", default-features = false } 49 | sp-session = { version = "26.0.0", default-features = false } 50 | sp-std = { version = "13.0.0", default-features = false } 51 | sp-transaction-pool = { version = "25.0.0", default-features = false } 52 | sp-version = { version = "28.0.0", default-features = false } 53 | 54 | # Polkadot 55 | pallet-xcm = { version = "6.0.0", default-features = false } 56 | polkadot-parachain-primitives = { version = "5.0.0", default-features = false } 57 | polkadot-runtime-common = { version = "6.0.0", default-features = false } 58 | xcm = { version = "6.0.0", package = "staging-xcm", default-features = false } 59 | xcm-builder = { version = "6.0.2", package = "staging-xcm-builder", default-features = false } 60 | xcm-executor = { version = "6.0.2", package = "staging-xcm-executor", default-features = false } 61 | 62 | # Cumulus 63 | cumulus-pallet-aura-ext = { version = "0.6.0", default-features = false } 64 | cumulus-pallet-dmp-queue = { version = "0.6.0", default-features = false } 65 | cumulus-pallet-parachain-system = { version = "0.6.0", default-features = false, features = ["parameterized-consensus-hook"] } 66 | cumulus-pallet-session-benchmarking = { version = "8.0.0", default-features = false } 67 | cumulus-pallet-xcm = { version = "0.6.0", default-features = false } 68 | cumulus-pallet-xcmp-queue = { version = "0.6.0", default-features = false } 69 | cumulus-primitives-core = { version = "0.6.0", default-features = false } 70 | cumulus-primitives-utility = { version = "0.6.2", default-features = false } 71 | pallet-collator-selection = { version = "8.0.2", default-features = false } 72 | parachain-info = { version = "0.6.0", package = "staging-parachain-info", default-features = false } 73 | 74 | [features] 75 | default = [ "std" ] 76 | std = [ 77 | "codec/std", 78 | "cumulus-pallet-aura-ext/std", 79 | "cumulus-pallet-dmp-queue/std", 80 | "cumulus-pallet-parachain-system/std", 81 | "cumulus-pallet-session-benchmarking/std", 82 | "cumulus-pallet-xcm/std", 83 | "cumulus-pallet-xcmp-queue/std", 84 | "cumulus-primitives-core/std", 85 | "cumulus-primitives-utility/std", 86 | "frame-benchmarking?/std", 87 | "frame-executive/std", 88 | "frame-support/std", 89 | "frame-system-benchmarking?/std", 90 | "frame-system-rpc-runtime-api/std", 91 | "frame-system/std", 92 | "frame-try-runtime?/std", 93 | "log/std", 94 | "pallet-aura/std", 95 | "pallet-authorship/std", 96 | "pallet-balances/std", 97 | "pallet-collator-selection/std", 98 | "pallet-parachain-template/std", 99 | "pallet-session/std", 100 | "pallet-sudo/std", 101 | "pallet-timestamp/std", 102 | "pallet-transaction-payment-rpc-runtime-api/std", 103 | "pallet-transaction-payment/std", 104 | "pallet-xcm/std", 105 | "parachain-info/std", 106 | "polkadot-parachain-primitives/std", 107 | "polkadot-runtime-common/std", 108 | "scale-info/std", 109 | "sp-api/std", 110 | "sp-block-builder/std", 111 | "sp-consensus-aura/std", 112 | "sp-core/std", 113 | "sp-genesis-builder/std", 114 | "sp-inherents/std", 115 | "sp-offchain/std", 116 | "sp-runtime/std", 117 | "sp-session/std", 118 | "sp-std/std", 119 | "sp-transaction-pool/std", 120 | "sp-version/std", 121 | "substrate-wasm-builder", 122 | "xcm-builder/std", 123 | "xcm-executor/std", 124 | "xcm/std", 125 | ] 126 | 127 | runtime-benchmarks = [ 128 | "cumulus-pallet-parachain-system/runtime-benchmarks", 129 | "cumulus-pallet-session-benchmarking/runtime-benchmarks", 130 | "cumulus-pallet-xcmp-queue/runtime-benchmarks", 131 | "cumulus-primitives-utility/runtime-benchmarks", 132 | "frame-benchmarking/runtime-benchmarks", 133 | "frame-support/runtime-benchmarks", 134 | "frame-system-benchmarking/runtime-benchmarks", 135 | "frame-system/runtime-benchmarks", 136 | "hex-literal", 137 | "pallet-balances/runtime-benchmarks", 138 | "pallet-collator-selection/runtime-benchmarks", 139 | "pallet-parachain-template/runtime-benchmarks", 140 | "pallet-sudo/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-xcm/runtime-benchmarks", 143 | "polkadot-parachain-primitives/runtime-benchmarks", 144 | "polkadot-runtime-common/runtime-benchmarks", 145 | "sp-runtime/runtime-benchmarks", 146 | "xcm-builder/runtime-benchmarks", 147 | "xcm-executor/runtime-benchmarks", 148 | ] 149 | 150 | try-runtime = [ 151 | "cumulus-pallet-aura-ext/try-runtime", 152 | "cumulus-pallet-dmp-queue/try-runtime", 153 | "cumulus-pallet-parachain-system/try-runtime", 154 | "cumulus-pallet-xcm/try-runtime", 155 | "cumulus-pallet-xcmp-queue/try-runtime", 156 | "frame-executive/try-runtime", 157 | "frame-support/try-runtime", 158 | "frame-system/try-runtime", 159 | "frame-try-runtime/try-runtime", 160 | "pallet-aura/try-runtime", 161 | "pallet-authorship/try-runtime", 162 | "pallet-balances/try-runtime", 163 | "pallet-collator-selection/try-runtime", 164 | "pallet-parachain-template/try-runtime", 165 | "pallet-session/try-runtime", 166 | "pallet-sudo/try-runtime", 167 | "pallet-timestamp/try-runtime", 168 | "pallet-transaction-payment/try-runtime", 169 | "pallet-xcm/try-runtime", 170 | "parachain-info/try-runtime", 171 | "polkadot-runtime-common/try-runtime", 172 | "sp-runtime/try-runtime", 173 | ] 174 | 175 | experimental = [ "pallet-aura/experimental" ] 176 | -------------------------------------------------------------------------------- /src/tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Parity Technologies (UK) Ltd. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #[cfg(test)] 17 | mod tests { 18 | use crate::versions::get_orml_crates_and_version; 19 | use crate::versions::get_version_mapping_with_fallback; 20 | use crate::versions::include_orml_crates_in_version_mapping; 21 | use crate::versions::Repository; 22 | use std::{error::Error, path::Path}; 23 | 24 | async fn verify_version_mapping( 25 | version: &str, 26 | input_cargo_toml_path: &Path, 27 | expected_cargo_toml: &str, 28 | ) { 29 | let crates_versions = get_version_mapping_with_fallback(crate::DEFAULT_GIT_SERVER, version) 30 | .await 31 | .unwrap(); 32 | 33 | // Call the refactored logic function with the test data 34 | let result = 35 | crate::update_dependencies_impl(&input_cargo_toml_path, &crates_versions, false, false) 36 | .unwrap(); 37 | 38 | // Assert that the result matches the expected output 39 | assert_eq!(result, Some(expected_cargo_toml.into())); 40 | } 41 | 42 | async fn verify_version_checking( 43 | version: &str, 44 | input_cargo_toml_path: &Path, 45 | ) -> Result, Box> { 46 | let mut crates_versions = 47 | get_version_mapping_with_fallback(crate::DEFAULT_GIT_SERVER, version) 48 | .await 49 | .unwrap(); 50 | 51 | let orml_crates_version = 52 | get_orml_crates_and_version(crate::DEFAULT_GIT_SERVER, &version).await?; 53 | include_orml_crates_in_version_mapping(&mut crates_versions, orml_crates_version); 54 | 55 | // Call the refactored logic function with the test data 56 | let result = 57 | crate::update_dependencies_impl(&input_cargo_toml_path, &crates_versions, false, true); 58 | 59 | result 60 | } 61 | 62 | async fn verify_orml_version_mapping( 63 | version: &str, 64 | input_cargo_toml_path: &Path, 65 | expected_cargo_toml: &str, 66 | ) { 67 | let mut crates_versions = 68 | get_version_mapping_with_fallback(crate::DEFAULT_GIT_SERVER, version) 69 | .await 70 | .unwrap(); 71 | 72 | let orml_crates_version = get_orml_crates_and_version(crate::DEFAULT_GIT_SERVER, &version) 73 | .await 74 | .unwrap(); 75 | include_orml_crates_in_version_mapping(&mut crates_versions, orml_crates_version); 76 | 77 | // Call the refactored logic function with the test data 78 | let result = 79 | crate::update_dependencies_impl(&input_cargo_toml_path, &crates_versions, false, false) 80 | .unwrap(); 81 | 82 | // Assert that the result matches the expected output 83 | assert_eq!(result, Some(expected_cargo_toml.into())); 84 | } 85 | 86 | #[tokio::test] 87 | // cargo psvm -v 1.3.0 88 | // This version doesn't have the Plan.toml file, so it will fallback to Cargo.lock 89 | async fn test_get_version_with_fallback() { 90 | let input_cargo_toml_path = Path::new("src/testing/cargo-lock/input.Cargo.toml"); 91 | let expected_cargo_toml = include_str!("testing/cargo-lock/output.Cargo.toml"); 92 | let version = "1.3.0"; 93 | 94 | verify_version_mapping(version, input_cargo_toml_path, expected_cargo_toml).await; 95 | } 96 | 97 | #[tokio::test] 98 | // cargo psvm -v 1.14.0 -c 99 | // This version has the Plan.toml file, so it will not fallback to Cargo.lock 100 | // and check if the versions in the local toml file comply with the Plan.toml file 101 | async fn test_check_version_without_fallback_passes() { 102 | let input_cargo_toml_path = Path::new("src/testing/plan-toml/check.Cargo.toml"); 103 | let version = "1.14.0"; 104 | 105 | let res = verify_version_checking(version, input_cargo_toml_path).await; 106 | assert!(res.is_ok()); 107 | assert!(res.unwrap().is_none()); 108 | } 109 | 110 | #[tokio::test] 111 | // cargo psvm -v 1.6.0 -c -O 112 | // This version has the Plan.toml file, so it will not fallback to Cargo.lock 113 | // and check if the versions in the local toml file comply with the Plan.toml file, 114 | // including the ORML crates. 115 | async fn test_check_version_with_orml_passes() { 116 | let input_cargo_toml_path = Path::new("src/testing/orml/output.Cargo.toml"); 117 | let version = "1.6.0"; 118 | 119 | let res = verify_version_checking(version, input_cargo_toml_path).await; 120 | assert!(res.is_ok()); 121 | assert!(res.unwrap().is_none()); 122 | } 123 | 124 | #[tokio::test] 125 | // cargo psvm -v 1.4.0 -c 126 | // This version doesn't have the Plan.toml file, so it will fallback to Cargo.lock 127 | // and check if the versions in the local toml file comply with the Cargo.lock file. 128 | // This will fail because the Cargo.toml file has version 1.14.0 while we are checking 129 | // against 1.4.0 130 | async fn test_check_version_without_fallback_fails_with_incorrect_version() { 131 | let input_cargo_toml_path = Path::new("src/testing/plan-toml/check.Cargo.toml"); 132 | let version = "1.4.0"; 133 | 134 | let res = verify_version_checking(version, input_cargo_toml_path).await; 135 | assert!(res.is_err()); 136 | assert_eq!( 137 | res.unwrap_err().to_string(), 138 | "Dependencies are not up to date" 139 | ); 140 | } 141 | 142 | #[tokio::test] 143 | // cargo psvm -v 1.3.0 -c 144 | // This version doesn't have the Plan.toml file, so it will fallback to Cargo.lock 145 | // and check if the versions in the local toml file comply with the Cargo.lock file 146 | async fn test_check_version_with_fallback_passes() { 147 | let input_cargo_toml_path = Path::new("src/testing/cargo-lock/output.Cargo.toml"); 148 | let version = "1.3.0"; 149 | 150 | let res = verify_version_checking(version, input_cargo_toml_path).await; 151 | assert!(res.is_ok()); 152 | assert!(res.unwrap().is_none()); 153 | } 154 | 155 | #[tokio::test] 156 | // cargo psvm -v 1.5.0 157 | // This version has the Plan.toml file, so it will not fallback to Cargo.lock 158 | async fn test_dependency_branch_plan_update() { 159 | let input_toml_path = Path::new("src/testing/plan-toml/input.Cargo.toml"); 160 | let expected_output_toml = include_str!("testing/plan-toml/output.Cargo.toml"); 161 | let version = "1.5.0"; 162 | 163 | verify_version_mapping(version, input_toml_path, expected_output_toml).await; 164 | } 165 | 166 | #[tokio::test] 167 | // cargo psvm -v 1.6.0 -O 168 | // This version is present in the ORML repository, so it will fetch the ORML crates and update 169 | // the Cargo.toml file with the new versions 170 | async fn test_orml_version_mapping_passes() { 171 | let input_cargo_toml_path = Path::new("src/testing/orml/input.Cargo.toml"); 172 | let output_cargo_toml_path = include_str!("testing/orml/output.Cargo.toml"); 173 | let version = "1.6.0"; 174 | 175 | verify_orml_version_mapping(version, input_cargo_toml_path, output_cargo_toml_path).await; 176 | } 177 | 178 | #[tokio::test] 179 | // cargo psvm -v 1.14.0 -O 180 | // This version is not present in the ORML repository, so it will not fetch the ORML crates and update 181 | // the Cargo.toml file with only the polkadot-sdk versions 182 | async fn test_orml_mapping_without_branch_passes() { 183 | let input_cargo_toml_path = Path::new("src/testing/orml/input.Cargo.toml"); 184 | let output_cargo_toml_path = include_str!("testing/orml/notOrml.Cargo.toml"); 185 | let version = "1.14.0"; 186 | 187 | verify_orml_version_mapping(version, input_cargo_toml_path, output_cargo_toml_path).await; 188 | } 189 | 190 | #[tokio::test] 191 | // cargo psvm -v 1.6.0 192 | // This version is present in the ORML repository, but the --orml flag isn't supplied so it will not touch 193 | // the ORML crates and update the Cargo.toml file with only the polkadot-sdk versions 194 | async fn test_orml_mapping_without_flag_passes() { 195 | let input_cargo_toml_path = Path::new("src/testing/orml/input.Cargo.toml"); 196 | let output_cargo_toml_path = include_str!("testing/orml/noFlag.Cargo.toml"); 197 | let version = "1.6.0"; 198 | 199 | verify_version_mapping(version, input_cargo_toml_path, output_cargo_toml_path).await; 200 | } 201 | 202 | #[tokio::test] 203 | async fn test_parse_version_mapping_from_plan_toml() { 204 | let response = r#" 205 | [[crate]] 206 | name = "package_minor" 207 | from = "0.1.0" 208 | to = "0.1.1" 209 | bump = "minor" 210 | reason = "bumped by --patch" 211 | 212 | [[crate]] 213 | name = "package_major" 214 | from = "1.0.0" 215 | to = "2.0.0" 216 | bump = "major" 217 | reason = "changed" 218 | 219 | [[crate]] 220 | name = "package_no_publish" 221 | from = "0.1.0" 222 | to = "0.1.0" 223 | bump = "major" 224 | publish = false 225 | "#; 226 | let version = "N.N.N"; 227 | let source = "Plan.toml"; 228 | 229 | let _m = mockito::mock( 230 | "GET", 231 | format!( 232 | "/paritytech/polkadot-sdk/release-crates-io-v{}/{}", 233 | version, source 234 | ) 235 | .as_str(), 236 | ) 237 | .with_status(200) 238 | .with_body(response) 239 | .create(); 240 | 241 | let git_server = &mockito::server_url(); 242 | let mapping = get_version_mapping_with_fallback(git_server, version) 243 | .await 244 | .unwrap(); 245 | 246 | assert_eq!(mapping.len(), 2); 247 | assert_eq!(mapping.get("package_minor"), Some(&"0.1.1".to_string())); 248 | assert_eq!(mapping.get("package_major"), Some(&"2.0.0".to_string())); 249 | } 250 | 251 | #[tokio::test] 252 | async fn test_parse_version_mapping_from_cargo_lock() { 253 | let response = r#" 254 | [[package]] 255 | name = "local_package" 256 | version = "0.1.0" 257 | 258 | [[package]] 259 | name = "remote_package" 260 | version = "0.1.0" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | "#; 263 | let version = "N.N.N"; 264 | let source = "Cargo.lock"; 265 | 266 | let _m = mockito::mock( 267 | "GET", 268 | format!( 269 | "/paritytech/polkadot-sdk/release-crates-io-v{}/{}", 270 | version, source 271 | ) 272 | .as_str(), 273 | ) 274 | .with_status(200) 275 | .with_body(response) 276 | .create(); 277 | 278 | let git_server = &mockito::server_url(); 279 | let mapping = get_version_mapping_with_fallback(git_server, version) 280 | .await 281 | .unwrap(); 282 | 283 | assert_eq!(mapping.len(), 1); 284 | assert_eq!(mapping.get("local_package"), Some(&"0.1.0".to_string())); 285 | } 286 | 287 | #[tokio::test] 288 | // This test will fetch all available versions, update a generic parachain Cargo.toml file 289 | // and assert that the Cargo.toml file has been updated (modified) 290 | // This is not exhaustive, but it's a good way to ensure that the logic works for all versions 291 | // To run this test, ensure you have installed the GitHub CLI and are authenticated 292 | // cause it will fetch the latest release branches from the GitHub API 293 | async fn works_for_all_versions() { 294 | let release_versions = crate::versions::get_polkadot_sdk_versions().await.unwrap(); 295 | 296 | for version in release_versions { 297 | let crates_versions = 298 | get_version_mapping_with_fallback(crate::DEFAULT_GIT_SERVER, &version) 299 | .await 300 | .unwrap(); 301 | 302 | assert!( 303 | crates_versions.len() > 0, 304 | "No versions found for {}", 305 | version 306 | ); 307 | 308 | let input_cargo_toml_path = Path::new("src/testing/plan-toml/input.Cargo.toml"); 309 | let result = crate::update_dependencies_impl( 310 | &input_cargo_toml_path, 311 | &crates_versions, 312 | false, 313 | false, 314 | ) 315 | .unwrap(); 316 | 317 | assert!(result.is_some()); // If no changes are made, the result will be None 318 | } 319 | } 320 | 321 | #[tokio::test] 322 | // This test will fetch all available versions, update a generic parachain Cargo.toml file 323 | // and assert that the Cargo.toml file has been updated (modified) 324 | // This is not exhaustive, but it's a good way to ensure that the logic works for all orml versions 325 | // To run this test, ensure you have installed the GitHub CLI and are authenticated 326 | // cause it will fetch the latest release branches from the GitHub API 327 | async fn works_for_all_orml_versions() { 328 | let release_versions = crate::versions::get_release_branches_versions(Repository::Orml) 329 | .await 330 | .unwrap(); 331 | 332 | for version in release_versions { 333 | let mut crates_versions = 334 | get_version_mapping_with_fallback(crate::DEFAULT_GIT_SERVER, &version) 335 | .await 336 | .unwrap(); 337 | 338 | let orml_crates_version = 339 | get_orml_crates_and_version(crate::DEFAULT_GIT_SERVER, &version) 340 | .await 341 | .unwrap(); 342 | include_orml_crates_in_version_mapping(&mut crates_versions, orml_crates_version); 343 | 344 | assert!( 345 | crates_versions.len() > 0, 346 | "No versions found for {}", 347 | version 348 | ); 349 | 350 | let input_cargo_toml_path = Path::new("src/testing/orml/input.Cargo.toml"); 351 | let result = crate::update_dependencies_impl( 352 | &input_cargo_toml_path, 353 | &crates_versions, 354 | false, 355 | false, 356 | ) 357 | .unwrap(); 358 | 359 | assert!(result.is_some()); // If no changes are made, the result will be None 360 | } 361 | } 362 | } 363 | -------------------------------------------------------------------------------- /src/versions.rs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Parity Technologies (UK) Ltd. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use regex::Regex; 17 | use serde::Deserialize; 18 | use std::collections::{BTreeMap, HashSet}; 19 | 20 | /// Represents the structure of a Cargo.lock file, including all packages. 21 | #[derive(Debug, Deserialize)] 22 | struct CargoLock { 23 | /// A list of packages included in the Cargo.lock file. 24 | package: Vec, 25 | } 26 | 27 | /// Represents a single package within a Cargo.lock file. 28 | #[derive(Debug, Deserialize)] 29 | struct Package { 30 | /// The name of the package. 31 | name: String, 32 | /// The version of the package. 33 | version: String, 34 | /// The source from which the package was retrieved(usually GitHub), if any. 35 | source: Option, 36 | } 37 | 38 | /// Represents the structure of a Plan.toml file, with all crates. 39 | #[derive(Debug, Deserialize)] 40 | pub struct PlanToml { 41 | /// A list of crates included in the Plan.toml file. 42 | #[serde(rename = "crate")] 43 | pub crates: Vec, 44 | } 45 | 46 | /// Represents a single crate within a Plan.toml file. 47 | #[derive(Debug, Deserialize)] 48 | pub struct Crate { 49 | /// The name of the crate. 50 | pub name: String, 51 | /// The version the crate is updating to. 52 | pub to: String, 53 | /// The current version of the crate. 54 | pub from: String, 55 | /// Indicates if the crate should be published. 56 | pub publish: Option, 57 | } 58 | 59 | /// Represents the structure of an Orml.toml file with workspace information. 60 | #[derive(Debug, Deserialize)] 61 | pub struct OrmlToml { 62 | /// The workspace information. 63 | pub workspace: Workspace, 64 | } 65 | 66 | /// Represents the metadata section within a workspace. 67 | #[derive(Deserialize, Debug)] 68 | pub struct Metadata { 69 | /// ORML specific metadata. 70 | orml: Orml, 71 | } 72 | 73 | /// Represents ORML specific metadata. 74 | #[derive(Deserialize, Debug)] 75 | pub struct Orml { 76 | /// The version of the crates managed by ORML. 77 | #[serde(rename = "crates-version")] 78 | crates_version: String, 79 | } 80 | 81 | /// Represents a workspace, including its members and metadata. 82 | #[derive(Deserialize, Debug)] 83 | pub struct Workspace { 84 | /// A list of members (crates) in the workspace. 85 | members: Vec, 86 | /// Metadata associated with the workspace. 87 | metadata: Metadata, 88 | } 89 | 90 | /// Represents a tag by its name. 91 | #[derive(Deserialize, Debug)] 92 | pub struct TagInfo { 93 | /// The name of the tag. 94 | pub name: String, 95 | } 96 | 97 | const POLKADOT_SDK_TAGS_URL: &str = 98 | "https://api.github.com/repos/paritytech/polkadot-sdk/tags?per_page=100&page="; 99 | const POLKADOT_SDK_TAGS_GH_CMD_URL: &str = "/repos/paritytech/polkadot-sdk/tags?per_page=100&page="; 100 | const POLKADOT_SDK_STABLE_TAGS_REGEX: &str = r"^polkadot-stable\d+(-\d+)?$"; 101 | 102 | /// Fetches a combined list of Polkadot SDK release versions and stable tag releases. 103 | /// 104 | /// This function first retrieves release branch versions from the Polkadot SDK and 105 | /// then fetches stable tag releases versions. It combines these two lists into a 106 | /// single list of version strings. 107 | /// 108 | /// # Returns 109 | /// A `Result` containing either a `Vec` of combined version names on success, 110 | /// or an `Error` if any part of the process fails. 111 | /// 112 | /// # Errors 113 | /// This function can return an error if either the fetching of release branches versions 114 | /// or the fetching of stable tag versions encounters an issue. 115 | pub async fn get_polkadot_sdk_versions() -> Result, Box> { 116 | let mut crates_io_releases = get_release_branches_versions(Repository::Psdk).await?; 117 | let mut stable_tag_versions = get_stable_tag_versions().await?; 118 | crates_io_releases.append(&mut stable_tag_versions); 119 | Ok(crates_io_releases) 120 | } 121 | 122 | /// Fetches a list of stable tag versions for the Polkadot SDK from GitHub. 123 | /// 124 | /// This function queries GitHub's API to retrieve tags for the Polkadot SDK, 125 | /// filtering them based on a predefined regex to identify stable versions. 126 | /// If the direct API request fails, it falls back to using the GitHub CLI. 127 | /// 128 | /// # Returns 129 | /// A `Result` containing either a `Vec` of stable tag names on success, 130 | /// or an `Error` if any part of the process fails. 131 | /// 132 | /// # Errors 133 | /// This function can return an error if the HTTP request fails, if parsing the 134 | /// response into text fails, if executing the GitHub CLI command fails, or if 135 | /// parsing the JSON response into `Vec` fails. 136 | pub async fn get_stable_tag_versions() -> Result, Box> { 137 | let mut release_tags = vec![]; 138 | 139 | for page in 1..100 { 140 | let response = reqwest::Client::new() 141 | .get(format!("{}{}", POLKADOT_SDK_TAGS_URL, page)) 142 | .header("User-Agent", "reqwest") 143 | .header("Accept", "application/vnd.github.v3+json") 144 | .send() 145 | .await?; 146 | 147 | let output = if response.status().is_success() { 148 | response.text().await? 149 | } else { 150 | // query the github api using gh command 151 | String::from_utf8( 152 | std::process::Command::new("gh") 153 | .args([ 154 | "api", 155 | "-H", 156 | "Accept: application/vnd.github+json", 157 | "-H", 158 | "X-GitHub-Api-Version: 2022-11-28", 159 | &format!("{}{}", POLKADOT_SDK_TAGS_GH_CMD_URL, page), 160 | ]) 161 | .output()? 162 | .stdout, 163 | )? 164 | }; 165 | 166 | let tag_branches: Vec = serde_json::from_str(&output)?; 167 | let tag_regex = Regex::new(POLKADOT_SDK_STABLE_TAGS_REGEX).unwrap(); 168 | 169 | let stable_tag_branches = tag_branches 170 | .iter() 171 | .filter(|b| tag_regex.is_match(&b.name)) 172 | .map(|branch| branch.name.to_string()); 173 | 174 | release_tags = release_tags 175 | .into_iter() 176 | .chain(stable_tag_branches) 177 | .collect(); 178 | 179 | if tag_branches.len() < 100 { 180 | break; 181 | } 182 | } 183 | 184 | Ok(release_tags) 185 | } 186 | 187 | /// Fetches the ORML crates and their versions for a specific version of Polkadot. 188 | /// 189 | /// This function queries a repository for a specific version of the ORML crates, 190 | /// attempting to retrieve the `Cargo.dev.toml` file that lists the ORML workspace members 191 | /// and the corresponding crates version. It uses the provided `base_url` and `version` to 192 | /// construct the URL for the request. 193 | /// 194 | /// # Arguments 195 | /// 196 | /// * `base_url` - The base URL of GitHub. 197 | /// * `version` - The release version of the Polkadot-sdk for which ORML crates' versions are being fetched. 198 | /// 199 | /// # Returns 200 | /// 201 | /// Returns `Ok(Some(OrmlToml))` if the `Cargo.dev.toml` file is successfully retrieved and parsed, 202 | /// indicating the ORML crates and their versions. Returns `Ok(None)` if no matching ORML release 203 | /// version is found for the corresponding Polkadot version. In case of any error during the 204 | /// fetching or parsing process, an error is returned. 205 | /// 206 | /// # Errors 207 | /// 208 | /// This function returns an error if there is any issue with the HTTP request, response parsing, 209 | /// or if the required fields are not found in the `Cargo.dev.toml` file. 210 | /// 211 | /// # Examples 212 | /// 213 | /// ``` 214 | /// #[tokio::main] 215 | /// async fn main() { 216 | /// let base_url = "https://raw.githubusercontent.com"; 217 | /// let version = "1.12.0"; 218 | /// match get_orml_crates_and_version(base_url, version).await { 219 | /// Ok(Some(orml_toml)) => println!("ORML crates: {:?}", orml_toml), 220 | /// Ok(None) => println!("No matching ORML version found."), 221 | /// Err(e) => println!("Error fetching ORML crates: {}", e), 222 | /// } 223 | /// } 224 | /// ``` 225 | pub async fn get_orml_crates_and_version( 226 | base_url: &str, 227 | version: &str, 228 | ) -> Result, Box> { 229 | if get_release_branches_versions(Repository::Orml) 230 | .await? 231 | .contains(&version.to_string()) 232 | { 233 | let version_url = format!( 234 | "{}/open-web3-stack/open-runtime-module-library/polkadot-v{}/Cargo.dev.toml", 235 | base_url, version 236 | ); 237 | let response = reqwest::Client::new() 238 | .get(&version_url) 239 | .header("User-Agent", "reqwest") 240 | .header("Accept", "application/vnd.github.v3+json") 241 | .send() 242 | .await?; 243 | 244 | let content = response.text().await?; 245 | 246 | let orml_workspace_members = toml::from_str::(&content) 247 | .map_err(|_| "Error Parsing ORML TOML. Required Fields not Found")?; 248 | Ok(Some(orml_workspace_members)) 249 | } else { 250 | log::error!( 251 | "No matching ORML release version found for corresponding polkadot-sdk version." 252 | ); 253 | Ok(None) 254 | } 255 | } 256 | 257 | /// Includes ORML crates in the version mapping. 258 | /// 259 | /// This function updates a given version mapping (`BTreeMap`) by adding the versions of ORML 260 | /// crates obtained from a `OrmlToml` instance. It prefixes each crate name with "orml-" and 261 | /// inserts the corresponding version into the map. If the `orml_crates_version` is `None`, 262 | /// the function does nothing. 263 | /// 264 | /// # Arguments 265 | /// 266 | /// * `crates_versions` - A mutable reference to a `BTreeMap` where the original polkadot-sdk 267 | /// crate names and versions are stored. 268 | /// * `orml_crates_version` - An `Option` that may contain the ORML crates and their 269 | /// versions. 270 | /// 271 | /// # Examples 272 | /// 273 | /// ``` 274 | /// let mut version_map: BTreeMap = BTreeMap::new(); 275 | /// include_orml_crates_in_version_mapping(&mut version_map, Some(orml_toml)); 276 | /// ``` 277 | pub fn include_orml_crates_in_version_mapping( 278 | crates_versions: &mut BTreeMap, 279 | orml_crates_version: Option, 280 | ) { 281 | if let Some(orml_toml) = orml_crates_version { 282 | for crate_name in orml_toml.workspace.members { 283 | crates_versions.insert( 284 | format!("orml-{}", crate_name), 285 | orml_toml.workspace.metadata.orml.crates_version.clone(), 286 | ); 287 | } 288 | } 289 | } 290 | 291 | pub async fn get_version_mapping_with_fallback( 292 | base_url: &str, 293 | version: &str, 294 | ) -> Result, Box> { 295 | let result = get_version_mapping(base_url, version, "Plan.toml").await; 296 | 297 | match result { 298 | Err(_) => get_version_mapping(base_url, version, "Cargo.lock").await, 299 | Ok(_) => result, 300 | } 301 | } 302 | 303 | fn version_to_url(base_url: &str, version: &str, source: &str) -> String { 304 | let stable_tag_regex_patten = Regex::new(POLKADOT_SDK_STABLE_TAGS_REGEX).unwrap(); 305 | let version = if version.starts_with("stable") { 306 | format!("polkadot-{}", version) 307 | } else if stable_tag_regex_patten.is_match(version) { 308 | version.into() 309 | } else { 310 | format!("release-crates-io-v{}", version) 311 | }; 312 | 313 | format!( 314 | "{}/paritytech/polkadot-sdk/{}/{}", 315 | base_url, version, source 316 | ) 317 | } 318 | 319 | pub async fn get_version_mapping( 320 | base_url: &str, 321 | version: &str, 322 | source: &str, 323 | ) -> Result, Box> { 324 | let url = version_to_url(base_url, version, source); 325 | let response = reqwest::Client::new() 326 | .get(&url) 327 | .header("User-Agent", "reqwest") 328 | .header("Accept", "application/vnd.github.v3+json") 329 | .send() 330 | .await?; 331 | 332 | let content = match response.error_for_status() { 333 | Ok(response) => response.text().await?, 334 | Err(err) => return Err(err.into()), 335 | }; 336 | 337 | match source { 338 | "Cargo.lock" => get_cargo_packages(&content), 339 | "Plan.toml" => get_plan_packages(&content).await, 340 | _ => panic!("Unknown source: {}", source), 341 | } 342 | } 343 | 344 | fn get_cargo_packages( 345 | content: &str, 346 | ) -> Result, Box> { 347 | let cargo_lock: CargoLock = toml::from_str(content)?; 348 | 349 | // Filter local packages and collect them into a JSON object 350 | let cargo_packages: BTreeMap<_, _> = cargo_lock 351 | .package 352 | .into_iter() 353 | .filter(|pkg| pkg.source.is_none()) 354 | .map(|pkg| (pkg.name, pkg.version)) 355 | .collect(); 356 | 357 | Ok(cargo_packages) 358 | } 359 | 360 | async fn get_plan_packages( 361 | content: &str, 362 | ) -> Result, Box> { 363 | let plan_toml: PlanToml = toml::from_str(content)?; 364 | 365 | let parity_owned_crates = get_parity_crate_owner_crates().await?; 366 | 367 | // Filter local packages and collect them into a JSON object 368 | let plan_packages: BTreeMap<_, _> = plan_toml 369 | .crates 370 | .into_iter() 371 | .filter(|pkg| { 372 | pkg.publish.unwrap_or(true) || { 373 | let placeholder = pkg.to == "0.0.0" && pkg.from == "0.0.0"; 374 | let public_not_in_release = parity_owned_crates.contains(&pkg.name) && !placeholder; 375 | if public_not_in_release { 376 | log::info!( 377 | "Adding public crate not in release {}: {} -> {}", 378 | pkg.name, 379 | pkg.from, 380 | pkg.to 381 | ); 382 | } 383 | public_not_in_release 384 | } 385 | }) 386 | .map(|pkg| (pkg.name, pkg.to)) 387 | .collect(); 388 | 389 | Ok(plan_packages) 390 | } 391 | 392 | /// Represents a single branch in a repository. 393 | /// 394 | /// This struct is used to deserialize JSON data from a repository's branch list. 395 | #[derive(serde::Deserialize, Debug)] 396 | struct Branch { 397 | /// The name of the branch. 398 | name: String, 399 | } 400 | 401 | /// Contains information about a repository. 402 | /// 403 | /// This struct holds various URLs and strings used to interact with a repository, 404 | /// including fetching branches and processing version information. 405 | struct RepositoryInfo { 406 | /// The URL to fetch branch information from the repository. 407 | branches_url: String, 408 | /// The URL for GitHub commands related to the repository. 409 | gh_cmd_url: String, 410 | /// A string used to filter versions from branch names. 411 | version_filter_string: String, 412 | /// A string used to replace parts of the version string if necessary. 413 | version_replace_string: String, 414 | } 415 | 416 | pub enum Repository { 417 | /// The official ORML repository 418 | Orml, 419 | /// The official Polkadot SDK repository 420 | Psdk, 421 | } 422 | 423 | fn get_repository_info(repository: &Repository) -> RepositoryInfo { 424 | match repository { 425 | Repository::Orml => RepositoryInfo { 426 | branches_url: "https://api.github.com/repos/open-web3-stack/open-runtime-module-library/branches?per_page=100&page=".into(), 427 | gh_cmd_url: "/repos/open-web3-stack/open-runtime-module-library/branches?per_page=100&page=".into(), 428 | version_filter_string: "polkadot-v1".into(), 429 | version_replace_string: "polkadot-v".into() 430 | }, 431 | Repository::Psdk => RepositoryInfo { 432 | branches_url: "https://api.github.com/repos/paritytech/polkadot-sdk/branches?per_page=100&page=".into(), 433 | gh_cmd_url: "/repos/paritytech/polkadot-sdk/branches?per_page=100&page=".into(), 434 | version_filter_string: "release-crates-io-v".into(), 435 | version_replace_string: "release-crates-io-v".into() 436 | }, 437 | } 438 | } 439 | 440 | /// Fetches the versions of release branches from a repository. 441 | /// 442 | /// This asynchronous function queries a repository for its branches and filters out those 443 | /// that match a specific versioning pattern. It supports fetching data via HTTP requests 444 | /// and, in case of failure, falls back to querying the GitHub API using the `gh` command-line tool. 445 | /// 446 | /// # Arguments 447 | /// 448 | /// * `repository` - A `Repository` enum specifying whether to query the ORML or Polkadot SDK repository. 449 | /// 450 | /// # Returns 451 | /// 452 | /// Returns a `Result` containing either a vector of version strings on success or an error on failure. 453 | /// 454 | /// # Errors 455 | /// 456 | /// This function can return an error in several cases, including but not limited to: 457 | /// - Network failures during the HTTP request. 458 | /// - JSON parsing errors when deserializing the response into `Branch` structs. 459 | /// - UTF-8 decoding errors when processing the output of the `gh` command. 460 | /// - I/O errors when executing the `gh` command. 461 | /// 462 | /// # Examples 463 | /// 464 | /// ```no_run 465 | /// #[tokio::main] 466 | /// async fn main() -> Result<(), Box> { 467 | /// let orml_repository = Repository::Orml; 468 | /// let orml_versions = get_release_branches_versions(orml_repository).await?; 469 | /// println!("Orml Release versions: {:?}", orml_versions); 470 | /// 471 | /// let psdk_repository = Repository::Psdk; 472 | /// let psdk_versions = get_release_branches_versions(psdk_repository).await?; 473 | /// println!("Polkadot-sdk Release versions: {:?}", psdk_versions); 474 | /// 475 | /// Ok(()) 476 | /// } 477 | /// ``` 478 | pub async fn get_release_branches_versions( 479 | repository: Repository, 480 | ) -> Result, Box> { 481 | let mut release_branches = vec![]; 482 | let repository_info = get_repository_info(&repository); 483 | 484 | for page in 1..100 { 485 | // currently there's 5 pages, so 100 should be enough 486 | let response = reqwest::Client::new() 487 | .get(format!("{}{}", repository_info.branches_url, page)) 488 | .header("User-Agent", "reqwest") 489 | .header("Accept", "application/vnd.github.v3+json") 490 | .send() 491 | .await?; 492 | 493 | let output = if response.status().is_success() { 494 | response.text().await? 495 | } else { 496 | // query the github api using gh command 497 | String::from_utf8( 498 | std::process::Command::new("gh") 499 | .args([ 500 | "api", 501 | "-H", 502 | "Accept: application/vnd.github+json", 503 | "-H", 504 | "X-GitHub-Api-Version: 2022-11-28", 505 | &format!("{}{}", repository_info.gh_cmd_url, page), 506 | ]) 507 | .output()? 508 | .stdout, 509 | )? 510 | }; 511 | 512 | let branches: Vec = serde_json::from_str(&output)?; 513 | 514 | let version_branches = branches 515 | .iter() 516 | .filter(|b| b.name.starts_with(&repository_info.version_filter_string)) 517 | .filter(|b| (b.name != "polkadot-v1.0.0")) // This is in place to filter that particular orml version as it is not a valid polkadot-sdk release version 518 | .map(|branch| { 519 | branch 520 | .name 521 | .replace(&repository_info.version_replace_string, "") 522 | }); 523 | 524 | release_branches = release_branches 525 | .into_iter() 526 | .chain(version_branches) 527 | .collect(); 528 | 529 | if branches.len() < 100 { 530 | break; 531 | } 532 | } 533 | 534 | Ok(release_branches) 535 | } 536 | 537 | pub async fn get_parity_crate_owner_crates() -> Result, Box> 538 | { 539 | let mut parity_crates = HashSet::new(); 540 | 541 | for page in 1..=10 { 542 | // Currently there are 7 pages (so this at most 1s) 543 | let response = reqwest::Client::new() 544 | .get(format!( 545 | "https://crates.io/api/v1/crates?page={}&per_page=100&user_id=150167", // parity-crate-owner 546 | page 547 | )) 548 | .header("User-Agent", "reqwest") 549 | .header("Accept", "application/vnd.github.v3+json") 550 | .send() 551 | .await?; 552 | 553 | let output = response.text().await?; 554 | 555 | let crates_data: serde_json::Value = serde_json::from_str(&output)?; 556 | 557 | let crates = crates_data["crates"].as_array().unwrap().iter(); 558 | 559 | let crates_len = crates.len(); 560 | 561 | let crate_names = crates 562 | .filter(|crate_data| crate_data["max_version"].as_str().unwrap_or_default() != "0.0.0") 563 | .map(|crate_data| crate_data["id"].as_str().unwrap_or_default().to_string()); 564 | 565 | parity_crates.extend(crate_names); 566 | 567 | if crates_len < 100 { 568 | break; 569 | } 570 | } 571 | 572 | Ok(parity_crates) 573 | } 574 | --------------------------------------------------------------------------------